blog menu1

ADRCI Commands

ADRCI Commands


ADRCI Guide -



ADRCI commands in practice



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



Solution 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> help



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



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
adrci> show incident -mode detail
adrci> show tracefile -i 8545
diag\rdbms\incident\incdir_8545\db11_m000_4844_i8545.trc
adrci> show control
adrci> set home PROD



LONGP_POLICY (long term) is set to 365 days by default. It is responsible for Incidents and Health Monitor warnings.
SHORTP_POLICY (short term) is set to 30 days by default. It manages the trace and core dump files and files OLDER than 30 days will get deleted....
Use the following commands to change the retention policy (optional).
* Specify the time in hours ( 240 = 10 days , 1095 = 1 .5 Months )
adrci> set control (SHORTP_POLICY = 240)
adrci> set control (LONGP_POLICY = 1095)



Purge the old files manually ( specify the retention period explicitly )
* Specify the time in minutes ( 10080/60/24=7 Days )
It is possible to purge different diagnostic files separately
adrci> purge -age 10080 -type ALERT
adrci> purge -age 10080 -type TRACE
adrci> purge -age 10080 -type incident
adrci> purge -age 10080 -type hm
adrci> purge -age 10080 -type utscdmp
adrci> purge -age 10080 -type cdump
Also you may want to purge all files at once
adrci> purge -age 10080



adrci> script=abc_script.txt
adrci> purge -age 10080




Summary

==


Command Description
CREATE REPORT - Creates a report for the specified report type and ID.
ECHO - Echoes the input string.
EXIT -Exits the current ADRCI session.
HOST- Executes operating system commands from ADRCI.
IPS -Invokes the IPS utility. See Table 15-3 for the IPS commands available within ADRCI.
QUIT - Exits the current ADRCI session.
RUN - Runs an ADRCI script.
SET BASE - Sets the ADR base for the current ADRCI session.
SET BROWSER - Reserved for future use.
SET CONTROL - Set purging policies for ADR contents.
SET ECHO - Toggles command output.
SET EDITOR - Sets the default editor for displaying trace and alert log contents.
SET HOMEPATH - Makes current one or more ADR homes.
SET TERMOUT - Toggles terminal output.
SHOW ALERT -Shows alert log messages.
SHOW BASE - Shows the current ADR base.
SHOW CONTROL - Shows ADR information, including the current purging policy.
SHOW HM_RUN - Shows Health Monitor run information.
SHOW HOMEPATH - Shows the current homepath.
SHOW HOMES - Lists the current ADR homes.
SHOW INCDIR - Lists the trace files created for the specified incidents.
SHOW INCIDENT - Outputs a list of incidents.
SHOW PROBLEM - Outputs a list of problems.
SHOW REPORT - Shows a report for the specified report type and ID.
SHOW TRACEFILE - Lists qualified trace filenames.
SPOOL - Directs output to a file.

No comments:

Post a Comment