模式切换的完全的语法如下:
ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE {PROTECTION | AVAILABILITY |
PERFORMANCE}
1、最大保护转换为最大性能
SQL> alter database set standby database to maximize performance;
alter database set standby database to maximize performance
*
ERROR at line 1:
ORA-01126: database must be mounted EXCLUSIVE and not open for this operation
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
SQL> alter database set standby database to maximize performance;
Database altered.
SQL> alter database open;
Database altered.
SQL> select protection_mode,database_role from v$database;
PROTECTION_MODE
------------------------------------------------------------
DATABASE_ROLE
------------------------------------------------
MAXIMUM PERFORMANCE
PRIMARY
2、最大性能转换为最大可用
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
SQL> alter database set standby database to maximize availability;
Database altered.
SQL> alter database open;
Database altered.
SQL> select protection_mode,database_role from v$database;
PROTECTION_MODE
------------------------------------------------------------
DATABASE_ROLE
------------------------------------------------
MAXIMUM AVAILABILITY
PRIMARY
3、最大可用转换为最大保护
SQL> alter database set standby database to maximize protection;
alter database set standby database to maximize protection
*
ERROR at line 1:
ORA-01126: database must be mounted EXCLUSIVE and not open for this operation
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
SQL> alter database set standby database to maximize protection;
Database altered.
SQL> alter database open;
Database altered.
SQL> select protection_mode,database_role from v$database;
PROTECTION_MODE
------------------------------------------------------------
DATABASE_ROLE
------------------------------------------------
MAXIMUM PROTECTION
PRIMARY
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8102208/viewspace-474887/ ,如需转载,请注明出处,否则将追究法律责任。