The ADR has changed a lot for DBAs in maintenance land and since I have been using the ADR command interface, I found some nice tricks to navigate more quickly through the homes.
Here are some examples for the new Oracle 11g ADRCI in practice.
Lets assume these settings for the following examples:
ADR base is "/u01/app/oracle" adrci> show homes ADR Homes: diag/rdbms/clone/CLONE diag/rdbms/prod/PROD diag/asm/+asm/+ASM diag/tnslsnr/pc01/listener
Set a single home quickly
Although the help only tells you can leave out the ‘diag’ part, use ‘set home’ and just point to the last string of the path (if uniquely):
adrci> set home PROD adrci> show home ADR Homes: diag/rdbms/prod/PROD
One SID only
If you only have one database and listener, you can quickly set it with ‘rdbms’, as it is part of the string:
adrci> set home rdbms adrci> show home ADR Homes: diag/rdbms/prod/PROD
Set multiple homes quickly
Same as above, but use ‘set homes’ and just point to the last strings of the paths (if uniquely):
adrci> set homes PROD, listener adrci> show homes ADR Homes: diag/rdbms/prod/PROD diag/tnslsnr/pc01/listener
Select homes based on path
Same as above, but use ‘set homepath’ and just point to the first part of the paths:
adrci> set homepath diag/rdbms adrci> show homes ADR Homes: diag/rdbms/clone/CLONE diag/rdbms/prod/PROD
Get back to your homes quickly
When you have set your home with ‘set home | homes | homepath’, there is no ‘simple’ command to get all the paths back.
adrci> show base ADR base is "/u01/app/oracle" adrci> set base "/u01/app/oracle" adrci> show homes ADR Homes: diag/rdbms/clone/CLONE diag/rdbms/prod/PROD diag/asm/+asm/+ASM diag/tnslsnr/pc01/listener
or try (lol):
adrci> exit $ adrci
Tail through the alert file
Using a Unix like tail -f in ADRCI:
adrci> set home PROD adrci> show alert -tail -f
Go through the alert.log on the Linux prompt via ADRCI
You will be forced someday to use only the ADRCI, the old alert.log will go away eventually…
$ adrci exec="set home PROD; show alert -term;" | grep ORA-
Create a fake incident
For who found the hidden help level, the ‘create incident’ example is a bit mucked up, try the following (all on one line):
adrci> create incident problem_key="ORA-00600"
error_message="[Memory corruption]"
error_facility=ORA
error_number=600

