dg failover
To perform. the failover operation, you must connect to the standby database to
which you want to fail over using the SYSDBA username and password of that database
DGMGRL> connect sys/orcl@rhb_inst --standby network_service_name
Connected.
DGMGRL> show configuration
Configuration
Name: mybk
Enabled: YES
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
orcl - Primary database
rhb - Physical standby database
Current status for "mybk":
SUCCESS
DGMGRL> failover to rhb
Performing failover NOW, please wait...
Failover succeeded, new primary is "rhb"
验证主库:
ORA-03113: end-of-file on communication channel
Mon Sep 6 20:03:45 2010
LGWR: I/O error 3113 archiving log 2 to '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rhb)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=rhb_XPT)(INSTANCE_NAME=rhb)(SERVER=dedicated)))'
Mon Sep 6 20:04:31 2010
ALTER SYSTEM SET log_archive_dest_state_2='RESET' SCOPE=BOTH;
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PRIMARY
SQL> select dest_name ,error,status from v$archive_dest;
DEST_NAME
--------------------------------------------------------------------------------
ERROR STATUS
----------------------------------------------------------------- ---------
LOG_ARCHIVE_DEST_1
VALID
LOG_ARCHIVE_DEST_2
DEFERRED--关闭归档目录不再做远程归档
----------------------------------------------------------------------------
VALID -- The user has properly initialized the destination, which is available for archiving.
INACTIVE -- The user has not provided or has deleted the destination information.
ERROR -- An error occurred creating or writing to the destination file; refer to error data.
FULL -- Destination is full (no disk space).
DEFERRED -- The user manually and temporarily disabled the destination.
DISABLED -- The user manually and temporarily disabled the destination following an error; refer to error data.
BAD PARAM -- A parameter error occurred; refer to error data.
另外还有一种ALTERNATE 的status。
--------------------------------------------------------------------------------
一段 异常
Errors in file /u01/oracle/admin/orcl/udump/orcl_ora_5244.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-12663: Services required by client not available on the server
ORA-36961: Oracle OLAP is not available.
ORA-06512: at "SYS.OLAPIHISTORYRETENTION", line 1
备库
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PRIMARY
SQL> select status from v$instance;
STATUS
------------
OPEN
日志:
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH FORCE
Mon Sep 6 19:59:54 2010
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WAIT WITH SESSION SHUTDOWN
Mon Sep 6 19:59:54 2010
ALTER DATABASE SWITCHOVER TO PRIMARY (rhb)
If media recovery active, switchover will wait 900 seconds
Standby terminal recovery start SCN: 529795
SwitchOver after complete recovery through change 529798
Online log /u01/oracle/app/oradata/rhb/redo01.log: Thread 1 Group 1 was previously cleared
Online log /u01/oracle/app/oradata/rhb/redo02.log: Thread 1 Group 2 was previously cleared
Online log /u01/oracle/app/oradata/rhb/redo03.log: Thread 1 Group 3 was previously cleared
Standby became primary SCN: 529794
WARNING: STANDBY_FILE_MANAGEMENT initialization parameter is
not set to the value "AUTO".
This may cause recovery of the standby database to terminate
prior to applying all available redo data.
It may be necessary to use the ALTER DATABASE CREATE DATAFILE
command to add datafiles created on the primary database.
Converting standby mount to primary mount.
Mon Sep 6 19:59:54 2010
Switchover: Complete - Database mounted as primary (rhb)
Completed: ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WAIT WITH SESSION SHUTDOWN
同switchover相比
在归档应用的处理有差异
The FINISH clause initiates failover on the target physical standby database and
recovers the current standby redo log files. Use the FINISH clause only in the event of the failure of the primary database. This clause overrides any delay intervals specified.
Include FORCE to terminate the RFS processes and allow the failover to occur immediately, without waiting for the RFS process to exit. Specify NOWAIT to have control returned immediately, rather than after the recovery process is complete.
--finish子句发起应用standby库的容错转移且恢复当前归档日志 只能用于failover
清除当前联机日志
原primary节点不再是standby节点 需要重新创建
-------------------------------------------------
一段异常
Errors in file /u01/oracle/app/admin/rhb/bdump/rhb_rsm0_3467.trc:
ORA-00604: error occurred at recursive SQL level 2
ORA-12663: Services required by client not available on the server
ORA-36961: Oracle OLAP is not available.
ORA-06512: at "SYS.OLAPIHISTORYRETENTION", line 1
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21993926/viewspace-672746/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/21993926/viewspace-672746/