I still find it incredibly useful when troubleshooting problems, particulary ORA-600 errors which needs to be sent to Oracle Support.
An ADR may contain file from many homes, or components. You need to set the correct home before you start working with ADR:
show homes set homepathexampel:
adrci> show homes ADR Homes: diag/tnslsnr/zus15d-0110/listener_pzhhtet2 diag/tnslsnr/zus15d-0110/listener_pzhhtet1 diag/rdbms/pzhhtet1/PZHHTET1 diag/rdbms/pzhhtet2/PZHHTET2 adrci> set homepath diag/rdbms/pzhhtet1/PZHHTET1 adrci> show home ADR Homes: diag/rdbms/pzhhtet1/PZHHTET1
help show tracefile show tracefileorder by timestamp:
show tracefile -torder by reversed timestamp:
show tracefile -rtfilter on tracefile name:
show tracefile %m00% -rtalert log operations
show alert show alert -tail -f show alert -tail 50 show alert -p "module_id='DBMS_SCHEDULER'" show alert -p "module_id != 'DBMS_SCHEDULER'" show alert -p "module_id LIKE '%SCHEDULER%'"If you want to extract the Streams related statements from the alert log, you would use:
show alert -p "message_text like '%STREAM%'"Show all messages related to a group. For example, a startup:
show alert -p "MESSAGE_GROUP LIKE 'startup'"
spoolcreate a package from an incident:spool off show incident show incident -mode basic show incident -mode detail show incident -mode detail -p "incident_id=incident_ID;" show incident -last 5
adrci> ips create package incident 1697 Created package 1 based on incident id 1697, correlation level typicalview its contents:
adrci> ips show files package 1 FILE_ID 1 FILE_LOCATIONgenerate zip-files on disk:/incident/incdir_1697 FILE_NAME +ASM1_lmhb_15352_i1697.trc LAST_SEQUENCE 0 EXCLUDE Included FILE_ID 2 FILE_LOCATION /incident/incdir_1697 FILE_NAME +ASM1_lmhb_15352_i1697.trm LAST_SEQUENCE 0 EXCLUDE Included FILE_ID 3 FILE_LOCATION /trace FILE_NAME +ASM1_lmhb_15352.trc LAST_SEQUENCE 0 EXCLUDE Included FILE_ID 4 FILE_LOCATION /trace FILE_NAME +ASM1_lmhb_15352.trm LAST_SEQUENCE 0 EXCLUDE Included
adrci> ips generate package 1 in /cs/oracle/grid/packages Generated package 1 in file /cs/oracle/grid/packages/ORA29770_20100427133326_COM_1.zip, mode completeTo remove old incidents, use
purge -age 2 -type incidentwhere -age 2 means older than two days.
Automatic purging:
adrci> purge -age 2880 -type trace--> will automatically remove all trace files older than 2880 minutes (2 days) type "help purge" on the adrci prompt for more options.
Other examples:
purge -age 129600 -type alert purge -age 129600 -type incident purge -age 129600 -type cdump purge -age 129600 -type stage purge -age 129600 -type sweep purge -age 129600 -type hm129600 = 90 days 43200 = 30 days or
purge -age 2880 -type trace purge -age 2880 -type alert purge -age 2880 -type cdump purge -age 2880 -type stage purge -age 2880 -type sweep purge -age 2880 -type hmyou can create a batch file and run all ov the above in one bulk:
adrci script=adrci_settings.cmdYou can spool from within an adrci script:
spool myfile.logThere are two policies in place; the LONGP_POLICY and the SHORTP_POLICY. Events such as incidents will fall into the LONGP policy and trace files and dumps will fall into the SHORTP policy. You can configure the policies using the commands below, which set the short and long retention periods to 3 months and 6 months, respectively. Note that set control accepts the time in hours
show control set control (SHORTP_POLICY = 2160) set control (LONGP_POLICY = 4320)Run in batch mode using the "exec" instruction"
adrci exec="command1; command2 ... command n"
No comments:
Post a Comment