mysql數(shù)據(jù)庫恢復(fù)到某個時間 如何備份特定時間段的數(shù)據(jù)?
如何備份特定時間段的數(shù)據(jù)?1 如果數(shù)據(jù)量特別小可以嘗試用spool命令SQL> spool /home/oracle/cc.txtSQL> select * from tables wher
如何備份特定時間段的數(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ù)庫版本高于9i,并且查詢數(shù)據(jù)庫小,時間段是最近的可以嘗試閃回查詢SQL> select * from tables as of timestamp (systimestamp - interval "10" minute)3 可以通過閃回數(shù)據(jù)庫,閃回到你要的時間點,然后在備份4 可以通過exp或expdp的query參數(shù)
oracle數(shù)據(jù)表恢復(fù)到某個時間點?
如果開啟閃回可以使用閃回表。select log_mode,flashback_on from v$database如果是下面結(jié)果則開了閃回LOG_MODE FLASHBACK_ON------------ ------------------ARCHIVELOG YES可以執(zhí)行以下命令alter table 表名 enable row movement --開啟表行移動flashback table 表名 to timestamp to_timestamp("20130813 14:00:00","yyyymmdd hh24:mi:ss")--閃回到2013年8月13日14點你要是沒開啟,有邏輯備份可以使用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}切記!做以上任何操作前做好備份,否則出了問題后悔莫及。而且建議你聯(lián)系你們數(shù)據(jù)庫管理員處理這個問題。
oracle中如何查詢已刪除記錄?
Oracle中可以用flashback的辦法恢復(fù)已經(jīng)刪除的數(shù)據(jù)。Flashback用法匯總 :A.flashback database 閃回數(shù)據(jù)庫,簡單理解就是把數(shù)據(jù)庫閃回到某個以前的時間點,能恢復(fù)到的最早的SCN, 取決與Flashback Log中記錄的最早SCNB.flashback drop 回收數(shù)據(jù)庫表,用于表誤drop后恢復(fù)。類似Windows的回收站。C.flashback query 閃回表記錄,用于數(shù)據(jù)表記錄的恢復(fù)D.falshabck Table 閃回數(shù)據(jù)庫表,