0% found this document useful (0 votes)
122 views6 pages

Step by Step Guide On Creating Physical Standby Using RMAN Backup Based Duplicate in ASM For ASM Primary (Doc ID 837102.1)

This document provides steps to create an ASM physical standby database from an ASM primary database. It outlines prerequisites, configuration changes needed, using RMAN to backup the primary and duplicate it to create the standby, and validating log shipping and apply.

Uploaded by

vimeshpateldba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
122 views6 pages

Step by Step Guide On Creating Physical Standby Using RMAN Backup Based Duplicate in ASM For ASM Primary (Doc ID 837102.1)

This document provides steps to create an ASM physical standby database from an ASM primary database. It outlines prerequisites, configuration changes needed, using RMAN to backup the primary and duplicate it to create the standby, and validating log shipping and apply.

Uploaded by

vimeshpateldba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Document 837102.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=1cjxojvrfs_285&id...

Copyright (c) 2023, Oracle. All rights reserved. Oracle Confidential.

Step By Step Guide On Creating Physical Standby Using RMAN Backup based Duplicate In ASM For ASM Primary (Doc ID
837102.1)

In this Document

Goal
Solution

APPLIES TO:

Oracle Cloud Infrastructure - Database Service - Version N/A and later


Oracle Database Cloud Exadata Service - Version N/A and later
Oracle Database Cloud Schema Service - Version N/A and later
Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Information in this document applies to any platform.

GOAL

This document offers step by step procedure to create ASM physical standby from ASM primary.

SOLUTION

NOTE: In the images and/or the document content below, the user information and environment data used represents fictitious data from the
Oracle sample schema(s), Public Documentation delivered with an Oracle database product or other training material. Any similarity to actual
environments, actual persons, living or dead, is purely coincidental and not intended in any manner.

1 of 6 02/02/23, 3:54 pm
Document 837102.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=1cjxojvrfs_285&id...

For the purposes of this document, the following fictitious environment is used as an example to describe the procedure:

Primary Database:
DB_NAME: PRIM (net service name 'PRIM')

Standby Database:
DB_UNIQUE_NAME: STBY (net service name 'STBY')

Pre-Requisite

a) Database (PRIMARY) is up and running and the datafiles, controlfiles residing in ASM.
b) ASM instance and diskgroups configured in STANDBY server.
c) Network connectivity between PRIMARY and STANDBY server

PROCEDURE

1.Enable force logging in PRIMARY.


2.Create SRL(standby redo logs) in PRIMARY.
3.Backup the PRIMARY database.
4.Make proper changes in the parameter file of PRIMARY.
5.Create the parameter file for STANDBY
6.Copy the files (RMAN Backup, init.ora) to STANDBY
7.Establish the connectivity between PRIMARY and STANDBY.
8.Start the STANDBY instance and use RMAN duplicate to create standby database
9. Create SRL on standby.
10.Start the MRP process,
11. Verify whether the log are shipped and applied properly @the standby

1. Enable Forced Logging on PRIMARY

SQL> ALTER DATABASE FORCE LOGGING;

2. Configure Standby Redo Log on PRIMARY

NOTE:SIZE OF STANDBY LOGFILE SHOULD BE SAME AS ONLINE LOGFILE

a. Check the log files and sizes,

SQL>SELECT GROUP#,BYTES FROM V$LOG;

2 of 6 02/02/23, 3:54 pm
Document 837102.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=1cjxojvrfs_285&id...

b. Create SRL
ALTER DATABASE ADD STANDBY LOGFILE GROUP 4 SIZE 100M;

NOTE: The SRL will be created in the ASM Disk group mentioned in init.ora parameter DB_CREATE_ONLINE_LOG_DEST_1

c. Verify the standby redo log file groups were created(do this after the creation of standby database)

SQL> SELECT GROUP#,THREAD#,SEQUENCE#,ARCHIVED,STATUS FROM V$STANDBY_LOG;

3. Use RMAN to backup PRIMARY database with archivelog & controlfile.

RMAN> backup database format '/tmp/prim/PRIM_%U';


RMAN> backup archivelog all format '/tmp/prim/PRIM_ARC_%U';
RMAN> backup current controlfile for standby format '/tmp/prim/PRIM_CONTROL.bkp';

4. Make the necessary changes to PRIMARY .

