0% found this document useful (0 votes)
75 views4 pages

Resolving Gaps 78and79

The document describes resolving a gap between the primary and standby databases. It provides SQL commands run on the primary to: 1) Take an incremental backup up to the standby's SCN. 2) Create a standby control file and copy it to the standby. 3) Mount the standby database using the new control file and recover the backup files to synchronize the databases.

Uploaded by

adshah
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views4 pages

Resolving Gaps 78and79

The document describes resolving a gap between the primary and standby databases. It provides SQL commands run on the primary to: 1) Take an incremental backup up to the standby's SCN. 2) Create a standby control file and copy it to the standby. 3) Mount the standby database using the new control file and recover the backup files to synchronize the databases.

Uploaded by

adshah
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Resolving Gaps Primary: szaddb78 Standby : szaddb79 Note: To perform this test purpose only.

disabled the log_archive_dest_state_2='defer' in primary database location using command alter system set log_archive_dest_state_2='DEFER'; In primary database Archive log list SQL> archive log list Database log mode Automatic archival Archive destination Archive Mode Enabled +FRA_DG1 428

Oldest online log sequence

Next log sequence to archive 431 Current log sequence 431

SQL> select current_scn from v$database;

CURRENT_SCN ----------54730459 SQL> SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#))ARCH, (SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;

Thread Last Sequence Received Last Sequence Applied Difference

---------- ---------------------- --------------------- ---------1 1 In secondary: SQL> archive log list Database log mode Automatic archival Archive destination Archive Mode Enabled +FRA_DG1 428 430 430 430 430 0 0

Oldest online log sequence

Next log sequence to archive 0 Current log sequence 431

SQL> select current_scn from v$database;

CURRENT_SCN ----------31551323 SQL> SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#))ARCH, (SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;

Thread Last Sequence Received Last Sequence Applied Difference ---------- ---------------------- --------------------- ---------1 430 279 151

Solution: Perform incremental backup on Primary up to the scn of the standby: RMAN> run { allocate channel c1 type disk format '/orabkup2/rman/%U.rmb'; backup incremental from scn 31551323 database; } SCP the backup files to Standby server On Primary: SQL> show parameter control

NAME

TYPE

VALUE

------------------------------------ ----------- -----------------------------control_file_record_keep_time control_files string integer 7

+DATA_DG1/arrcda/controlfile/c

urrent.261.821740807, +DATA_DG 1/arrcda/controlfile/current.2 60.821740807 control_management_pack_access string DIAGNOSTIC+TUNING

SQL> alter database create standby controlfile as '/tmp/arrcra_standby.ctl'; SCP the control file to Standby On Standby: SQL> startup nomount; SQL> show parameter control_files NAME TYPE VALUE

------------------------------------ ----------- -----------------------------control_file_record_keep_time control_files string integer 7

+DATA_DG1/arrcra/controlfile/c

ontrol01.ctl, +DATA_DG1/arrcra /controlfile/control02.ctl control_management_pack_access string DIAGNOSTIC+TUNING

Rename the above control files to backup Copy the newly created control file /tmp/arrcra_standby.ctl Then mount the database SQL> alter database mount standby database; Connect to RMAN and catalog the backupfiles RMAN> catalog start with '/orabkup2/rman/ RMAN> recover database; SQL> alter database recover managed standby database disconnect from session; SQL> select current_scn from v$database; CURRENT_SCN ---------------

Primary Database (wait for some time scn number change frequently) SQL> select current_scn from v$database; CURRENT_SCN ---------------

Enable the parameter in primary database location using command sql>alter system set log_archive_dest_state_2='ENABLE';

You might also like