Professional Documents
Culture Documents
Following are the assumptions for this dataguard configuration:
Primary:
hostname: machine_prim
DB_NAME: ORCL10G
DB_UNIQUE_NAME: ORCL10G
SERVICE_NAMES: ORCL10G
Standby:
hostname: machine_stand
DB_NAME: ORCL10G
DB_UNIQUE_NAME: STDBY10G
SERVICE_NAMES: STDBY10G
Oracle software release must be same for both primary and standby databases. The
operating system running on primary and standby locations must be same but operating
system release can be different.
If primary and standby databases are on the same system, initialization parameters must
be adjusted correctly. Parameter lock_name_space should be used until 9i and
db_unique_name should be used from 10g onwards.
Database altered.
NAME
------------------------------------------------------------------------
--------
E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL10G1\SYSTEM.DBF
E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL10G1\UNDO.DBF
E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL10G1\SYSAUX.DBF
E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL10G1\DATA.DBF
E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL10G1\RMAN.DBF
E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL10G1\TT.DBF
6 rows selected.
Shutdown database cleanly and take cold backup of primary database by issuing:
SQL> startup;
8 - Issue the following command on primary database to create control file for the
standby database.
Database altered.
Make sure that name given to standby controlfile is different than the controlfile name of
primary database controlfile to avoid overwriting primary controlfile by mistake.
9 - If using spfile, then create pfile from spfile for standby database on primary database.
This pfile can be copied to standby location and modified.
File created.
10 – Copy controlfile created in step (8) above and pfile created in step (9) above to the
standby machine. Place pfile in $ORACLE_HOME/database directory for Windows and
$ORACLE_HOME/dbs directory for Unix machines.
Few of the parameters of primary database need to be modified like db_unique_name and
few others to reflect correct path of standby database. Few of the parameters are :
DB_NAME:
This parameter should be different than the value specified in primary database
db_unique_name parameter. If db_unique_name is not specified at primary database, the
parameter should be different than db_name value in primary database.
This parameter should have distinct value than the value specified in primary database.
COMPATIBLE:
CONTROL_FILES:
Specify the path name and filename for the standby control file.
STANDBY_ARCHIVE_DEST:
Specify the location of the archived redo logs that will be received from the primary
database.
DB_FILE_NAME_CONVERT:
Syntax:
Specify the location of the primary database datafiles followed by the standby location of
the datafiles. It will convert datafile name of primary database to datafile name of the
standby datafile. If the primary and standby database are on the same system or if the
directory structure of primary and standby database is different then this parameter is
required.
LOG_FILE_NAME_CONVERT:
Syntax:
Specify the location of the primary database logs followed by the standby location of the
logs. It will convert the filename of the primary database log to the filenames of the
standby log. If the primary and standby database are on the same system or if the
directory structure of primary and standby database is different then this parameter is
required.
STANDBY_FILE_MANAGEMENT:
It enables or disables automatic standby file management. When automatic standby file
management is enabled, operating system file additions and deletions on the primary
database are replicated on the standby database if parameter is set to AUTO.
FAL_SERVER:
It specifies the FAL (fetch archive log) server for a standby database. The value is an
Oracle Net service name, which is assumed to be configured properly on the standby
database system to point to the desired FAL server. Will be primary database Net service
name
FAL_CLIENT:
It specifies the FAL (fetch archive log) client name that is used by the FAL service,
configured through the FAL_SERVER parameter, to refer to the FAL client. The value is
an Oracle Net service name, which is assumed to be configured properly on the FAL
server system to point to the FAL client (standby database).
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = machine_prim)(PORT = 1521))
)
)
Also make an entry into tnsnames.ora of primary database for standby database.
STDBY10G =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = machine_stand)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = STDBY10G)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = machine_stand)(PORT = 1521))
)
)
Also make an entry into tnsnames.ora of standby database for primary database.
ORCL10G =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = machine_prim)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL10G)
)
)
SQL> startup
pfile='e:\oracle\product\10.2.0\db_2\database\initstdby10g.ora' nomount;
To configure archive logging from the primary database to the standby site the
LOG_ARCHIVE_DEST_n and LOG_ARCHIVE_DEST_STATE_n parameters must be
defined.
Issue following commands from primary database session:
Open the standby database in read-only once to check if everything is setup correctly
SQL>startup mount;
Standby is now mounted and functional. Check alert log file to see if the standby
database is receiving archivelogs properly. Can also query V$ARCHIVED_LOG view to
verify that redo logs are received.
Archive the current log on the primary database using following statement.
To check if the archive logs are successfully applied on standby, use the below query :