Note_Tech

All technological notes.


Project maintained by simonangel-fong Hosted on GitHub Pages — Theme by mattgraham

DBA - Instance: Automatic Diagnostic Repository (ADR)

Back


Automatic Diagnostic Repository (ADR)

adr_path

adr_home


Lab: Query diagnostics directories

SELECT name, value FROM v$diag_info;

lab01


Alert log


Lab: View Alert Log File in XML and text

alert


alert

alert


alert


Lab: View Alert Log using ADRCI

adrci
show alert

labadrci

labadrci


labadrci

labadrci


labadrci

labadrci


labadrci


Trace files


Purgin Mechanism

purging_mechanism


Lab: Configure ADR Policy

# set home path
set HOMEPATH diag/rdbms/orcl/orcl

# query the size policy for adr
select sizep_policy from adr_control_aux;

# query the short and long policy
# return the number in hours, 30days, 365 days.
select shortp_policy, longp_policy from adr_control;

labadrci


# return an estimate for a size policy
estimate ( sizep_policy =200000000);

# return an estimate for a short and long policy, 8 days
estimate (shortp_policy =192, longp_policy=192);

labadrci


set control (SHORTP_POLICY = 192);
set control (LONGP_POLICY = 192);
set control (SIZEP_POLICY = 8559020);

select shortp_policy, longp_policy from adr_control;
select sizep_policy from adr_control_aux;

labadrci


Lab: Purg files manually in ADRCI

cd  /u01/app/oracle/diag/rdbms/orcl/orcl
# return the size of dir
du -hs

labadrci

#[-size <bytes>]: Purge diagnostic data from the ADR home until the size of the home reaches <bytes> bytes.
purge -size 5000000     # purge until 5M

labadrci


Lab: Enable DDL Logging

labadrci

show con_name
ALTER session SET container=orclpdb;
show con_name

show parameter enable_ddl_logging;
ALTER session SET enable_ddl_logging=true;
show parameter enable_ddl_logging;

labadrci

CREATE TABLE test ( n number);
CREATE TABLE test1 ( n number);
DROP TABLE test;
DROP TABLE test1;

labadrci

labadrci


show alert -p "message_text like '%terminating the instance%'"
show alert -p "message_text like '%Beginning crash recovery%'"
show alert -p "message_text like '%Started redo scan%'"
show alert -p "message_text like '%Completed crash recovery%'"
show alert -p "message_text like '%db_recovery_file_dest_size%'"

terminating the instance

TOP