Get all Oracle instance names under UNIX

zhaozj2021-02-16  65

Because there is a definition of all databases in the / var / opt / oracle / ORATAB file,

Cat / var / opt / oracle / oracab

Tesge9i: /u01/app/oracle/product/8.1.7_64: Y

Jiabao9i: /u01/app/oracle/product/8.1.7_64: y

...

It can be seen that the act illustrated is used for the Oracle_sid name before ':'.

CAT / VAR / OPT / ORACLE / ORATAB | GREP -V / # | GREP -V / * | CUT -D ":" -f1

Where grep -v / #, the grep -v / * command ignores every line of comments in the ORATAB file.

Cut -d ":" -f1 command, use the colon as the first column of the ORATAB file as the column

转载请注明原文地址:https://www.9cbs.com/read-15892.html

New Post(0)