{"id":8968,"date":"2023-01-29T15:30:28","date_gmt":"2023-01-29T18:30:28","guid":{"rendered":"https:\/\/swiv.com.br\/?p=8968"},"modified":"2023-01-29T15:30:28","modified_gmt":"2023-01-29T18:30:28","slug":"how-to-list-files-opened-by-oracle-linux-processes","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2023\/01\/29\/how-to-list-files-opened-by-oracle-linux-processes\/","title":{"rendered":"How to list files opened by Oracle Linux Processes"},"content":{"rendered":"\n<p>Imaginando que nos conectamos em um ambientes onde ningu\u00e9m tenha nenhum hist\u00f3rico, e que n\u00e3o tenha informa\u00e7\u00f5es m\u00ednimas para definir as vari\u00e1veis de ambiente ORACLE_BASE, ORACLE_HOME e ORACLE_SID. Uma alternativa seria inicialmente identificarmos o PID de um dos processos de background da inst\u00e2ncia oracle:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel7 ~]$ ps -ef | grep smon\ngrid      4003     1  0 20:07 ?        00:00:00 asm_smon_+ASM\noracle    4136     1  0 20:08 ?        00:00:00 ora_smon_cortex\noracle   10547  5226  0 21:59 pts\/0    00:00:00 grep --color=auto smon\n&#x5B;oracle@oel7 ~]$\n<\/pre><\/div>\n\n\n<p>O PID de nosso exemplo \u00e9 o 4093. Agora podemos utilizar o comando abaixo para identificar o ORACLE_HOME:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel7 ~]$ lsof -p 4136 | grep &#039;bin\\\/oracle&#039; | awk &#039;{ print $9 }&#039;\n&#x5B;oracle@oel7 ~]$\n<\/pre><\/div>\n\n\n<p>Caso n\u00e3o exista retorno no comando, como no meu exemplo acima, basta execut\u00e1-lo conectado com root:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@oel7 ~]# lsof -p 4136 | grep &#039;bin\\\/oracle&#039; | awk &#039;{ print $9 }&#039;\n\/oracle\/19.3.0\/product\/bin\/oracle\n&#x5B;root@oel7 ~]#\n<\/pre><\/div>\n\n\n<p>Com esta informa\u00e7\u00e3o preliminar, j\u00e1 poderemos definir as vari\u00e1veis necess\u00e1rias.<\/p>\n\n\n\n<p>Isso \u00e9 poss\u00edvel atrav\u00e9s do comando lsof. No exemplo abaixo, temos informa\u00e7\u00f5es b\u00e1sicas sobre processos que est\u00e3o utilizando um arquivo em espec\u00edfico:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@oel7 ~]# lsof \/oracle\/19.3.0\/product\/bin\/oracle\nCOMMAND     PID   USER   FD   TYPE DEVICE  SIZE\/OFF   NODE NAME\nora_pmon_  4093 oracle  txt    REG   8,97 441253104 542154 \/oracle\/19.3.0\/product\/bin\/oracle\nora_clmn_  4095 oracle  txt    REG   8,97 441253104 542154 \/oracle\/19.3.0\/product\/bin\/oracle\nora_psp0_  4097 oracle  txt    REG   8,97 441253104 542154 \/oracle\/19.3.0\/product\/bin\/oracle\n\n...\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Imaginando que nos conectamos em um ambientes onde ningu\u00e9m tenha nenhum hist\u00f3rico, e que n\u00e3o tenha informa\u00e7\u00f5es m\u00ednimas para definir as vari\u00e1veis de ambiente ORACLE_BASE, ORACLE_HOME e ORACLE_SID. Uma alternativa seria inicialmente identificarmos o PID de um dos processos de background da inst\u00e2ncia oracle: O PID de nosso exemplo \u00e9 o 4093. Agora podemos utilizar [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,6],"tags":[],"class_list":["post-8968","post","type-post","status-publish","format-standard","hentry","category-administration","category-linux"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/8968","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=8968"}],"version-history":[{"count":0,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/8968\/revisions"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=8968"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=8968"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=8968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}