{"id":3720,"date":"2021-03-03T18:06:23","date_gmt":"2021-03-03T18:06:23","guid":{"rendered":"https:\/\/nenadnoveljic.com\/blog\/?p=3720"},"modified":"2021-06-09T11:08:41","modified_gmt":"2021-06-09T11:08:41","slug":"troubleshooting-emcli-login-problem","status":"publish","type":"post","link":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/","title":{"rendered":"Troubleshooting an emcli Login Problem"},"content":{"rendered":"<p>emcli is a utility for interacting with Oracle Cloud Control from the command line.<\/p>\n<p>We configure autologin to conveniently use it in our automation scripts:<\/p>\n<pre><code>emcli setup -url=\"https:\/\/oms:7803\/em\" -username=\"<span style=\"color:blue\">test<\/span>\" -autologin<\/code><\/pre>\n<p><span style=\"color:blue\">test<\/span> is a Cloud Control account, which must exist prior to running the command above.<\/p>\n<p>Now you can start using emcli. For example, you can list the registered targets:<\/p>\n<pre><code>emcli list -resource=\"Targets\" -format=\"name:csv\"\n\nTARGET_NAME,TARGET_TYPE,TARGET_GUID,TYPE_VERSION,TYPE_QUALIFIER1,TYPE_QUALIFIER2,TYPE_QUALIFIER3,TYPE_QUALIFIER4,TYPE_QUALIFIER5,EMD_URL,TIMEZONE_REGION,DISPLAY_NAME,HOST_NAME,LAST_METRIC_LOAD_TIME,TYPE_DISPLAY_NAME,BROKEN_REASON,BROKEN_STR,OWNER,LAST_LOAD_TIME_UTC,CREATION_DATE\nEM Console Service,oracle_em_service,54ABB160C4A4146A7F8167B56739216D,3.0,                                                                ,                                                                ,                                                                ,                                                                ,                                                                ,                    ,Europe\/Zurich,EM Console Service,                    ,2021-01-11 11:18:38.0,EM Service,0,                    ,SYSMAN,2021-01-11 10:18:38.0,2021-01-07 16:20:09.0\nEM Jobs Service,oracle_em_service,F0E4D5A3A4489A66964A5F2894638605,3.0,                                                                ,                                                                ,                                                                ,                                                                ,                                                                ,                    ,Europe\/Zurich,EM Jobs Service,                    ,2021-03-03 12:01:25.0,EM Service,0,                    ,SYSMAN,2021-03-03 11:01:25.0,2021-01-07 16:19:55.0\n...<\/code><\/pre>\n<p>The other day, emcli couldn&#8217;t log in to the database anymore:<\/p>\n<pre><code>emcli list -resource=\"Targets\" -format=\"name:csv\"\n<span style=\"color:red\">ORA-01017: invalid username\/password; logon denied<\/span><\/code><\/pre>\n<p>The password of the <span style=\"color:blue\">test<\/span> account hasn&#8217;t changed &#8211; I could still log in to both the database and Cloud Control.<\/p>\n<p>The question arose: what credentials was emcli sending to the database? Even the emcli log with the highest logging level didn&#8217;t reveal anything. So I configured database auditing:<\/p>\n<pre><code>audit session<\/code><\/pre>\n<p>The following audit entry provided useful information:<\/p>\n<pre><code>SESSIONID:[7] \"2287527\" ENTRYID:[1] \"1\" STATEMENT:[1] \"1\" USERID:[9] \"<span style=\"color:red\">MGMT_VIEW<\/span>\" USERHOST:[14] \"<span style=\"color:brown\">oms<\/span>\" TERMINAL:[7] \"unknown\" ACTION:[3] \"100\" RETURNCODE:[4] \"1017\" COMMENT$TEXT:[135] \"Authenticated by: DATABASE;AUTHENTICATED IDENTITY: <span style=\"color:red\">MGMT_VIEW<\/span>; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=x.x.x.x)(PORT=35590))\" OS$USERID:[6] \"oracle\" DBID:[10] \"2187817836\" CURRENT_USER:[9] \"<span style=\"color:red\">MGMT_VIEW<\/span>\"<\/code><\/pre>\n<p>First, it was the <span style=\"color:red\">MGMT_VIEW<\/span> account which couldn&#8217;t log in. Second, it wasn&#8217;t emcli who attempted to log in, it was the <span style=\"color:brown\">OMS<\/span> instead.<\/p>\n<p>In other words, emcli logs in to Cloud Control with its configured account. Then, <span style=\"color:brown\">OMS<\/span> logs in with <span style=\"color:red\">MGMT_VIEW<\/span> to execute the query on emcli&#8217;s behalf.<\/p>\n<p>In this case, a glimpse on dba_users.password_change_date revealed that someone changed the password. This should never be done except with the following emctl command, which also corrected the problem.<\/p>\n<pre><code>emctl config <span style=\"color:brown\">oms<\/span> -change_view_user_pwd -auto_generate<\/code><\/pre>\n<p>In summary, emcli uses the configured account just to initially connect to Cloud Control. Then, Cloud Control creates another session with a different account to execute emcli&#8217;s request. If the password of this intermediary account doesn&#8217;t match the password stored in the repository, <span style=\"color:red\">ORA-01017<\/span> will be passed to emcli, but unfortunately, without any further information. Luckily, you can use database auditing to find out the affected user.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A hidden dependency in emcli <a href=\"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/\" class=\"more-link\">Continue Reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[43,5],"tags":[],"class_list":["post-3720","post","type-post","status-publish","format-standard","hentry","category-cloud-control","category-oracle"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Troubleshooting an emcli Login Problem - All-round Database Topics<\/title>\n<meta name=\"description\" content=\"A hidden dependency in emcli\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Troubleshooting an emcli Login Problem - All-round Database Topics\" \/>\n<meta property=\"og:description\" content=\"A hidden dependency in emcli\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/\" \/>\n<meta property=\"og:site_name\" content=\"All-round Database Topics\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-03T18:06:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-09T11:08:41+00:00\" \/>\n<meta name=\"author\" content=\"Nenad Noveljic\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@NenadNoveljic\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nenad Noveljic\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-emcli-login-problem\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-emcli-login-problem\\\/\"},\"author\":{\"name\":\"Nenad Noveljic\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#\\\/schema\\\/person\\\/51458d9dd86dbbdd19f5add451d44efa\"},\"headline\":\"Troubleshooting an emcli Login Problem\",\"datePublished\":\"2021-03-03T18:06:23+00:00\",\"dateModified\":\"2021-06-09T11:08:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-emcli-login-problem\\\/\"},\"wordCount\":286,\"commentCount\":0,\"articleSection\":[\"Cloud Control\",\"Oracle\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-emcli-login-problem\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-emcli-login-problem\\\/\",\"url\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-emcli-login-problem\\\/\",\"name\":\"Troubleshooting an emcli Login Problem - All-round Database Topics\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#website\"},\"datePublished\":\"2021-03-03T18:06:23+00:00\",\"dateModified\":\"2021-06-09T11:08:41+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#\\\/schema\\\/person\\\/51458d9dd86dbbdd19f5add451d44efa\"},\"description\":\"A hidden dependency in emcli\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-emcli-login-problem\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-emcli-login-problem\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/troubleshooting-emcli-login-problem\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Troubleshooting an emcli Login Problem\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/\",\"name\":\"All-round Database Topics\",\"description\":\"Nenad Noveljic\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/#\\\/schema\\\/person\\\/51458d9dd86dbbdd19f5add451d44efa\",\"name\":\"Nenad Noveljic\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g\",\"caption\":\"Nenad Noveljic\"},\"sameAs\":[\"nenad-noveljic-9b746a6\",\"https:\\\/\\\/x.com\\\/NenadNoveljic\"],\"url\":\"https:\\\/\\\/nenadnoveljic.com\\\/blog\\\/author\\\/nenad\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Troubleshooting an emcli Login Problem - All-round Database Topics","description":"A hidden dependency in emcli","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/","og_locale":"en_US","og_type":"article","og_title":"Troubleshooting an emcli Login Problem - All-round Database Topics","og_description":"A hidden dependency in emcli","og_url":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/","og_site_name":"All-round Database Topics","article_published_time":"2021-03-03T18:06:23+00:00","article_modified_time":"2021-06-09T11:08:41+00:00","author":"Nenad Noveljic","twitter_card":"summary_large_image","twitter_creator":"@NenadNoveljic","twitter_misc":{"Written by":"Nenad Noveljic","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/#article","isPartOf":{"@id":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/"},"author":{"name":"Nenad Noveljic","@id":"https:\/\/nenadnoveljic.com\/blog\/#\/schema\/person\/51458d9dd86dbbdd19f5add451d44efa"},"headline":"Troubleshooting an emcli Login Problem","datePublished":"2021-03-03T18:06:23+00:00","dateModified":"2021-06-09T11:08:41+00:00","mainEntityOfPage":{"@id":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/"},"wordCount":286,"commentCount":0,"articleSection":["Cloud Control","Oracle"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/","url":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/","name":"Troubleshooting an emcli Login Problem - All-round Database Topics","isPartOf":{"@id":"https:\/\/nenadnoveljic.com\/blog\/#website"},"datePublished":"2021-03-03T18:06:23+00:00","dateModified":"2021-06-09T11:08:41+00:00","author":{"@id":"https:\/\/nenadnoveljic.com\/blog\/#\/schema\/person\/51458d9dd86dbbdd19f5add451d44efa"},"description":"A hidden dependency in emcli","breadcrumb":{"@id":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/nenadnoveljic.com\/blog\/troubleshooting-emcli-login-problem\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nenadnoveljic.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Troubleshooting an emcli Login Problem"}]},{"@type":"WebSite","@id":"https:\/\/nenadnoveljic.com\/blog\/#website","url":"https:\/\/nenadnoveljic.com\/blog\/","name":"All-round Database Topics","description":"Nenad Noveljic","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nenadnoveljic.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/nenadnoveljic.com\/blog\/#\/schema\/person\/51458d9dd86dbbdd19f5add451d44efa","name":"Nenad Noveljic","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a97b796613ea48ec8a7b79c8ffe1c685dcffc920c68121f6238d5caab5070670?s=96&d=mm&r=g","caption":"Nenad Noveljic"},"sameAs":["nenad-noveljic-9b746a6","https:\/\/x.com\/NenadNoveljic"],"url":"https:\/\/nenadnoveljic.com\/blog\/author\/nenad\/"}]}},"_links":{"self":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts\/3720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/comments?post=3720"}],"version-history":[{"count":1,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts\/3720\/revisions"}],"predecessor-version":[{"id":3727,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/posts\/3720\/revisions\/3727"}],"wp:attachment":[{"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/media?parent=3720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/categories?post=3720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nenadnoveljic.com\/blog\/wp-json\/wp\/v2\/tags?post=3720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}