ORACLE12C使用RMAN進(jìn)行表恢復(fù)


     在12C以前的版本中rman可以進(jìn)行db,tablespace,datafile,block級(jí)別和TSPITR的恢復(fù),12C引入了table級(jí)別的恢復(fù)
在沒(méi)有打開(kāi)flashback的時(shí)候可以進(jìn)行單個(gè)表的恢復(fù).
 
例,創(chuàng)建表

創(chuàng)新互聯(lián)是一家專業(yè)的成都網(wǎng)站建設(shè)公司,我們專注做網(wǎng)站、網(wǎng)站制作、網(wǎng)絡(luò)營(yíng)銷、企業(yè)網(wǎng)站建設(shè),賣友情鏈接,廣告投放為企業(yè)客戶提供一站式建站解決方案,能帶給客戶新的互聯(lián)網(wǎng)理念。從網(wǎng)站結(jié)構(gòu)的規(guī)劃UI設(shè)計(jì)到用戶體驗(yàn)提高,創(chuàng)新互聯(lián)力求做到盡善盡美。


SQL>  alter session set container=pdb2;

Session altered.

SQL> create table frank.t1 as select * from dba_tables;

Table created.


備份數(shù)據(jù)庫(kù)

RMAN> backup database;

Starting backup at 16-JAN-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=265 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00003 name=/u01/app/oracle/oradata/c12/sysaux01.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/c12/system01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/c12/undotbs01.dbf
input datafile file number=00038 name=/home/oracle/t1.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/c12/users01.dbf
input datafile file number=00014 name=/u01/app/oracle/product/12.1.0/db_1/dbs/test

....................

查詢當(dāng)前數(shù)據(jù)庫(kù)的scn號(hào)

SQL> select current_scn from v$database;

CURRENT_SCN
-----------
    4898443


SQL> drop table frank.t1;

 


[oracle@o12c ~]$ mkdir /home/oracle/abc


RMAN> recover table frank.t1 of pluggable database pdb2
2>  until scn 4898443
3>  auxiliary destination '/home/oracle/abc'
4>   datapump destination '/home/oracle/abc';

Starting recover at 16-JAN-14
using channel ORA_DISK_1
RMAN-05026: WARNING: presuming following set of tablespaces applies to specified Point-in-Time

List of tablespaces expected to have UNDO segments
Tablespace SYSTEM
Tablespace UNDOTBS1

Creating automatic instance, with SID='vewD'

initialization parameters used for automatic instance:
db_name=C12
db_unique_name=vewD_pitr_pdb2_C12
compatible=12.1.0.0.0
db_block_size=8192
db_files=200
sga_target=1G
processes=80
diagnostic_dest=/u01/app/oracle
db_create_file_dest=/home/oracle/abc
log_archive_dest_1='location=/home/oracle/abc'
enable_pluggable_database=true
_clone_one_pdb_recovery=true
#No auxiliary parameter file used


starting up automatic instance C12

Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2296576 bytes
Variable Size                281019648 bytes
Database Buffers             780140544 bytes
Redo Buffers                   5480448 bytes
Automatic instance created

contents of Memory Script:

..............................................................


也是會(huì)新建一個(gè)auxiliary  instance,然后在auxiliary instance上做全庫(kù)恢復(fù)再通過(guò)datapump工具導(dǎo)出和導(dǎo)入
整個(gè)過(guò)程和TSPITR極為相似.

恢復(fù)成功再次查詢


SQL> select count(*) from frank.t1;

  COUNT(*)
----------
        2318

注意common user引用表的名稱為 "c##frank".t1,而不是"c##frank.t1",否則會(huì)報(bào)以下錯(cuò)誤
RMAN> recover table "c##frank.t1" until scn 4894140 auxiliary destination '/home/oracle/abc' datapump destination '/home/oracle/abc';

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "until": expecting one of: "dot"
RMAN-01007: at line 1 column 29 file: standard input

 

新聞標(biāo)題:ORACLE12C使用RMAN進(jìn)行表恢復(fù)
分享網(wǎng)址:http://muchs.cn/article34/pdjjpe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站營(yíng)銷、企業(yè)網(wǎng)站制作、品牌網(wǎng)站設(shè)計(jì)移動(dòng)網(wǎng)站建設(shè)、App設(shè)計(jì)、動(dòng)態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)公司