Oracle10g Physical Standby Database Notes

xiaoxiao2021-03-06  13

Test Environment Primary Server:

Windows2000 Server Oracle

10.0.1

.0.2

Oracle_sid: DGTest

Oracle_Home: D: / Oracle / Product /

10.1.0

/ db_1standby server:

Windows XP PRO ORACLE

10.0.1

.0.2racle_sid: DGTESTORACLE_HOME: D: / Oracle / Product /

10.1.0

/ db_1

Configuration Steps First, install the Oracle on Primary and Standby, build SIDs as DGTest's libraries, all settings are identical. Then stop the Oracle on both SHUTDOWN, copy all the data files on the primary, the control file, the Redo file, and the Password file copy to the Standby machine. (You can also use hot standby, RMAN, etc. to establish an initial STANDBY library), so we have two exactly the same Oracle Server

1. Set force loggingsql> ALTER DATABASE force logging on Primary Database;

2. Modify the initialization parameter of Primary Database DB_UNIQUE_NAME = 'primary'Control_files =' d: /oracle/product/oradata/control01.ctl ',' D: / Oracle/Product/oradata/control02.ctl ',' D: / Oracle /product/oradata/control03.ctl'LOG_ARCHIVE_DEST_1= 'LOCATION = d: / oracle / product / arch'LOG_ARCHIVE_DEST_2 =' SERVICE = standby'LOG_ARCHIVE_DEST_STATE_1 = ENABLELOG_ARCHIVE_DEST_STATE_2 = ENABLEREMOTE_LOGIN_PASSWORDFILE = EXCLUSIVELOG_ARCHIVE_FORMAT = 'arc% s% t% r.arc'FAL_SERVER = StandByfal_Client = primarystandby_file_management = AutoLock_name_space ---- This is when the master database and standby data are set to the SID of the alternate database when the master database and standby data are on the same machine.

3. Set the primary database to ArchiveLog mode SQL> Shutdown Immediate; SQL> Startup Mount; SQL> ALTER DATABASE ARCHIVELOG; SQL> ALTER DATABASE OPEN:

4. Create a standby database in the primary database control file SQL> shutdown immedaite; SQL> startup mount; SQL> alter database create standby controlfile as' d: /oracle/product/oradata/controlstandby.ctl'SQL> alter database open; Then copy the controlfile to the corresponding location of the Standby Server

5. Modify the standby databse initialization parameters DB_UNIQUE_NAME = 'standby'CONTROL_FILES =' d: /oracle/product/oradata/controlstandby.ctl'LOG_ARCHIVE_DEST_1= 'LOCATION = d: / oracle / product / arch'LOG_ARCHIVE_DEST_2 =' SERVICE = primary ' LOG_ARCHIVE_DEST_STATE_1 = ENABLELOG_ARCHIVE_DEST_STATE_2 = ENABLESTANDBY_ARCHIVE_DEST = 'd: / oracle / product / arch'REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVEFAL_SERVER = primaryFAL_CLIENT = standbySTANDBY_FILE_MANAGEMENT = AUTODB_FILE_NAME_CONVERT ---- ---- LOG_FILE_NAME_CONVERT inconsistent when using primary data files and the standby path when the primary and standby When the data file path is inconsistent, use Lock_Name_Space ---- When the primary database and standby data are set to the SID of the alternate database

For details, please refer to Oracle Online Document

6. Set the primary database and standby database tnsnames.oraprimary = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = primary_server) (PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = dgtest))) standby = (DeSCription = (address_list = (pecol = tcp) (host = standby_server))))))))))))))

7. Start Standby Database SQL> Startup Nomount Pfile = 'D: /oracle/product/initdgtest.ora'SQL> ALTER DATABASE MOUNT Standby Database;

8. Start Primary DatabaseSQL> Startup Pfile = 'D: / Oracle/Product/initdgtest.ora'

9. Start Standby Database to Recover Manage Mode SQL> ALTER DATABASE Recover Managed Standby Database Disconnect from Session;

Switchover

On Primary

1. SQL> SELECT SWITCHOVER_STATUS FROM V $ DATABASE SWITCHOVER_STATUS value into the share is to Standby, you can directly switchover, if you are sessions Active, you need to add with session shutdown after the command of Switchover

2. SQL> ALTABASE COMMIT TO SWITCHOVER TO Physical Standby; 3. SQL> ShutdowM Immediate;

4. SQL> Startup Mount;

On Standby

1. SQL> SELECT SWITCHOVER_STATUS from V $ DATABASE

The value of Switchover_Status is to primary, you can directly switchover, if it is sessions Active, you need to add with session shutdown after the command of Switchover.

2. SQL> ALTABASE COMMIT TO SWITCHOVER TO PRIMARY;

3. SQL> Shutdown Immediate;

4. SQL> Startup;

To achieve SwitchOver, it is best to set some of the initialization parameters of Primary and Standby on each Server, although some of these parameters only work on one of Primary or Standby.

Failover

On Standby

1. SQL> ALTABASE Recover Managed Standby Database Finish; Or SQL> Alter Database Recover Managed Standby Database Finish Skip Standby Logfile;

2. SQL> ALTABASE COMMIT TO SWITCHOVER TO PRIMARY;

3. SQL> Shutdown Immediate;

4. SQL> Startup;

Related view

V $ archive_dest

V $ archive_dest_status v $ log_history v $ Archvied_log V $ managed_standby v $ archive_gap

common problem

1. The log cannot transmit SQL> Select Dest_name, Status, Error From V $ Archive_Dest; check if the status of the corresponding archive path is Valid, otherwise according to Error information

2. alter database can not be used in a data file rename standby, when standby_file_management set to auto, allow the following operation alter database renamealter database add / drop logfilealter database add / drop standby logfile memberalter database create datafile as

转载请注明原文地址:https://www.9cbs.com/read-48397.html

New Post(0)