表設定為nologging能恢復出來嗎?
首先建立一張測試表
JZH@test>create table t2 as select * from dba_objects where 0=1;
Table created.
JZH@test>select * from t2;
no rows selected
設定nologging
JZH@test>alter table t2 nologging;
Table altered.
插入資料
JZH@test>insert /*+ append */ into t2 select * from dba_objects;
75301 rows created.
JZH@test>commit;
Commit complete.
JZH@test>select count(*) from t2;
COUNT(*)
----------
75301
備份資料庫
RMAN> backup database format '/u01/app/oracle/arch/test_%u_%p_%s.rmn';
Starting backup at 29-SEP-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/test/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/test/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/test/users01.dbf
channel ORA_DISK_1: starting piece 1 at 29-SEP-14
channel ORA_DISK_1: finished piece 1 at 29-SEP-14
piece handle=/u01/app/oracle/arch/test_0cpjm86h_1_12.rmn tag=TAG20140929T013721 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 29-SEP-14
channel ORA_DISK_1: finished piece 1 at 29-SEP-14
piece handle=/u01/app/oracle/arch/test_0dpjm896_1_13.rmn tag=TAG20140929T013721 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 29-SEP-14
關閉資料庫啟動到mount狀態
SYS@test>shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@test>startup mount
ORACLE instance started.
Total System Global Area 626327552 bytes
Fixed Size 2230952 bytes
Variable Size 444597592 bytes
Database Buffers 176160768 bytes
Redo Buffers 3338240 bytes
Database mounted.
rman恢復
RMAN> restore database;
Starting restore at 29-SEP-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/test/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/test/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/test/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/test/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/test/example01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/arch/test_0cpjm86h_1_12.rmn
channel ORA_DISK_1: piece handle=/u01/app/oracle/arch/test_0cpjm86h_1_12.rmn tag=TAG20140929T013721
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:15
Finished restore at 29-SEP-14
RMAN> recover database;
Starting recover at 29-SEP-14
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 29-SEP-14
查詢T2表
JZH@test>select count(*) from t2;
COUNT(*)
----------
75301
OK了,恢復出來了!
BTW:restore是從備份中還原資料庫,如果資料寫回磁碟了,是可以恢復出來的,當然如果備份是採用insert之前的,肯定是恢復不了。
JZH@test>create table t2 as select * from dba_objects where 0=1;
Table created.
JZH@test>select * from t2;
no rows selected
設定nologging
JZH@test>alter table t2 nologging;
Table altered.
插入資料
JZH@test>insert /*+ append */ into t2 select * from dba_objects;
75301 rows created.
JZH@test>commit;
Commit complete.
JZH@test>select count(*) from t2;
COUNT(*)
----------
75301
備份資料庫
RMAN> backup database format '/u01/app/oracle/arch/test_%u_%p_%s.rmn';
Starting backup at 29-SEP-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/test/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/test/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/test/users01.dbf
channel ORA_DISK_1: starting piece 1 at 29-SEP-14
channel ORA_DISK_1: finished piece 1 at 29-SEP-14
piece handle=/u01/app/oracle/arch/test_0cpjm86h_1_12.rmn tag=TAG20140929T013721 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 29-SEP-14
channel ORA_DISK_1: finished piece 1 at 29-SEP-14
piece handle=/u01/app/oracle/arch/test_0dpjm896_1_13.rmn tag=TAG20140929T013721 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 29-SEP-14
關閉資料庫啟動到mount狀態
SYS@test>shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@test>startup mount
ORACLE instance started.
Total System Global Area 626327552 bytes
Fixed Size 2230952 bytes
Variable Size 444597592 bytes
Database Buffers 176160768 bytes
Redo Buffers 3338240 bytes
Database mounted.
rman恢復
RMAN> restore database;
Starting restore at 29-SEP-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/test/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/test/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/test/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/test/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/test/example01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/arch/test_0cpjm86h_1_12.rmn
channel ORA_DISK_1: piece handle=/u01/app/oracle/arch/test_0cpjm86h_1_12.rmn tag=TAG20140929T013721
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:15
Finished restore at 29-SEP-14
RMAN> recover database;
Starting recover at 29-SEP-14
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 29-SEP-14
查詢T2表
JZH@test>select count(*) from t2;
COUNT(*)
----------
75301
OK了,恢復出來了!
BTW:restore是從備份中還原資料庫,如果資料寫回磁碟了,是可以恢復出來的,當然如果備份是採用insert之前的,肯定是恢復不了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10271187/viewspace-1284457/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- win10怎麼恢復出廠設定 win10恢復出廠設定需要裝系統嗎Win10
- 電腦恢復出廠設定後需要重灌系統嗎 電腦恢復出廠設定後措施詳解
- 行動硬碟刪除格式化後還能恢復出來嗎硬碟
- Recovery恢復出廠設定方法
- 如何為MacBook或Mac電腦恢復出廠設定Mac
- windows10恢復出廠設定的方法_win10出廠設定如何恢復WindowsWin10
- w10如何恢復出廠設定_w10恢復出廠設定的步驟
- jz2440恢復出廠設定
- 如何恢復出廠設定的Mac?Mac
- 怎麼把c盤恢復出廠設定 電腦c盤怎麼恢復出廠設定
- 中了字尾為.LockBit勒索病毒怎麼辦?能恢復嗎?
- window10恢復出廠設定如何操作 win10電腦怎麼恢復出廠設定Win10
- win10如何一鍵恢復出廠設定 win10恢復出廠設定的步驟Win10
- 恢復被設定為Unused的欄位
- mac恢復出廠設定方法介紹 mac恢復出廠設定對電腦有什麼影響Mac
- OPPO K1怎麼恢復出廠設定?OPPO K1恢復出廠設定詳細教程
- win10電腦如何恢復出廠設定 win10系統恢復出廠設定的步驟Win10
- 路由器恢復出廠設定後怎麼設定教程路由器
- win10怎麼恢復出廠設定找不到恢復環境Win10
- 小米盒子恢復出廠設定圖文教程
- 恢復出廠設定 Factory Reset 呼叫過程
- 膝上型電腦怎麼恢復出廠設定 膝上型電腦通用恢復出廠設定步驟
- 小心!手機恢復出廠設定資料仍可“復活”
- iPhone刪除的照片能恢復嗎?蘋果手機照片怎麼恢復iPhone蘋果
- win10恢復出廠設定會刪除c盤以外的檔案嗎Win10
- rm -rf 刪除檔案還能恢復嗎?
- win10恢復出廠設定在哪 筆記本win10怎麼恢復出廠設定Win10筆記
- win8系統如何恢復出廠設定 ?
- P710管理埠恢復出廠設定
- 360路由器怎麼恢復出廠設定?路由器
- 360路由器恢復出廠怎麼設定路由器
- 剪下的檔案還能恢復嗎,恢復剪貼丟失的檔案
- Oracle自動恢復設定Oracle
- ORACLE設定 快速恢復區Oracle
- win10怎麼設定出廠設定 win10恢復出廠設定會怎麼樣Win10
- 回收站刪除ppt檔案能恢復嗎?
- 蘋果手機使用技巧:iPhone如何恢復出廠設定?蘋果iPhone
- windows10恢復出廠設定找不到恢復環境最佳解決方法Windows