Oracle12c多租戶資料庫備份與恢復 - 線上單獨恢復table 1

tolywang發表於2014-03-11

12c及之前,我們可以透過flashback或TSPITR進行恢復,12c中可以線上恢復table .

Prior to recovering a table or table partition, you must perform a full backup of undo,
SYSTEM, SYSAUX, SYSEXT (if the SYSEXT tablespace exists in your database) and the tablespace
that contains the table or table partition.

這裡我們對整個CDB及所有PDB進行備份 。
SQL> alter session set container=plugdb ;
Session altered.

SQL> select to_char(dbms_flashback.get_system_change_number) CURRENT_SCN, to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') CURRENT_TIME FROM DUAL;

CURRENT_SCN                              CURRENT_TIME
---------------------------------------- -------------------
12138230128883                           2014-03-07 12:02:23


SQL> select  count(1) from  hw.HW_PAY_GROUP_LOG ;

  COUNT(1)
----------
    330458


備份CDB和所有PDBs :
rman   target    / 
RMAN> backup incremental level 0 database format '/data01/tmp/fullbak2/backup_%d%T%s.bak' plus archivelog format '/data01/tmp/fullbak2/arc_%d%T%s.bak';


假設不小心刪除掉了表中的多筆記錄
SQL> alter session set container=plugdb ;
Session altered.
SQL> show con_name
CON_NAME
------------------------------
PLUGDB
SQL> select  count(1) from  hw.HW_PAY_GROUP_LOG ;
  COUNT(1)
----------
    330438
SQL>


檢視12c目標資料庫處於歸檔模式 
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /data01/oracle12c/oradata/test12/arch
Oldest online log sequence     3
Next log sequence to archive   5
Current log sequence           5

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

相關文章