中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

ORACLE 12C使用RMAN進行表恢復

發布時間:2020-07-08 11:00:41 來源:網絡 閱讀:691 作者:xiahouyao123 欄目:關系型數據庫



     在12C以前的版本中rman可以進行db,tablespace,datafile,block級別和TSPITR的恢復,12C引入了table級別的恢復
在沒有打開flashback的時候可以進行單個表的恢復.
 
例,創建表


SQL>  alter session set container=pdb2;

Session altered.

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

Table created.


備份數據庫

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

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

查詢當前數據庫的scn號

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:

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


也是會新建一個auxiliary  instance,然后在auxiliary instance上做全庫恢復再通過datapump工具導出和導入
整個過程和TSPITR極為相似.

恢復成功再次查詢


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

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

注意common user引用表的名稱為 "c##frank".t1,而不是"c##frank.t1",否則會報以下錯誤
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

 


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

陈巴尔虎旗| 杂多县| 新乡市| 雅江县| 合肥市| 武威市| 石首市| 库车县| 潍坊市| 越西县| 柏乡县| 江山市| 东兰县| 垫江县| 达州市| 泽州县| 安吉县| 湖州市| 奈曼旗| 葫芦岛市| 泗阳县| 于都县| 红安县| 长兴县| 乌拉特中旗| 铁岭市| 浙江省| 敦煌市| 襄城县| 河津市| 邛崃市| 翁牛特旗| 普洱| 永顺县| 宝鸡市| 六安市| 莫力| 连城县| 延川县| 乡宁县| 龙山县|