{"id":227,"date":"2018-11-13T17:50:16","date_gmt":"2018-11-13T16:50:16","guid":{"rendered":"http:\/\/anjo.pt\/wp\/keyword-oracle\/?p=227"},"modified":"2018-11-13T17:50:16","modified_gmt":"2018-11-13T16:50:16","slug":"query-dgmgrl-silently-from-observer-site","status":"publish","type":"post","link":"https:\/\/anjo.pt\/keyword-oracle\/2018\/11\/13\/query-dgmgrl-silently-from-observer-site\/","title":{"rendered":"Query DGMGRL silently from observer site"},"content":{"rendered":"<p>When the observer is &#8220;checking&#8221; several dataguard configurations, we can use this server to easily make queries on all of them, for instance using:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nfor db in `ps -ef | grep observer | awk -F '\/' '{print $6}' | sort`; do\r\nconn=`sed -n 1p \/u00\/app\/oracle\/admin\/${db}\/observer\/fsfo_${db}.conf`\r\nconndb=`echo $conn | cut -d &quot;@&quot; -f2`\r\ndgmgrl -silent ${conn} &quot;show configuration&quot; | grep -E 'Primary'\r\ndone;\r\n<\/pre>\n<p>It does for every observed configuration:<\/p>\n<ol>\n<li>gets the DB name<\/li>\n<li>find the connection string in the config file<\/li>\n<li>connects to DGMGRL in silent more and runs a command<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>When the observer is &#8220;checking&#8221; several dataguard configurations, we can use this server to easily make queries on all of them, for instance using: for db in `ps -ef | grep observer | awk -F &#8216;\/&#8217; &#8216;{print $6}&#8217; | sort`; do conn=`sed -n 1p \/u00\/app\/oracle\/admin\/${db}\/observer\/fsfo_${db}.conf` conndb=`echo $conn | cut -d &quot;@&quot; -f2` dgmgrl -silent ${conn} [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,6],"tags":[],"class_list":{"0":"post-227","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-dataguard","7":"category-oracle","8":"czr-hentry"},"_links":{"self":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/comments?post=227"}],"version-history":[{"count":2,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/227\/revisions"}],"predecessor-version":[{"id":230,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/227\/revisions\/230"}],"wp:attachment":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/media?parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/categories?post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/tags?post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}