小编给大家分享一下oracle 12c data guard如何使用 sqlplus 主备切换,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!确认备库与主库是同步的并且日志切换正常。SQL>alter database switchover to
ALTER DATABASE SWITCHOVER TO S1202 VERIFY
*
ERROR at line 1:
ORA-16475: succeeded with warnings, check alert log for more detailsIn alert.log, following messages appear.SWITCHOVER VERIFY: Send VERIFY request to switchover target S1202
SWITCHOVER VERIFY COMPLETE
SWITCHOVER VERIFY WARNING: switchover target has no standby database definedin LOG_ARCHIVE_DEST_n parameter. If the switchover target is converted to
a primary database, the new primary database will not be protected.ORA-16475 signalled during: ALTER DATABASE SWITCHOVER TO S1202 VERIFY…What to do? set log_archive_dest_state_n on Standby.1. 检查是否有些关闭的线程存在并且 disableSQL>SELECT thread#, instance, status FROM v$thread;Disable 线程使用:SQL> ALTER DATABASE DISABLE THREAD
SQL>show parameter log_Archive_destSQL>alter system set log_archive_trace=8191 sid=’*’;@primary and standby,SQL>show parameter background_dump_dest
$tail -600f background_dump_dest/alert*
* 注意: 在 RAC 环境不需要关闭其他的实例,执行 Switchover 的命令会关闭所有的实例。主库 – Boston,SQL>alter database switchover to chicago;Database altered.以下是主库(BOSTON)和备库(CHICAGO)的 alert 输出:————–Primary Alert log “alert_boston.log”————–Fri Aug 23 11:05:23 2013ALTER SYSTEM SET log_archive_trace=8191 SCOPE=BOTH;alter database switchover to chicagoFri Aug 23 11:05:43 2013Starting switchover [Process ID: 3340]Fri Aug 23 11:05:43 2013ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY [Process Id: 3340] (boston).Fri Aug 23 11:05:44 2013Active, synchronized Physical Standby switchover ta免费主机域名rget has been identifiedPreventing updates and queries at the PrimaryGenerating and shipping final logs to target standbySwitchover End-Of-Redo Log thread 1 sequence 11 has been fixed
Switchover: Primary highest seen SCN set to 0x0.0x229306ARCH: Noswitch archival of thread 1, sequence 11.Switchover: Primary controlfile converted to standby controlfile succesfully.Switchover: Complete – Database shutdown requiredSending request (convert to primary database) to switchover target CHICAGOOCISessionBegin with PasswordVerifier succeededSwitchover complete. Database shutdown requiredUSER (ospid: 3340): terminating the instanceFri Aug 23 11:05:51 2013Instance terminated by USER, pid = 3340Completed: alter database swit免费主机域名chover to chicago——————-alert log “alert_chicago.log”——————Fri Aug 23 11:05:47 2013SWITCHOVER: received request ‘ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY’ from primary database.Fri Aug 23 11:05:47 2013ALTER DATABASE SWITCHOVER TO PRIMARY (chicago)Maximum wait for role transition is 15 minutes..Standby became primary SCN: 2265860Switchover: Complete – Database mounted as primarySWITCHOVER: completed request from primary database.注意:备库一端只等待15分钟,实现备库与主库的同步。SQL>alter database open;SQL>shut abortSQL>startupSQL>alter database recover managed standby database disconnect;SQL> alter system set log_archive_trace=0;System altered.在主库侧执行SQL>alter system switch logfile;SQL>select dest_id,error,status from v$archive_dest where dest_id=
dest_id=2;在备库侧:SQL>select thread#,sequence#,process,status from gv$managed_standby;SQL>select max(sequence#),thread# from v$archived_log group by thread#;注意:在 12.2 中使用 v$dataguard_process 替代 v$managed_standbySQL> select name,role,instance,thread#,sequence#,action from gv$dataguard_process;以上是“oracle 12c data guard如何使用 sqlplus 主备切换”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注云技术行业资讯频道!
这篇文章主要为大家展示了“DG归档日志断档时间过长怎么处理”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“DG归档日志断档时间过长怎么处理”这篇文章吧。 1、备库操作(1)取消日志的应用ALTER DATABASE …