Monday, November 06, 2017

How To Debug DataGuard broker dgmgrl ORA-16664

After you setup dg broker in your enviroment, all TNS are correct, ports are open, sqlplus sys as sysdba is fine. password file are identical. You still see below error on DRC logs

ORA-16664: unable to receive the result from a database

Reason:

   It is possible dg broker ignore the changes you made on tnsnames.ora. It stores its own connect string when you set up dg broker at the beginning

Solution:

   Turn on trace to support .
   dgmgrl>EDIT CONFIGURATION set property tracelevel=support;
   dgmgrl>EDIT INSTANCE "COMMPRDA1" ON DATABASE COMMPRDA set property LogArchiveTrace=8191;

   Find out exact connect string it is using via drc logs. Test the string on sqlplus

   In my case, the special listener we created before for dataguard which confuses dg broker to create its own connect string. Fix it via update your listener.ora

  Or staticconnectidentifier
  dgmgrl>edit instance 'CONTNTA1' on database contntadc set property staticconnectidentifier='TNS string';

 Turn off trace.
dgmgrl>EDIT CONFIGURATION set property tracelevel=user;
dgmgrl>EDIT INSTANCE "COMMPRDA1" ON DATABASE COMMPRDA set property LogArchiveTrace=0;

Wednesday, May 07, 2014

Adrci Show Alert Hung

Sometimes alert log of DB is too large.  We may mv , rm  or vi them to make it smaller
However it may affect format the alert logs, adrci  show alert may hung due to bad format
We can use purge commend of adrci to fix it.  It's side effect of the purge command.

ADR Homes:
diag/rdbms/cmru/test1
adrci> set home diag/rdbms/test/test1
adrci> PURGE -age 1440 -type ALERT

Sunday, February 02, 2014

ORA-01031 insufficient privileges

2 possible reasons
  • check password file, if possible, recreate them on all nodes to make them consistent
  • double check password file name ,must be orapw<SID> , not orapwd<SID>
  • When we setup dataguard service, the standby DB may need to copy password file from primary, and rename as  orapw<sid>
  • Use below sql to check password file user
  select * from v$pwfile_users;
  select value from v$option where parameter='Oracle Database Vault';

Monday, January 13, 2014

How To Transfer SCN to Redo Log Sequence

Sometimes we need to know date and redo log sequence from SCN
When we debug, we know SCN, then we need to know what archive logs and log sequence number

ie we have SCN 0x0b09.1c7947c0 . its hex
We converts it  to decimal it is 12133760321472

use below sql to do it

SELECT thread#, name, sequence#, first_time, next_time
   FROM gv$archived_log
  WHERE 12133760321472
BETWEEN first_change# AND next_change#;