Professional Documents
Culture Documents
Page 1 of 17
NOTE: This OBE represents a Data Guard configuration where orcl is the primary database and orclsby1 is the physical standby database SID.
For simplicity, in this OBE, both the primary and standby databases are running on a single server.
Time to Complete
Approximately 1 hour
Topics
This tutorial covers the following topics:
Overview
Prerequisites
Preparing the Primary Database for Standby Database Creation
Creating the Physical Standby Database
Verify that the Physical Standby Database is Performing
Correctly
Summary
Viewing Screenshots
Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all screenshots
simultaneously, so response time may be slow depending on your Internet connection.)
Note: Alternatively, you can place the cursor over an individual icon in the following steps to load and view only the screenshot associated with that
step. You can hide an individual screenshot by clicking it.
Overview
Oracle Database 11g RMAN introduces the FROM ACTIVE DATABASE capability to the DUPLICATE FOR STANDBY command. This alleviates
the previous need for interim storage on both the Primary and Standby systems, and the limitation of single stream network traffic.
Now when taking the backup of the Primary database you can simultaneously create and restore the standby database over the network in parallel
streams. Apart from some simple Oracle Net setup, and creating a couple of directories and an interim password file, the whole standby creation can
be done in one RMAN script.
RMAN will automatically copy the server parameter file to the standby host, start the auxiliary instance with the server parameter file, restore a
backup control file, and copy all necessary database files and archived redo logs over the network to the standby host.
Prerequisites
Before you perform this tutorial, you should:
1. Perform an Oracle Database 11g installation (software and db installed) for a single server
environment OR Oracle Database 11g installation (software and db installed) on 1 server and
Oracle Database 11g software only on 2nd server for a dual server environment.
2. Download and unzip the physstby.zip file into your working directory (i.e.wkdir)
Back to Topic List
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 2 of 17
one or more standby databases. You should perform the following steps:
1. Determine if FORCE LOGGING is enabled. If it is not enabled, enable FORCE LOGGING
mode. This statement may take some time to complete, because it waits for all unlogged direct
write I/O to finish. You use the following commands:
Select FORCE_LOGGING from V$DATABASE;
ALTER DATABASE FORCE LOGGING;
3. Configure the primary database to receive redo data, by adding the standby logfiles to the primary.
You can use the cr_sby_redologs.sql script, after validating the directory paths reflect your
environment.
It is highly recommended that you have one more standby redo log group than you have online redo
log groups as the primary database. The files must be the same size or larger than the primary
databases online redo logs.
SQL> alter database add standby logfile
2 '/u01/app/oracle/oradata/orcl/srl01.log' size 52428800
3 /
Database altered.
SQL> alter database add standby logfile
2 '/u01/app/oracle/oradata/orcl/srl02.log' size 52428800
3 /
Database altered.
SQL> alter database add standby logfile
2 '/u01/app/oracle/oradata/orcl/srl03.log' size 52428800
3 /
Database altered.
SQL> alter database add standby logfile
2 '/u01/app/oracle/oradata/orcl/srl04.log' size 52428800
3 /
Database altered.
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 3 of 17
Ensure the following parameters are set to reflect the Data Guard configuration.
DB_NAME
DB_UNIQUE_NAME
CONTROL_FILES
LOG_ARCHIVE_CONFIG
LOG_ARCHIVE_DEST_1
LOG_ARCHIVE_DEST_2
REMOTE_LOGIN_PASSWORDFILE
Specifies the local path name for the control files on the
primary database.
Uses the DG_CONFIG attribute to list the
DB_UNIQUE_NAME of the primary and standby
databases.
Defaults to archive destination for the local archived
redo log files.
Valid only for the primary role, this destination
transmits redo data to the remote physical standby
destination orclsby1.
Must be EXCLUSIVE or SHARED if a remote login
password file is used (default = EXCLUSIVE)
5. Issue the following statements to determine your database's archival state, and then put the primary
database in ARCHIVELOG mode to enable automatic archiving.
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 4 of 17
2. Expand Local. Select Service Naming and click the green plus sign
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 5 of 17
3. Enter your <physical standby SID> (i.e. orclsby1) in the Net Service Name field and
click Next
5. Enter your fully qualified <hostname> (i.e. edtdr9p1.us.oracle.com) and click Next.
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 6 of 17
7. Click Finish.
8. Click File -> Save Network Configuration to save the information to the tnsnames.ora
file.
Back to Topic
B. Use Oracle Net Manager to configure an entry for your standby database in the listener.ora file.
1. Expand Listeners
2. Select LISTENER.
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 7 of 17
Back to Topic
C. Creating the standby database over the network
1. Reload the listener.
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 8 of 17
Copy the remote login password file (orapworcl) from the primary database system to the
standby database system, renaming it to orapworclsby1.
The password file must be re-copied each time the SYSDBA or SYSOPER privilege is
granted or revoked and whenever the login password of a user with these privileges is
changed. You may need FTP, or some other remote file transfer mechanism, if you are using
differenet servers.
NOTE: This step is required if you are using Oracle Database 11g encryption, or OS
authentication for administrative users.
3. In the ORACLE_HOME/dbs folder, for the standby system, create an initialization parameter
file named initorclsby1.ora containing a single parameter:
DB_NAME=<physical standby SID> (i.e. orclsby1)
4. For the standby system, change to the /u01/app/oracle/admin directory. Create your <physical standby SID> (i.e.
orclsby1) directory. Change to your <physical standby SID> (i.e. orclsby1) directory and create the adump directory.
5. For the standby system, create your <physical standby SID> (i.e. orclsby1) directory in $ORACLE_BASE/oradata
for the data files.
NOTE: Depending on how you installed Oracle Database 11g, you may need to also add the following directory paths:
$ORACLE_BASE/flash_recovery_area and $ORACLE_BASE/oradata
6. On the standby system, set the ORACLE_SID environment variable to your <physical standby SID> (i.e.
orclsby1) and start the instance in NOMOUNT mode with the text initialization parameter file.
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 9 of 17
7. On the primary system, ensure the ORACLE_SID environment variable is set to your primary DB <SID> (i.e. orcl).
8. On the primary system, invoke RMAN and connect as SYSDBA to the target database. Connect to the auxiliary database.
9. Execute the cr_phys_sby1.txt script from RMAN on the primary system. When this script finishes you will have a new
standby database that was created over the network without any interim storage.
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 10 of 17
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 11 of 17
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 12 of 17
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 13 of 17
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 14 of 17
10. Perform a log switch on the primary database and redo will start being sent to the standby.
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 15 of 17
11. On the standby system, ensure the ORACLE_SID environment variable is set to your <physical standby SID> (i.e.
orclsby1) and start the MRP process.
Back to Topic
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 16 of 17
2. On the primary database, issue the ALTER SYSTEM SWITCH LOGFILE statement to force a log switch and archive the current
online redo log file group.
3. On the standby database, re-query the V$ARCHIVED_LOG view to verify the redo data was
received and archived on the standby database:
4. On the standby database, query the V$ARCHIVED_LOG view to verify the archived redo log files were actually applied. Please requery until you
see a YES in the APPLIED column.
At the completion of this step, the physical standby database is running and provides the maximum performance level of data protection.
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009
Page 17 of 17
Summary
In this tutorial, you learned how to:
Prepare the Primary Database for Standby Database
Creation
Create the Physical Standby Database over the network
Verify that the Physical Standby Database is Performing Correctly
Back to Topic List
http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm?_t... 9/16/2009