Wednesday, October 1, 2014

DATAGUARD: Oracle Physical standby database Log shipping issue

Symptom:
  Physical standby was sync with primary a day ago, but stopped receiving logs. All logs are still available on primary site.

Error message:
   'ORA-01031: insufficient privileges'

Cause:
  sys password was changed on primary side.

Solution:
  copy password file from primary to standby site

Check sql:
select sequnece#, applied from v$archived_log;
select process, status, sequence# from v$managed_standby;
select dest_id, status, error from v$archive_dest;
alter database recover managed standby database using current logfile disconnect;
(alter database recover managed standby database disconnect from session;)
alter database recover managed standby database cancel;
show parameter fal_client
show parameter fal_server
show parameter log
alter system witch logfile;
alter system set log_archive_dest_state_3=enable;
alter database register logfile 'path/filename';
rman> catalog start with '/var/arch';

Check step:
1. check network
tnsping fal_client and fal_server and service_name of log_archive_dest_state_3
2. check instance are up
3. check password
login as sys to both primary and standby database.
4. check error for log_dest

Processes:
primary database

There are a number of Oracle background processes that play a key role, first the primary database
•LGWR - log writer process flushes from the SGA to the ORL files
•LNS - LogWriter Network Service reads redo being flushed from the redo buffers by the LGWR    and performs a network send of the redo to the standby
•ARCH - archives the ORL files to archive logs, that also used to fulfill gap resolution requests, one ARCH processes is dedicated to local redo log activity only and never communicates with a

standby database

The standby database will also have key processes
•RFS - Remote File Server process performs a network receive of redo transmitted from the primary and writes the network redo to the standby redo log (SRL) files.
•ARCH - performs the same as the primary but on the standby
•MRP - Managed Recover Process coordinates media recovery management, recall that a physical standby is in perpetual recovery mode
•LSP - Logical Standby Process coordinates SQL apply, this process only runs in a logical standby
•PR0x - recovery server process reads redo from the SRL or archive log files and apply this redo to the standby database.

reference:
http://www.dba-oracle.com/t_physical_standby_missing_log_scenario.htm
http://www.datadisk.co.uk/html_docs/oracle_dg/cheatsheet.htm
http://arup.blogspot.com/2009/12/resolving-gaps-in-data-guard-apply.html
http://jarneil.wordpress.com/2008/05/16/registering-archive-logfiles-on-a-standby/
http://www.syksky.com/oracle/oracle-11g-data-guard-log-shipping-fails-with-error-ora-16191.html