mysql數(shù)據(jù)庫(kù)恢復(fù)到某個(gè)時(shí)間 如何備份特定時(shí)間段的數(shù)據(jù)?
如何備份特定時(shí)間段的數(shù)據(jù)?1 如果數(shù)據(jù)量特別小可以嘗試用spool命令SQL> spool /home/oracle/cc.txtSQL> select * from tables wher
如何備份特定時(shí)間段的數(shù)據(jù)?
1 如果數(shù)據(jù)量特別小可以嘗試用spool命令SQL> spool /home/oracle/cc.txtSQL> select * from tables where time between 20150101 and 20150102SQL> spool off2 如果數(shù)據(jù)庫(kù)版本高于9i,并且查詢數(shù)據(jù)庫(kù)小,時(shí)間段是最近的可以嘗試閃回查詢SQL> select * from tables as of timestamp (systimestamp - interval "10" minute)3 可以通過(guò)閃回?cái)?shù)據(jù)庫(kù),閃回到你要的時(shí)間點(diǎn),然后在備份4 可以通過(guò)exp或expdp的query參數(shù)
oracle數(shù)據(jù)表恢復(fù)到某個(gè)時(shí)間點(diǎn)?
如果開啟閃回可以使用閃回表。select log_mode,flashback_on from v$database如果是下面結(jié)果則開了閃回LOG_MODE FLASHBACK_ON------------ ------------------ARCHIVELOG YES可以執(zhí)行以下命令alter table 表名 enable row movement --開啟表行移動(dòng)flashback table 表名 to timestamp to_timestamp("20130813 14:00:00","yyyymmdd hh24:mi:ss")--閃回到2013年8月13日14點(diǎn)你要是沒開啟,有邏輯備份可以使用imp命令導(dǎo)入數(shù)據(jù)。如果沒用邏輯備份,開啟歸檔模式,有物理備份,能夠停機(jī)、數(shù)據(jù)丟失的話,可以采用不完全恢復(fù)用rman登陸rman target /執(zhí)行以下命令run{shutdown immediatestartup mountset until time = "to_date("20130813 14:00:00","yyyymmdd hh24:mi:ss")"restore databaserecover databasealter database open resetlogs}切記!做以上任何操作前做好備份,否則出了問(wèn)題后悔莫及。而且建議你聯(lián)系你們數(shù)據(jù)庫(kù)管理員處理這個(gè)問(wèn)題。
oracle中如何查詢已刪除記錄?
Oracle中可以用flashback的辦法恢復(fù)已經(jīng)刪除的數(shù)據(jù)。Flashback用法匯總 :A.flashback database 閃回?cái)?shù)據(jù)庫(kù),簡(jiǎn)單理解就是把數(shù)據(jù)庫(kù)閃回到某個(gè)以前的時(shí)間點(diǎn),能恢復(fù)到的最早的SCN, 取決與Flashback Log中記錄的最早SCNB.flashback drop 回收數(shù)據(jù)庫(kù)表,用于表誤drop后恢復(fù)。類似Windows的回收站。C.flashback query 閃回表記錄,用于數(shù)據(jù)表記錄的恢復(fù)D.falshabck Table 閃回?cái)?shù)據(jù)庫(kù)表,