停庫前執行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 table drop unused columns checkpoint
- [20231023]備庫與alter system flush buffer_cache.txt
- ALTER SYSTEM FLUSH BUFFER_POOL
- MySQL checkpoint執行時機MySql
- MySQL 5.7從庫system lock執行緒解釋MySql執行緒
- HDFS 重要機制之 checkpoint
- 2.7.6.2.1 ALTER SYSTEM SET語句中的SCOPE子句
- alter system set event和set events的區別
- alter system set ... scope=... 中的scope的含義是什麼?
- Golang 啟停管理及後臺執行Golang
- MySQL alter table時執行innobackupex全備再看Seconds_Behind_MasterMySqlAST
- ORACLE之手動註冊監聽listener。alter system set local_listener="XXX"Oracle
- MySQL 資料庫 ALTER命令講解MySql資料庫
- 初次執行 Git 前的配置Git
- 2020119-多執行緒暫停和喚醒執行緒
- 執行alter database open resetlogs提示ORA-00392和ORA-00312錯誤Database
- ManualResetEvent實現執行緒的暫停與恢復執行緒
- 呼叫System.gc沒有立即執行的解決方法GC
- 執行緒池其實看懂了也很簡單執行緒
- Java如何獲取當前執行緒Java執行緒
- Hightopo智慧停車化解生活不便,讓城市執行更加從容
- mysql checkpointMySql
- 遞迴遍歷當前目錄下所有的git倉庫,執行git pull操作遞迴Git
- Linux併發執行很簡單,這麼幹就對了Linux
- 這麼理解執行緒生命週期,是不是很簡單?執行緒
- SQL__ALTERSQL
- MySQL ALTER命令MySql
- 微軟執行庫下載微軟
- boost_python庫pyd執行庫不可少!Python
- 異常執行緒的相關複習(前)執行緒
- ORACLE資料庫檢視ACQ(ACTIVE CHECKPOINT QUEUE)資訊Oracle資料庫
- 由system.currentTimeMillis() 獲得當前的時間
- mysqld_multi 無法停庫MySql
- Postgresql 的CheckpointSQL
- ionic3最小化並且監控到前臺執行和後臺執行
- PostgreSQL 查詢當前執行中sql的執行計劃——pg_show_plans模組SQL
- mysql加快alter操作MySql
- Python如何獲取當前執行檔案路徑?Python
- 當前Activity的onPause執行完後,呼叫Paused介面