DB_NAME=PRIM
DB_UNIQUE_NAME=PRIM
LOG_ARCHIVE_CONFIG='DG_CONFIG=(PRIM,STBY)'
LOG_ARCHIVE_DEST_2= 'SERVICE=STBY LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=STBY'
LOG_ARCHIVE_DEST_STATE_2=DEFER
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30
FAL_SERVER=STBY
FAL_CLIENT=PRIM
DB_FILE_NAME_CONVERT='STBY','PRIM'
LOG_FILE_NAME_CONVERT='STBY','PRIM'
STANDBY_FILE_MANAGEMENT=AUTO

5. Create the parameter file for standby,

a. CREATE PFILE='<specify any location>' from spfile; (@primary,)


b. Make the necessary changes, for example,

DB_NAME=PRIM
DB_UNIQUE_NAME=STBY
LOG_ARCHIVE_CONFIG='DG_CONFIG=(PRIM,STBY)'
CONTROL_FILES='+DATA','+FRA'

3 of 6 02/02/23, 3:54 pm
Document 837102.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=1cjxojvrfs_285&id...

DB_FILE_NAME_CONVERT='PRIM','STBY'
LOG_FILE_NAME_CONVERT='PRIM','STBY'
LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc
LOG_ARCHIVE_DEST_2= 'SERVICE=PRIM LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=PRIM'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
STANDBY_FILE_MANAGEMENT=AUTO
FAL_SERVER=PRIM
FAL_CLIENT=STBY

Note: If the ASM Disk groups names are different between PRIMARY and STANDBY do the necessary changes in STANDBY with the parameters
DB_CREATE_FILE_DEST and DB_CREATE_ONLINE_LOG_DEST_n

6. Copy the files (RMAN Backup, init.ora) to STANDBY

a) Copy the RMAN backup files created in /tmp/dbbkp (step3) to STANDBY in identical location
Example:
scp /tmp/prim/* oracle@<host>:/tmp/stby/*

b) Copy the init.ora (step 5) to STANDBY


c) Recreate the password file in standby using orapwd utility

7. Establish the connectivity between primary and standby.

In PRIMARY (TNSNAMES.ORA)

STBY=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = <name>)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = STBY.<server>)
)
)

In STANDBY (TNSNAMES.ORA)
PRIM=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = <name>)(PORT = 1521))

4 of 6 02/02/23, 3:54 pm
Document 837102.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=1cjxojvrfs_285&id...

(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PRIM.<server>)
)
)

NOTE: Use TNSPING <servicename> to check the connectivity between PRIMARY and STANDBY

8. Start the STANDBY instance and use RMAN duplicate to create standby database

NOTE: Make sure the ASM instance also running.


$export ORACLE_SID=STBY
SQL>create spfile from pfile=’<specify the newly created parameter location>’
SQL>startup nomount

NOTE: The following RMAN duplicate connects to target, catalog and auxiliary. Not all these connections are mandatory. For example, if the backup is
contained within target controlfile, a catalog connection is not necessary. In 11g release 2 and higher, RMAN duplicate supports running duplicate without a
target connection. Auxiliary only connection is possible with disk backups. See appropriate RMAN documentation for details.

$RMAN target sys/<password>@PRIM catalog RMAN/<password>@<catalog service> auxiliary sys/<password>


RMAN> RUN {
allocate auxiliary channel C1 device type disk;
duplicate target database for standby;
}

9. Check the SRL(Standby Redo logs) on standby and create if necessary.

NOTE:SIZE OF STANDBY LOGFILE SHOULD BE SAME AS ONLINE LOGFILE

For Example,

ALTER DATABASE ADD STANDBY LOGFILE GROUP 4 SIZE 100M;

10. Start the MRP process in PRIMARY

In PRIMARY

SQL>ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE;

5 of 6 02/02/23, 3:54 pm
Document 837102.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=1cjxojvrfs_285&id...

In STANDBY

SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

11. Verify whether the log are shipped and applied properly in the standby

a. execute on PRIMARY database

SQL> ALTER SYSTEM SWITCH LOGFILE;

b. execute on STANDBY database

SQL> SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

c. Issue more log switches at PRIMARY

SQL> ALTER SYSTEM SWITCH LOGFILE;

d. Verify the new redo data was archived on the standby database.On the standby database, query the V$ARCHIVED_LOG view to verify the redo data was received
and archived on the standby database:

SQL> SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

NOTE: Verify new archived redo log files were applied. At the standby database, query the V$ARCHIVED_LOG view to verify the archived redo log files were applied.

SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

Didn't find what you are looking for?

6 of 6 02/02/23, 3:54 pm

You might also like