您好,登錄后才能下訂單哦!
這篇文章主要介紹了oracle 11g中如何手工熱備數據庫,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
查看數據庫是否處于歸檔模式,開啟數據庫熱備模式,拷貝操作系統數據庫數據文件到備份目錄
SYS@PROD> archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch Oldest online log sequence 2 Next log sequence to archive 4 Current log sequence 4 SYS@PROD> alter database begin backup; Database altered. SYS@PROD> host [oracle@enmoedu1 PROD]$ rm -rf /home/oracle/bak/* [oracle@enmoedu1 PROD]$ cp *.dbf /home/oracle/bak [oracle@enmoedu1 PROD]$ exit exit SYS@PROD> alter database end backup; Database altered.
刪除所有的數據文件
SYS@PROD> host [oracle@enmoedu1 PROD]$ rm -rf *.dbf [oracle@enmoedu1 PROD]$ ll total 172652 -rw-r----- 1 oracle oinstall 9748480 Jan 24 22:50 control01.ctl -rw-r----- 1 oracle oinstall 9748480 Jan 24 22:50 control02.ctl -rw-r----- 1 oracle oinstall 52429312 Jan 24 22:50 redo01.log -rw-r----- 1 oracle oinstall 52429312 Jan 24 22:41 redo02.log -rw-r----- 1 oracle oinstall 52429312 Jan 24 22:41 redo03.log [oracle@enmoedu1 PROD]$
啟動數據庫報錯
SYS@PROD> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SYS@PROD> startup ORACLE instance started. Total System Global Area 835104768 bytes Fixed Size 2257840 bytes Variable Size 536874064 bytes Database Buffers 289406976 bytes Redo Buffers 6565888 bytes Database mounted. ORA-01157: cannot identify/lock data file 1 - see DBWR trace file ORA-01110: data file 1: '/u01/app/oracle/oradata/PROD/system01.dbf' SYS@PROD>
拷貝熱備后的數據文件到原數據文件目錄
[oracle@enmoedu1 PROD]$ cp /home/oracle/bak/*.dbf ./ ——拷貝數據文件到以前的數據文件目錄 [oracle@enmoedu1 PROD]$ exit exit SYS@PROD> select open_mode from v$database; OPEN_MODE -------------------- MOUNTED SYS@PROD> alter database open——嘗試打開數據庫,報錯 2 ; alter database open * ERROR at line 1: ORA-01113: file 1 needs media recovery ORA-01110: data file 1: '/u01/app/oracle/oradata/PROD/system01.dbf'
恢復數據庫
SYS@PROD> recover database;——恢復數據庫 Media recovery complete. SYS@PROD> alter database open;——開庫 Database altered. SYS@PROD> select status from v$instance; STATUS ------------ OPEN
感謝你能夠認真閱讀完這篇文章,希望小編分享的“oracle 11g中如何手工熱備數據庫”這篇文章對大家有幫助,同時也希望大家多多支持億速云,關注億速云行業資訊頻道,更多相關知識等著你來學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。