Sie sind auf Seite 1von 10

1|Page

11g Standby Database creation without a backup By Girish B. Wankhede


Purpose
This note explains the procedure of creating a Physical Standby database using 11g
RMAN DUPLICATE FROM ACTIVE DATABASE feature which is now available in 11g
Release 1 onwards. This enables us to create a physical standby database without
having to take a backup of the primary database as a prerequisite step.

Environment
On Primary and Standby DB_NAME=11G
Primary Database DB_UNIQUE_NAME= 11G
Standby Database DB_UNIQUE_NAME=11GDR
Primary SID : init11G
Standby SID : init11GDR
Primary hostname : MY.PRIMARY.COM
Standby hostname: MY.STANDBY.COM
Oracle Software : Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 32bit
O.S Version
: Windows 2003 Server-32bit
NOTE :This document shows the standby creation for same directory Structure.
However for different directory structure one must use following parameters
In the standby parameter file :
db_file_name_convert =Primary\datafile\path\, Standby\datafile\path\
log_file_name_convert= Primary\logfile\path\, Standby\logfile\path\

2|Page
A)Enable Force Logging on the Primary database:

## Following are the contents of the parameter file of PRIMARY ( init11g.ora) database ##
11g.__db_cache_size=318767104
11g.__java_pool_size=12582912
11g.__large_pool_size=4194304
11g.__oracle_base='D:\Oracle11g'#ORACLE_BASE set from environment
11g.__pga_aggregate_target=318767104
11g.__sga_target=536870912
11g.__shared_io_pool_size=0
11g.__shared_pool_size=192937984
11g.__streams_pool_size=0
*.audit_file_dest='D:\Oracle11g\admin\11G\adump'
*.audit_trail='db'
*.compatible='11.1.0.0.0'
*.control_files='E:\11G\control01.ctl','E:\11G\control02.ctl','E:\11G\c
ontrol03.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='11G'
*.db_recovery_file_dest='D:\Oracle11g\flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.diagnostic_dest='D:\Oracle11g'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=11GXDB)'
*.standby_file_management=AUTO
*.fal_client='11G'
*.fal_server='11GDR'
*.log_archive_dest_1='LOCATION=E:\11G\ARCHIVES\'
*.log_archive_dest_2='SERVICE=11G'
*.log_archive_format='ARC%S_%R.%T'
*.memory_target=853540864
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'

3|Page
B) On the Standby host
1. Install the Oracle 11.1.0.6.0 Enterprise Edition
2.Create an instance init11GDR using ORADIM as shown below :

3.Create the password file for the Standby database


For which we will copy the Primary password file PWD11G.ORA from Primary host and paste it
on Standby hosts E:\Oracle11g\11g\database\ Path and renamed it to PWD11GDR.ORA

4. Create directory structure for standby database


Ex :- E:\11G
E:\11G\ARCHIVES
E:\11G\ADUMP etc.

5. Copy the Primary parameter file(i.e.Pfile) on the Standby host and edit the
parameter file as per the Standby database directory structure
NOTE :- The major changes are highlighted in bold letters.

## Following are the contents of the parameter file of STANDBY ( init11gdr.ora) database ##
11g.__db_cache_size=318767104
11g.__java_pool_size=12582912
11g.__large_pool_size=4194304
11g.__oracle_base='E:\Oracle11g'#ORACLE_BASE set from environment
11g.__pga_aggregate_target=318767104
11g.__sga_target=536870912
11g.__shared_io_pool_size=0
11g.__shared_pool_size=192937984
11g.__streams_pool_size=0
*.audit_file_dest='E:\11G\ADUMP'
*.audit_trail='db'
*.compatible='11.1.0.0.0'
*.control_files='E:\11G\standby.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='11G'
*.db_recovery_file_dest='E:\Oracle11g\flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.diagnostic_dest='E:\Oracle11g'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=11GXDB)'
*.fal_client='11GDR'
*.fal_server='11G'
*.log_archive_dest_1='LOCATION=E:\11G\ARCHIVES\'
*.log_archive_dest_2='SERVICE=11G'
*.log_archive_dest_state_2='DEFER'
*.standby_file_management=AUTO
*.log_archive_format='ARC%S_%R.%T'

4|Page
*.memory_target=853540864
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'

C) Update network configuration files


#Add the following entries to the tnsnames.ora file on both Primary as well as
Standby hosts.
11G =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = MY.PRIMARY.COM)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = 11G)
)
)
11GDR =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = MY.STANDBY.COM)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = 11G)
)
)

# On the Standby host, add a static entry in the


restart the listener.

listener.ora

file and reload or

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = 11G)
(ORACLE_HOME = E:\Oracle11g\11g)
(SID_NAME = 11GDR)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = MY.STANDBY.COM)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)

5|Page
D) On the Standby host :1. Start the Standby database instance in NOMOUNT state

E) On the Primary host :1. From the Primary host connect to standby auxiliary instance and enter the
credentials for Primary and Standby respectively as shown below:

3. Run the following command in RMAN prompt to create the Standby Database

(Note :-Above command output 11GDR is created by copying the datafiles directly from an
open database 11G without having to restore the backup from primary database )

6|Page

7|Page

NOTE:- At last ,output of the script will leave the standby database in mount stage.
Exit from the RMAN prompt and lets logged onto the standby host.

8|Page
F) On Standby Host :1.
2.
3.

Perform a clean shutdown


Mount the standby database
put the standby database in recovery mode

G) On Primary Host:-

Perform few log switches as show below :

9|Page
Lets check the latest log sequence of primary after log switches :

H) On Standby Host :Lets monitor the different processes and there status of standby database by issuing
various standby monitoring commands as show below :

As we can see the RFS process has started ..


Also verify the dataguard status by issuing following command :

10 | P a g e

Dataguard status also looks fine as well..


And finally its time to check the archive sync between Primary and Standby:

On Primary :-

On Standby:-

Well ..Now we have a standby database in sync with Primary database.

Das könnte Ihnen auch gefallen