0% found this document useful (0 votes)
2 views

Creating ASM physical standby from non ASM primary (Doc ID 752360.1)

This document provides a detailed procedure for creating an ASM physical standby database from a non-ASM primary database in Oracle. It outlines steps including enabling force logging, creating standby redo logs, backing up the primary database, configuring parameters, and establishing connectivity between the primary and standby databases. The document is applicable to Oracle Database versions 10.2.0.1 to 11.2.0.4 across any platform.

Uploaded by

rodrigo.prosig
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)
2 views

Creating ASM physical standby from non ASM primary (Doc ID 752360.1)

This document provides a detailed procedure for creating an ASM physical standby database from a non-ASM primary database in Oracle. It outlines steps including enabling force logging, creating standby redo logs, backing up the primary database, configuring parameters, and establishing connectivity between the primary and standby databases. The document is applicable to Oracle Database versions 10.2.0.1 to 11.2.0.4 across any platform.

Uploaded by

rodrigo.prosig
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/ 5

Document 752360.

1 23/10/2018 10(42

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

Creating ASM physical standby from non ASM primary (Doc ID 752360.1)

In this Document

Goal
Solution

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.2.0.1 to 11.2.0.4 [Release 10.2 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 08-Aug-2014***

GOAL

This Document offers a step by step procedure to create ASM single instance physical standby from non ASM single
instance primary database.

SOLUTION

PROCEDURE:

==========

1.Enable force logging.


2.Create SRL(standby redo logs).
3.Backup the database that includes backup of datafiles, archivelogs and controlfile for
standby and copy the backups to standby server.
4.Make proper changes in the parameter file of primary .
5.Create the ASM instance at the standby server.
6.Start the ASM instance and add directory
7.Create the parameter file for standby,
8.Establish the connectivity from primary to standby.
9.Start the standby instance,.
10.Use RMAN Duplicate command to create the standby database
11.Start the MRP process,
12. Verify whether the log are shipped and applied properly @the standby

Consider two databases of names pri ,stdby

1. Enable Forced Logging on primary

SQL> ALTER DATABASE FORCE LOGGING;

2. Configure a Standby Redo Log on primary

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

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=yadakps39_387&id=752360.1 Página 1 de 5
Document 752360.1 23/10/2018 10(42

a. Check the log files and sizes,

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


b. Create SRL,

ALTER DATABASE ADD STANDBY LOGFILE GROUP 3 '/arch1/stdby/redo1a.log' size 50m;

ALTER DATABASE ADD STANDBY LOGFILE GROUP 4 '/arch1/stdby/redo2b.log' size 50m;

ALTER DATABASE ADD STANDBY LOGFILE GROUP 5 '/arch1/stdby/redo3c.log' size 50m;

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

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

3. Take the backup of entire database with archivelog including controlfile.

RMAN> run
{
allocate channel t1 type disk;
allocate channel t2 type disk;
allocate channel t3 type disk;
allocate channel t4 type disk;
backup database format '/databases/backup/%U';
backup archivelog all format '/databases/backup/%U';
backup current controlfile for standby format '/databases/backup/%U';
}

copy the backup files to standby server,

[oracle@raca prim]$ scp /databases/backup/* host2.idc.oracle.com:/databases/backup/

NOTE : If "/databases/backup/" not exist on standby, create the same.

4. Make the necessary changes in primary.

SQL>alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(pri,stdby)';

SQL> alter system set LOG_ARCHIVE_DEST_1='LOCATION=/arch1/dbfiles/pri/ VALID_FOR=


(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=pri';

SQL>alter system set LOG_ARCHIVE_DEST_2='SERVICE=stdby LGWR ASYNC VALID_FOR=


(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=stdby';

SQL> alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE;

SQL>alter system set FAL_SERVER=stdby;

SQL>alter system set FAL_CLIENT=pri;

SQL>alter system set DB_FILE_NAME_CONVERT='+DATA_1/stdby/','/arch1/data/pri/'


scope=spfile;

SQL>alter system set LOG_FILE_NAME_CONVERT='+FRA_1/stdby/','/arch1/dbfiles/pri/'


scope=spfile;

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=yadakps39_387&id=752360.1 Página 2 de 5
Document 752360.1 23/10/2018 10(42

5. Create the ASM instance at the standby server.

Use dbca:to create ASM instance.

1) proper global db name, eg., orcl.cos.us.oracle.com


2) proper SID prefix, same as primary (orcl), limited to 5 characters
3) same SYS password as the primary database
4) ASM for storage, create the diskgroups, DATA_1, FRA_1
5) Use Flash Recovery Area (+FRA_1), enable Archiving
6) click Edit Archive Mode Parameters button adjacent to Enable Archiving
checkbox and change format to match primary if necessary. The
log_archive_format should include %t or %T, eg. %d_%t_%s_%r.arc
7) Specify the same number and size of online redo logs as primary

6. Start the ASM instance and add directory(if necessary)

$ export ORACLE_SID=+ASM1
$ sqlplus "/ as sysdba"
SQL> alter diskgroup DATA_1 add directory '+DATA_1/stdby';
SQL> alter diskgroup FRA_1 add directory '+FRA_1/stdby';

7. Create the parameter file for standby,

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


b. Copy the file to standby server.
c. Make the necessary changes, for example,

db_name=pri
db_unique_name=stdby
log_archive_config='DG_CONFIG=(pri,stdby)'
log_archive_dest_1='LOCATION=+FRA_1/stdby/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=stdby'
log_archive_dest_2='SERVICE=pri LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=prim'
log_archive_dest_state_1=ENABLE
db_file_name_convert='/arch1/data/pri/','+DATA_1/stdby'
log_file_name_convert='/arch1/redo/pri/','+FRA_1/stdby/'
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
standby_archive_dest='+FRA_1/stdby/'
standby_file_management=AUTO
fal_client=stdby
fal_server=pri

d. Create the same password as that of primary. Alternatively we can copy the password file from primary and rename
it on standby.

For example from primary copry the password file,

scp /u01/app/oracle/dbs/opapwpri host1.idc.oracle.com:/u01/app/oracle/dbs/

on standby,

$mv orapwpri orapwstdby

or create passwrod same as primary as mentioned below,

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=yadakps39_387&id=752360.1 Página 3 de 5
Document 752360.1 23/10/2018 10(42

a. in UNIX,

$export ORACLE_SID
$orapwd file='$ORACLE_HOME/dbs/orapwstdby' password=sys entries=10;

in Windows,
d:>set ORACLE_SID=stdby
d:>oradim -new -sid stdby -intpwd sys

8. Establish the connectivity from primary to standby.

stdby =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.9.200.108)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = stdby.server.com)
)
)

pri =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.9.200.107)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pri.server.com)
)
)

9. Start the stdby instance on standby,

NOTE: Make sure the ASM instance also running.

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

10. Use RMAN Duplicate on standby command to create the standby database,

NOTE: Before this step check the network connectivy from primary to standby and vice versa via TNSPING and
SQL_PROMPT.

NOTE: Connect to catalog if your primary database has catalog database.

$RMAN target sys/<passwd>@primary catalog RMAN/RMAN@RMAN auxiliary sys/<passwd>

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=yadakps39_387&id=752360.1 Página 4 de 5
Document 752360.1 23/10/2018 10(42

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

11. Start the MRP process,

SQL>ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE;

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

12: Verify whether the log are shipped and applied properly @the standby

a. execute on primary database

SQL> ALTER SYSTEM SWITCH LOGFILE;

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

b. @Primary (issue more log switch)

SQL> ALTER SYSTEM SWITCH LOGFILE;

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


2> 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#;

NOTE : From 11g onwards we can use new feature called DUPLICATE from ACTIVE database.

Refer 13.5 Creating a Standby Database That Uses OMF or ASM

<<http://download.oracle.com/docs/cd/E11882_01/server.112/e17022/scenarios.htm#i1067236>>

Didn't find what you are looking for?

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=yadakps39_387&id=752360.1 Página 5 de 5

You might also like