Heim >Datenbank >MySQL-Tutorial >Oracle 12c R1 DataGuard的主备切换
Data Guard物理备库的主备切换1.查看状态 主库: SQLgt; SELECT SWITCHOVER_STATUS FROM V$DATABASE; SWITCHOVER_STATUS-------
Data Guard物理备库的主备切换
1.查看状态
主库:
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
------------------------------------------------------------
TO STANDBY //可以转换成备库
备库:
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
------------------------------------------------------------
NOT ALLOWED
2.主切备
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY;
数据库已更改。
SQL> startup nomount;
Oracle 例程已经启动。
Total System Global Area 751595520 bytes
Fixed Size 2292912 bytes
Variable Size 557843280 bytes
Database Buffers 188743680 bytes
Redo Buffers 2715648 bytes
SQL> alter database mount standby database;
数据库已更改。
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
数据库已更改。
3.备切主
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
------------------------------------------------------------
TO PRIMARY
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
数据库已更改。
SQL> select status from v$instance;
STATUS
------------------------------------
MOUNTED
SQL> alter database open;
数据库已更改。
更多详情见请继续阅读下一页的精彩内容:
推荐阅读:
使用RMAN的Duplicate功能创建物理DataGuard
Oracle基础教程之通过RMAN复制数据库
RMAN备份策略制定参考内容
RMAN备份学习笔记
Oracle数据库备份加密 RMAN加密
通过RMAN备份duplicate创建DataGuard
,