1.准备工作
■ 创建oracle11g的primary和standby库,物理standby,最大性能模式
■ DG_BROKER_START设置为TRUE
2.创建broker配置
DGMGRL> CREATE CONFIGURATION 'DRTEST' AS PRIMARY DATABASE IS 'ora11gn1' CONNECT IDENTIFIER IS ora11gn1;DGMGRL> ADD DATABASE 'ora11gn2' AS CONNECT IDENTIFIER IS ora11gn2;DGMGRL> ENABLE CONFIGURATION;DGMGRL> SHOW CONFIGURATION;Configuration - DRTEST Protection Mode: MaxPerformance Databases: ora11gn1 - Primary database ora11gn2 - Physical standby databaseFast-Start Failover: DISABLEDConfiguration Status:SUCCESSDGMGRL> SHOW DATABASE VERBOSE ora11gn1;Database - ora11gn1 Role: PRIMARY Intended State: TRANSPORT-ON Instance(s): ora11gn Properties: DGConnectIdentifier = 'ora11gn1' ObserverConnectIdentifier = '' LogXptMode = 'ASYNC' DelayMins = '0' Binding = 'optional' MaxFailure = '0' MaxConnections = '1' ReopenSecs = '300' NetTimeout = '30' RedoCompression = 'DISABLE' LogShipping = 'ON' PreferredApplyInstance = '' ApplyInstanceTimeout = '0' ApplyParallel = 'AUTO' StandbyFileManagement = 'AUTO' ArchiveLagTarget = '0' LogArchiveMaxProcesses = '4' LogArchiveMinSucceedDest = '1' DbFileNameConvert = '/u01/oradata/ora11gn/, /u01/oradata/ora11gn/' LogFileNameConvert = '/u01/oradata/ora11gn/, /u01/oradata/ora11gn/' FastStartFailoverTarget = '' InconsistentProperties = '(monitor)' InconsistentLogXptProps = '(monitor)' SendQEntries = '(monitor)' LogXptStatus = '(monitor)' RecvQEntries = '(monitor)' SidName = 'ora11gn' StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora11gdg)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ora11gn1_DGMGRL)(INSTANCE_NAME=ora11gn)(SERVER=DEDICATED)))' StandbyArchiveLocation = '/u01/app/oracle/11.2.0/db_1/dbs/arch' AlternateLocation = '' LogArchiveTrace = '0' LogArchiveFormat = '%t_%s_%r.dbf' TopWaitEvents = '(monitor)'Database Status:SUCCESSDGMGRL> SHOW DATABASE ora11gn2;Database - ora11gn2 Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds Apply Lag: 0 seconds Real Time Query: ON Instance(s): ora11gnDatabase Status:SUCCESS
附:
listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/11.2.0/db_1/network/admin/listener.ora# Generated by Oracle configuration tools.SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_NAME = ora11gn) (GLOBAL_DBNAME=ora11gn1_DGMGRL) (ORACLE_HOME = /u01/app/oracle/11.2.0/db_1) (SID_NAME = ora11gn) ) )LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.101)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) )ADR_BASE_LISTENER = /u01/app/oracle
tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/11.2.0/db_1/network/admin/tnsnames.ora# Generated by Oracle configuration tools.ORA11GN1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.101)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ora11gn1) ) )ORA11GN2 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.102)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ora11gn2) ) )