bbed_recover:恢復資料塊資料庫

imlihj2007發表於2011-11-01

--網上的 aul odu dul 都是收費的...所以自己寫了一個 對於資料塊級別的資料尋找 還級別湊活^_^
--cheate tab and get blockid
create table test000 nologging as select /* +append */TEST00.NEXTVAL zj,a.* from dba_objects a
create unique index pk_test00 on TEST000 (zj);
select * from dba_objects where object_name='TEST000' and owner='SCOTT'
select dbms_rowid.rowid_relative_fno(t.rowid) || '_' ||
dbms_rowid.rowid_block_number(t.rowid),
t.zj
from TEST000 t;
4_101004 1
4_201193 6852077
--truncate or not,delete or not,drop or not
--intall bbed
--dev bash use bbed for revocer
--run bbed_recover
rac1-> ll
total 36
-rw-r--r-- 1 oracle oinstall 44 Nov 1 20:44 bbed.par
-rwxr-xr-x 1 oracle oinstall 247 Nov 1 22:38 bbed000
-rwxr-xr-x 1 oracle oinstall 311 Nov 1 20:41 bbed_blkno
-rw-r--r-- 1 oracle oinstall 13972 Nov 1 22:53 bbed_datarecord
-rw-r--r-- 1 oracle oinstall 177 Oct 13 14:06 bbed_list
-rwxr-xr-x 1 oracle oinstall 1651 Nov 1 22:56 bbed_recover
rac1-> ./bbed_datarecord
ksh: ./bbed_datarecord: cannot execute - Permission denied
rac1-> ./bbed_recover
Get the data use bbed:
fileno:4 blockno: 101004
fileno:4 blockno: 101005
format data----------
Format data completed pls check bbed_datarecord file
rac1-> more bbed_datarecord

|88|SYS|DEFROLE$|*NULL*|89|89|TABLE|30-JUN-05|30-JUN-05|2005-06-30|VALID|N|N|N|
|87|SYS|OBJPRIV$|*NULL*|88|88|TABLE|30-JUN-05|30-JUN-05|2005-06-30|VALID|N|N|N|
|86|SYS|SYSAUTH$|*NULL*|87|87|TABLE|30-JUN-05|30-JUN-05|2005-06-30|VALID|N|N|N|
|85|SYS|TRIGGERJAVAM$|*NULL*|86|86|TABLE|30-JUN-05|30-JUN-05|2005-06-30|VALID|N|N|N|
|84|SYS|TRIGGERJAVAC$|*NULL*|85|85|TABLE|30-JUN-05|30-JUN-05|2005-06-30|VALID|N|N|N|
|83|SYS|TRIGGERJAVAS$|*NULL*|84|84|TABLE|30-JUN-05|30-JUN-05|2005-06-30|VALID|N|N|N|
|82|SYS|TRIGGERJAVAF$|*NULL*|83|83|TABLE|30-JUN-05|30-JUN-05|2005-06-30|VALID|N|N|N|
|81|SYS|TRIGGERCOL$|*NULL*|82|82|TABLE|30-JUN-05|30-JUN-05|2005-06-30|VALID|N|N|N|
|80|SYS|TRIGGER$|*NULL*|81|81|TABLE|30-JUN-05|30-JUN-05|2005-06-30|VALID|N|N|N|
|79|SYS|SETTINGS$|*NULL*|80|80|TABLE|30-JUN-05|30-JUN-05|2005-06-30|VALID|N|N|N|
|78|SYS|ERROR$|*NULL*|79|79|TABLE|30-JUN-05|30-JUN-05|2005-06-30|VALID|N|N|N|
|77|SYS|JAVAOBJ$|*NULL*|78|78|TABLE|30-JUN-05|30-JUN-05|2005-06-30|VALID|N|N|N|
|76|SYS|DIR$|*NULL*|77|77|TABLE|30-JUN-05|30-JUN-05|2005-06-30|VALID|N|N|N|
|75|SYS|IDL_SB4$|*NULL*|76|76|TABLE|30-JUN-05|30-JUN-05|2005-06-30|VALID|N|N|N|
--file package downland address
http://imlihj2007.itpub.net/resource/34710/31498

select CASE DATA_TYPE
WHEN 'NUMBER' THEN 'n'
WHEN 'DATE' THEN 't'
when 'VARCHAR2' then 'c'
else 'c'
end case
from user_tab_columns
where table_name = 'TEST000'

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9879835/viewspace-1056092/,如需轉載,請註明出處,否則將追究法律責任。

相關文章