Primary Environment
DB version: Oracle10.2.0.4
IP: 192.168.1.7
Hostname: vzwc
Db_name: dbserver
Db_unique_name: dbserver
Service_name: dbserver
Instance_name: ORCL
Standby Environment
DB version: oracle10.2.0.4
IP: 192.168.1.6
Hostname: dgstb
Db_name: dbserver
Db_unique_name: standby
Service_name: standby
Instance_name: standby
**************************************** *****
Configure primary
-- Enable force logging and archiving to set the archive directory
SQL> startup mount
ORACLE instance started.
Total System Global Area 612368384 bytes
Fixed Size 2085872 bytes
Variable Size 167775248 bytes
Database Buffers 436207616 bytes
Redo Buffers 6299648 bytes
Database mounted.
SQL> alter database force logging;
Database altered.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> alter system set log_archive_dest_1 = 'location =/arch ';
System altered.
-- Create standby controlfile and pfile, and upload the password file together to the standby end.
SQL> alter database create standby controlfile as '/u01/app/oracle/standby. ctl ';
Database altered.
SQL> create pfile = '/u01/app/oracle/init. ora' from spfile;
File created.
SQL>! Scp/u01/app/oracle/*. ctl oracle@192.168.1.6:/u01/app/oracle
The authenticity of host' 192. 168.1.6 (192.168.1.6) 'can't be established.
RSA key fingerprint is 9c: 7e: 6b: 4f: ad: 6a: bd: 2e: b0: 34: ef: 5c: a5: ff: 69: 1f.
Are you sure you want to continue connecting (yes/no )? Yes
Warning: Permanently added '192. 168.1.6 '(RSA) to the list of known hosts.
Oracle@192.168.1.6's password:
Standby. ctl 100% 7152KB 7.0 MB/s
SQL>! Scp/u01/app/oracle/*. ora oracle@192.168.1.6:/u01/app/oracle
Oracle@192.168.1.6's password:
Init. ora 100% 1225 1.2KB/s
SQL>! Scp $ ORACLE_HOME/dbs/orapwORCL oracle@192.168.1.6:/u01/app/oracle
Oracle@192.168.1.6's password:
OrapwORCL 100% 2048 2.0KB/s
**************************************** *****
Configure standby
-- Rename pfile and Password File
[Oracle @ dgstb ~] $ Cd $ ORACLE_HOME/dbs
[Oracle @ dgstb dbs] $ mv/u01/app/oracle/orapwORCL orapwstandby
[Oracle @ dgstb dbs] $ mv/u01/app/oracle/init. ora initstandby. ora
-- Configure standby Environment Variables
Alias ls = "ls-FA"
Export ORACLE_BASE =/u01/app/oracle
Export ORACLE_HOME = $ ORACLE_BASE/product/10.2.0/db_1
Export ORACLE_PATH = $ ORACLE_BASE/common/oracle/SQL:.: $ ORACLE_HOME/rdbms/admin
Export ORACLE_SID = standby
Export PATH =. :$ {JAVA_HOME}/bin :$ {PATH }:$ HOME/bin: $ ORACLE_HOME/bin
Export PATH =$ {PATH }:/ usr/bin:/usr/bin/X11:/usr/local/bin
Export PATH =$ {PATH}: $ ORACLE_BASE/common/oracle/bin
Export ORACLE_TERM = xterm
Export TNS_ADMIN = $ ORACLE_HOME/network/admin
Export ORA_NLS10 = $ ORACLE_HOME/nls/data
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib
Export LD_LIBRARY_PATH =$ {LD_LIBRARY_PATH}: $ ORACLE_HOME/mongom/lib
Export LD_LIBRARY_PATH =$ {LD_LIBRARY_PATH}:/lib:/usr/local/lib
Export CLASSPATH = $ ORACLE_HOME/JRE
Export CLASSPATH =$ {CLASSPATH}: $ ORACLE_HOME/jlib
Export CLASSPATH =$ {CLASSPATH}: $ ORACLE_HOME/rdbms/jlib
Export CLASSPATH =$ {CLASSPATH}: $ ORACLE_HOME/network/jlib
Export THREADS_FLAG = native
Export TEMP =/tmp
Export TMPDIR =/tmp
Alias sqlplus = "rlwrap sqlplus"
Alias rman = "rlwrap rman"
Alias base = "cd $ ORACLE_BASE"
Alias home = "cd $ ORACLE_HOME"
-- Create the corresponding directory and configure standby pfile. Do not change db_name to be consistent with primary. add necessary parameters for the standby database.
[Oracle @ dgstb oracle] $ pwd
/U01/app/oracle
[Oracle @ dgstb oracle] $ mkdir-p admin/standby/{a, B, c, u} dump
[Oracle @ dgstb oracle] $ mkdir-p oradata/standby
[Oracle @ dgstb oracle] $ ls admin/standby
Adump/bdump/cdump/udump/
[Oracle @ dgstb dbs] $ cat initstandby. ora
*. Audit_file_dest = '/u01/app/oracle/admin/standby/adump'
*. Background_dump_dest = '/u01/app/oracle/admin/standby/bdump'
*. Compatible = '10. 2.0.3.0'
*. Control_files = '/u01/app/oracle/standby. ctl'
*. Core_dump_dest = '/u01/app/oracle/admin/standby/cdump'
*. Db_block_size = 8192
*. Db_domain =''
*. Db_file_multiblock_read_count = 16
*. Db_name = 'dbserver'
*. Dispatchers = '(PROTOCOL = TCP) (SERVICE = ORCLXDB )'
*. Job_queue_processes = 10
*. Log_archive_format = 'arc % S _ % R. % t'
*. Nls_language = 'simplified CHINESE'
*. Nls_territory = 'China'
*. Open_cursors = 300
*. Pga_aggregate_target = 203423744
*. Processses = 500
*. Remote_login_passwordfile = 'clusive'
*. Sessions = 555
*. Sga_target = 612368384
*. Undo_management = 'auto'
*. Undo_tablespace = 'undotbs1'
*. User_dump_dest = '/u01/app/oracle/admin/standby/udump'
# Add parameters for standby
*. Db_unique_name = 'standby'
*. Db_file_name_convert = '/u01/app/oracle/oradata/dbserver','/u01/app/oracle/oradata/standby'
*. Log_file_name_convert = '/u01/app/oracle/oradata/dbserver','/u01/app/oracle/oradata/standby'
*. Log_archive_config = 'dg _ config = (dbserver, standby )'
*. Log_archive_dest_1 = 'location =/arch valid_for = (all_logfiles, all_roles) db_unique_name = standby'
*. Log_archive_dest_2 = 'service = dbserver lgwr async valid_for = (online_logfiles, primary_role) db_unique_name = dbserver'
*. Log_archive_dest_state_1 = enable
*. Log_archive_dest_state_2 = enable
*. Log_archive_max_processes = 10
*. Fal_server = dbserver
*. Fal_client = standby
*. Standby_file_management = auto
-- Configure the static listener and service name
[Oracle @ dgstb admin] $ cat listener. ora
# Listener. ora Network Configuration File:/u01/app/oracle/product/10.2.0/db_1/network/admin/listener. ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = standby)
(ORACLE_HOME =/u01/app/oracle/product/10.2.0/db_1)
(SID_NAME = standby)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.6) (PORT = 1521 ))
)
[Oracle @ dgstb admin] $ cat tnsnames. ora
# Tnsnames. ora Network Configuration File:/u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames. ora
# Generated by Oracle configuration tools.
STANDBY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.6) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = standby)
)
)
DBSERVER =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.7) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = dbserver)
)
)
-- Start the listener
[Oracle @ dgstb admin] $ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.4.0-Production on 13-FEB-2014 22:58:13
Copyright (c) 1991,200 7, Oracle. All rights reserved.
Starting/u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.4.0-Production
System parameter file is/u01/app/oracle/product/10.2.0/db_1/network/admin/listener. ora
Log messages written to/u01/app/oracle/product/10.2.0/db_1/network/log/listener. log
Listening on: (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.1.6) (PORT = 1521 )))
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.6) (PORT = 1521 )))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.4.0-Production
Start Date 13-FEB-2014 22:58:13
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File/u01/app/oracle/product/10.2.0/db_1/network/admin/listener. ora
Listener Log File/u01/app/oracle/product/10.2.0/db_1/network/log/listener. log
Listening Endpoints Summary...
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.1.6) (PORT = 1521 )))
Services Summary...
Service "standby" has 1 instance (s ).
Instance "standby", status UNKNOWN, has 1 handler (s) for this service...
The command completed successfully
[Oracle @ dgstb admin] $ sqlplus system @ dbserver
SQL * Plus: Release 10.2.0.4.0-Production on Thu Feb 13 22:58:28 2014
Copyright (c) 1982,200 7, Oracle. All Rights Reserved.
Enter password:
Connected:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0-64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>