当前位置:主页 > 热门技术 >

更改dataguard的保护模式

作者:AG88发表时间:2018-11-10

更改dataguard的保护模式  

查看当前的保护模式:

亚游官网SQL>  select protection_mode from v$database;



PROTECTION_MODE

--------------------

MAXIMUM AVAILABILITY



准备将保护模式改成最大性能模式:



在主库上:

SQL>shutdown immediate;

Databaseclosed.

Databasedismounted.

ORACLE instanceshut down.

SQL> startupmouont;

SP2-0714:invalid combination of STARTUP options

SQL> startupmount

ORACLE instancestarted.



Total SystemGlobal Area  281018368 bytes

Fixed Size                  1218944 bytes

VariableSize             104859264 bytes

DatabaseBuffers          167772160 bytes

RedoBuffers                7168000 bytes

Databasemounted.



SQL> alterdatabase set standby database to maximize performance;



Databasealtered.



SQL> alterdatabase open;



Databasealtered.



SQL> selectprotection_mode from v$database;



PROTECTION_MODE

--------------------

MAXIMUM PERFORMANCE



由于是安全模式降级,所以非常简单,standby库都不用重启。



现将安全等级改成最大保护模式:



在standby库查看是否有standby logfile,如没有的话需要建立。

SQL> select* from v$logfile;



GROUP#STATUS     TYPE     MEMBER                                   IS_

---------------- -------- ---------------------------------------- ---

     3            ONLINE   /u01/app/oracle/oradata/orcl/redo03.log  NO

     2            ONLINE   /u01/app/oracle/oradata/orcl/redo02.log  NO

     1            ONLINE   /u01/app/oracle/oradata/orcl/redo01.log  NO

     4            STANDBY  /u01/app/oracle/oradata/orcl/redo04.log  NO

     5            STANDBY  /u01/app/oracle/oradata/orcl/redo05.log  NO

     6            STANDBY  /u01/app/oracle/oradata/orcl/redo06.log  NO

     7            STANDBY  /u01/app/oracle/oradata/orcl/redo07.log  NO



7 rowsselected.



将主机和备机都关掉。



SQL>shutdown immediate;



修改主机的参数文件:

*.log_archive_dest_2='SERVICE=10gstandbyLGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)DB_UNIQUE_NAME=10gstandby'



SQL> startupmount

ORACLE instancestarted.



Total SystemGlobal Area  281018368 bytes

Fixed Size                  1218944 bytes

VariableSize             104859264 bytes

DatabaseBuffers          167772160 bytes

RedoBuffers                7168000 bytes

Databasemounted.

SQL> alterdatabase set standby database to maximize protection;



Databasealtered.



这时要先打开standby库,如果先打开主库的话会启动失败.



先打库standby库:

SQL> startupmount;

ORACLE instancestarted.



Total SystemGlobal Area  281018368 bytes

Fixed Size                  1218944 bytes

VariableSize              96470656 bytes

DatabaseBuffers          176160768 bytes

RedoBuffers                7168000 bytes

Databasemounted.



SQL> recovermanaged standby database disconnect from session;

Mediarecovery complete.



最后打开主库验证一下:

SQL> alterdatabase open;



Databasealtered.



SQL>  select protection_mode from v$database;



PROTECTION_MODE

--------------------

MAXIMUMPROTECTION

 

   

http://www.bkjia.com/oracle/480551.htmlwww.bkjia.comtruehttp://www.bkjia.com/oracle/480551.htmlTechArticle更改dataguard的保护模式 查看当前的保护模式:SQL select protection_mode from v$database;PROTECTION_MODE--------------------MAXIMUM AVAILABILITY准备将保护模式改...

本文源自: 环亚娱乐

热门技术
联系我们