停庫前執行alter system checkpoint 很重要!
近期幾次停一個庫遷檔案時, 發現srvctl stop instance xxx 停庫後, 遷完檔案在open時報
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01122: database file 113 failed verification check
ORA-01110: data file 113: '+DATA2/isddw/datafile/isdh36m201006032.30232.732834105'
ORA-01207: file is more recent than control file - old control file
檢查沒有發現diskgroup有disk offline(以前遇到過有disk offline時,也報類似的錯, online後recover成功),沒有發現有datafile offline
嘗試了以下幾個方法均不行:
1) 直接recover database noparallel
2)嘗試逐個使用單個的控制檔案
3)嘗試將所有節點的asm instance停掉,只啟動節點1的asm, 再open
4)嘗試alter system check datafiles;
5) alter database recover datafile 113 ?
6)recover database using backup controlfile;
(controle_files引數仍是當前的控制檔案) 發現不能自動尋找online redolog
7) 最後recreate control file解決,具體步驟見重建控制
. alter database backup controfile to trace
. 修改trc, 重建controfile file
. 執行recover database noparallel; auto
. open db
. 重建temp tbs, redo log file
這個錯誤是因cache中的資訊沒有及時寫入controlfile導致, 避免的方法是在每次停庫前,對DB作一次checkpoint, 即ALTER SYSTEM CHECKPOINT;要注意的是alter system switch logfile; 也會觸發checkpoint,但只會對執行sql的那個節點,不會對RAC中的所有節點
checkpoint_clause
Specify CHECKPOINT to explicitly force Oracle Database to perform. a checkpoint, ensuring that all changes made by committed transactions are written to datafiles on disk. You can specify this clause only when your instance has the database open. Oracle Database does not return control to you until the checkpoint is complete.
GLOBAL In an Oracle Real Application Clusters (RAC) environment, this setting causes Oracle Database to perform. a checkpoint for all instances that have opened the database. This is the default.
LOCAL In an Oracle RAC environment, this setting causes Oracle Database to perform. a checkpoint only for the thread of redo log file groups for the instance from which you issue the statement.
Forcing a Checkpoint: Example The following statement forces a checkpoint:
ALTER SYSTEM CHECKPOINT;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25462274/viewspace-2125328/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- alter system switch logfile的執行時間是多久。
- oracle switch logfile日誌切換及alter system checkpoint作了什麼Oracle
- alter system events與alter system event的區別
- Alter system in OracleOracle
- [alter system dump學習1]alter system dump logfile
- alter system archive log current和alter system switch logfileHive
- ALTER SYSTEM SWITCH LOGFILE ALTER SYSTEM ARCHIVELOG CURRENT 區別Hive
- alter system kill sessionSession
- alter database和alter system和alter session的區別DatabaseSession
- MySQL checkpoint執行時機MySql
- alter system switch logfile和alter system archive log current的區別Hive
- alter system switch logfile 和 alter system archive log current 的區別Hive
- Java通過join方法來暫停當前執行緒Java執行緒
- alter system check datafiles 命令
- alter session|system set eventsSession
- [轉]alter system switch logfile和alter system archive log current的區別Hive
- zt:alter system switch logfile與ALTER SYSTEM ARCHIVE LOG CURRENT的區別Hive
- 執行alter system flush buffer_cache一定會產生檢查點嗎?
- alter system dump datafile headerHeader
- ALTER SYSTEM DISCONNECT SESSION ClauseSession
- alter system archive log current noswitch!!Hive
- HDFS 重要機制之 checkpoint
- MySQL 5.7從庫system lock執行緒解釋MySql執行緒
- 忍不住問下alter system 和alter database的區別Database
- alter system kill session 不成功Session
- 在oracle10g執行alter system switch logfile並未開啟自動歸檔Oracle
- alter system set events 相關知識
- alter system set events 知識 [final]
- oracle中Alter system 命令的總結Oracle
- alter system set events相關知識:
- alter system set events相關知識
- alter system archive log current / all / switch logfileHive
- 【Oracle】alter system set events 相關知識Oracle
- ALTER SYSTEM KILL SESSION這麼沒力?(轉)Session
- alter session enable parallel dml 使DML語句並行執行SessionParallel並行
- Golang 啟停管理及後臺執行Golang
- 以SYSTEM使用者執行CMD
- alter system set event和set events的區別