ADRCI (ADR Command Interpreter) can be used to display errors in services such as Oracle database, grid, asm, listener. In all ADRCI-defined homes, you can use the following script to display errors that occur up to a specific word and a specific time. For more information on ADRCI, see ADR Command Interpreter (ADRCI).
You can query ADRCI-defined homes as follows. Once ORACLE_HOME is set, and added to the PATH variable, the adrci can be run.
1 2 |
-bash-4.3$ export ORACLE_HOME=/u01/app/11.2.0/grid; export PATH=$PATH:$ORACLE_HOME/bin -bash-4.3$ adrci exec="show homes" |
To display the errors, create a file named show_errors.sh with the following commands.
1 2 |
export ORACLE_HOME=/u01/app/11.2.0/grid; export PATH=$PATH:$ORACLE_HOME/bin adrci exec="show alert -p \\\"message_text like '%$1%' and originating_timestamp > systimestamp-$2/24\\\"" -term |
Make the show_errors.sh file executable.
1 |
chmod 755 show_errors.sh |
While running show_errors.sh;
- The first parameter is the word to be searched.
- The second parameter specifies how many hours to search.
For example, you can view ORA errors in all databases running on the server in the last 24 hours as follows.
1 |
-bash-4.3$ ./show_errors.sh ORA- 24 |
Or, you can view the connection requests from a specified ip to the listener on the server in the last 10 hours as follows.
1 |
-bash-4.3$ ./show_errors.sh 192.168.40.15 10 |