概述
.1.1 查看主库状态
SQL> SELECT OPEN_MODE, DATABASE_ROLE, SWITCHOVER_STATUS, FORCE_LOGGING, DATAGUARD_BROKER, GUARD_STATUS FROM V$DATABASE;
1.1.2 切换到备库
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY;
1.1.3 启动到mount状态
SQL> STARTUP MOUNT
1.2 备库,切换成主库并启动到open
1.2.1 查看备库状态
SQL> SELECT OPEN_MODE, DATABASE_ROLE, SWITCHOVER_STATUS, FORCE_LOGGING, DATAGUARD_BROKER, GUARD_STATUS FROM V$DATABASE;
1.2.2 切换到主库
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
1.2.3 数据库open
SQL> ALTER DATABASE OPEN;
1.3 新的备库启动日志应用
1.3.1 备库mount状态直接启动日志应用
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
1.3.2 备库切换到open状态,启用Real-time query
A physical standby database instance cannot be opened if Redo Apply is active on a mounted instance of that database. Use the following SQL statements to stop Redo Apply, open a standby instance read-only, and restart Redo Apply:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL> ALTER DATABASE OPEN;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
最后
以上就是义气母鸡为你收集整理的oracle 主备 工具,Oracle DataGuard主备库切换的全部内容,希望文章能够帮你解决oracle 主备 工具,Oracle DataGuard主备库切换所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复