{"id":936,"date":"2020-03-13T10:49:18","date_gmt":"2020-03-13T10:49:18","guid":{"rendered":"https:\/\/swiv.com.br\/solved-issue-session-expired-when-try-to-use-emcli-utility-oem13c\/"},"modified":"2026-05-27T20:02:54","modified_gmt":"2026-05-27T19:02:54","slug":"solved-issue-session-expired-when-try-to-use-emcli-utility-oem13c","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2020\/03\/13\/solved-issue-session-expired-when-try-to-use-emcli-utility-oem13c\/","title":{"rendered":"[Solved] Issue: Session expired when try to use EMCLI utility (OEM13C)"},"content":{"rendered":"<p>Por uma quest\u00e3o pontual, precisava deletar um agent do Oracle Enterprise Manager Cloud Control (OEM13C). Encontrei um procedimento documentado no Oracle Note &#8220;<strong>EM 12c, EM 13c: How to Delete Agent and Targets Using emcli with the delete_target Verb in Enterprise Manager Cloud Control (Doc ID 1459204.1)<\/strong>&#8220;.<\/p>\n\n\n<p>O primeiro passo, \u00e9 voc\u00ea estar no ambiente onde foi instalado a aplica\u00e7\u00e3o OEM13C, pois precisar\u00e1 usar o utilit\u00e1rio &#8220;EMCLI&#8221;. Caso n\u00e3o saiba onde ele est\u00e1 localizado, fa\u00e7a um find -name na \u00e1rea de bin\u00e1rios para facilitar o trabalho:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;user@hostname OEM13C]$ find -name emcli\n.\/XXX\/OPatch\/Patches\/28161815\/28161815\/files\/oracle.sysman.top.oms\/13.2.0.0.0\/oracle.sysman.top.oms.symbol\/sysman\/emcli\n.\/XXX\/OPatch\/Patches\/28161815\/28161815\/files\/oracle.sysman.top.oms\/13.2.0.0.0\/oracle.sysman.top.oms.symbol\/sysman\/emcli\/omssideext\/standardomsside.jar\/oracle\/sysman\/core\/common\/blackouts\/emcli\n.\/XXX\/OPatch\/Patches\/28161815\/28161815\/files\/oracle.sysman.top.oms\/13.2.0.0.0\/oracle.sysman.top.oms.symbol\/sysman\/emcli\/omssideext\/standardomsside.jar\/oracle\/sysman\/emdrep\/user_model\/emcli\n.\/XXX\/OPatch\/Patches\/28161815\/28161815\/files\/oracle.sysman.top.oms\/13.2.0.0.0\/oracle.sysman.top.oms.symbol\/sysman\/emcli\/omssideext\/standardomsside.jar\/oracle\/sysman\/eml\/admin\/rep\/emdConfig\/emcli\n.\/XXX\/OPatch\/25672422\/25414245\/files\/oracle.sysman.cfw.oms.plugin\/13.2.1.0.0\/em.plugin.common.symbol\/oracle.sysman.cfw.oms.plugin_13.2.1.0.0\/archives\/emcli\n \n. . . \n \n.\/XXX\/bin\/emcli\n.\/XXX\/plugins\/oracle.sysman.ssa.oms.plugin_13.2.1.0.0\/archives\/emcli\n.\/XXX\/plugins\/oracle.sysman.emas.oms.plugin_13.2.1.0.0\/archives\/emcli\n \n. . . \n&#x5B;user@hostname OEM13C]$\n<\/pre><\/div>\n\n\n<p>Como era esperado, o utilit\u00e1rio se encontra no &#8220;EMCLI_HOME\/bin&#8221;. Desse modo, tentei disparar o delete do target, por\u00e9m recebi o seguinte erro:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;user@hostname bin]$ .\/emcli delete_target -name=&quot;target_name:XXXX&quot; -type=&quot;oracle_emd&quot; -delete_monitored_targets -async\nError: Session expired. Run emcli login to establish a session.\n<\/pre><\/div>\n\n<p>Me deparei com outro Oracle Note (&#8220;<strong>EM 12c, EM 13c: EMCLI commands Fail with Message: Error: Session expired. Run emcli login to establish a session (Doc ID 1913968.1)<\/strong>&#8220;), reportando que o erro podia ter 4 causas. No meu caso, foi por conta do usu\u00e1rio do emcli estar expirado.<\/p>\n\n\n<p>O comando abaixo caracteriza essa situa\u00e7\u00e3o:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;user@hostname bin]$ .\/emcli sync\nError: Session expired. Run emcli login to establish a session.\n<\/pre><\/div>\n\n\n<p>Conforme procedimento, foi necess\u00e1rio executar o comando abaixo para normalizar a situa\u00e7\u00e3o do usu\u00e1rio. \u00c9 solicitado que se passe a senha do usu\u00e1rio default &#8220;sysman&#8221;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;user@hostname bin]$ .\/emcli login -username=sysman\nEnter password :\n \nLogin successful\n<\/pre><\/div>\n\n\n<p>Depois disso, a execu\u00e7\u00e3o da exclus\u00e3o do agent (e seus targets associados) procedeu com sucesso:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;user@hostname bin]$ .\/emcli delete_target -name=&quot;target_name:XXXX&quot; -type=&quot;oracle_emd&quot; -delete_monitored_targets -async\nTarget &quot;target_name:XXXX:oracle_emd&quot; deleted successfully\n&#x5B;user@hostname bin]$\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Por uma quest\u00e3o pontual, precisava deletar um agent do Oracle Enterprise Manager Cloud Control (OEM13C). Encontrei um procedimento documentado no Oracle Note &#8220;EM 12c, EM 13c: How to Delete Agent and Targets Using emcli with the delete_target Verb in Enterprise Manager Cloud Control (Doc ID 1459204.1)&#8220;. O primeiro passo, \u00e9 voc\u00ea estar no ambiente onde [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[15],"class_list":["post-936","post","type-post","status-publish","format-standard","hentry","category-administration","tag-enterprise-manager"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/936","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=936"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/936\/revisions"}],"predecessor-version":[{"id":9306,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/936\/revisions\/9306"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=936"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}