设为首页 加入收藏

TOP

Oracle RMAN实现“一键式”表空间TSPITR(二)
2015-11-10 12:17:39 来源: 作者: 【 】 浏览:17
Tags:Oracle RMAN 实现 空间 TSPITR
ence# from v$log where status='CURRENT';


? ? GROUP#? SEQUENCE#


---------- ----------


? ? ? ? 3? ? ? ? 19


误删除发生


SQL> drop table test.emp;


Table dropped


SQL> drop table test.dept;


Table dropped


--Flashback Drop的机会也没有了。


SQL> purge dba_recyclebin;


Done


3、RMAN进行表空间TSPITR


单表表空间移动,要确保表空间内容“内包”,也就是不会有其他表空间牵扯其中。这个操作我们在可移动表空间的演示中也会进行。


SQL>? exec dbms_tts.transport_set_check('testtbl',true);


PL/SQL procedure successfully completed


SQL> select * from transport_set_violations;


VIOLATIONS


--------------------------------------------------------------------------------


下面进行实际恢复操作,首先需要在目录中创建出一个可访问的空间,进行临时文件容纳。


[root@SimpleLinux ~]# cd /


[root@SimpleLinux /]# mkdir -p /extend/oradata/aux


[root@SimpleLinux /]# chown -R oracle:oinstall /extend/


[root@SimpleLinux /]# ls -l | grep extend


drwxr-xr-x.? 3 oracle oinstall? 4096 Jun 18 10:21 extend


启动RMAN,登录后执行recover tablespace操作,指定出恢复时间。注意:RMAN的recover tablespace命令本质上是执行一系列的指令脚本,将利用RMAN恢复过程自动化,无需人工介入。


[oracle@SimpleLinux ~]$ rman nocatalog


Recovery Manager: Release 11.2.0.4.0 - Production on Thu Jun 18 13:48:44 2015


Copyright (c) 1982, 2011, Oracle and/or its affiliates.? All rights reserved.


RMAN> connect target /


connected to target database: ORA11G (DBID=4239941846)


using target database control file instead of recovery catalog


RMAN>? recover tablespace testtbl until time "to_date('2015-06-18 10:51:19','yyyy-mm-dd hh24:mi:ss')" auxiliary destination '/extend/oradata/aux';


Starting recover at 18-JUN-15


allocated channel: ORA_DISK_1


channel ORA_DISK_1: SID=44 device type=DISK


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='DDfe' –在目录中创建出一个虚拟的Oracle实例


--启动实例的参数都准备好了。


initialization parameters used for automatic instance:


db_name=ORA11G


db_unique_name=DDfe_tspitr_ORA11G


compatible=11.2.0.4.0


db_block_size=8192


db_files=200


sga_target=1G


processes=80


db_create_file_dest=/extend/oradata/aux


log_archive_dest_1='location=/extend/oradata/aux'


#No auxiliary parameter file used


starting up automatic instance ORA11G


Oracle instance started


Total System Global Area? ? 1071333376 bytes


Fixed Size? ? ? ? ? ? ? ? ? ? 1369420 bytes


Variable Size? ? ? ? ? ? ? ? 281021108 bytes


Database Buffers? ? ? ? ? ? 784334848 bytes


Redo Buffers? ? ? ? ? ? ? ? ? 4608000 bytes


Automatic instance created


--自包检查


Running TRANSPORT_SET_CHECK on recovery set tablespaces


TRANSPORT_SET_CHECK completed successfully


--第一块脚本片段,利用备份集合和归档日志,恢复数据到虚拟实例上。


contents of Memory Script:


{


# set requested point in time


set until? time "to_date('2015-06-18 10:51:19','yyyy-mm-dd hh24:mi:ss')";


# restore the controlfile


restore clone controlfile;


# mount the controlfile


sql clone 'alter database mount clone database';


# archive current online log?


sql 'alter system archive log current';


# avoid unnecessary autobackups for structural changes during TSPITR


sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;';


}


executing Memory Script


executing command: SET until clause


Starting restore at 18-JUN-15


allocated channel: ORA_AUX_DISK_1


channel ORA_AUX_DISK_1: SID=19 device type=DISK


channel ORA_AUX_DISK_1: starting datafile backup set restore


channel ORA_AUX_DISK_1: restoring control file


channel ORA_AUX_DISK_1: reading from backup piece /u01/app/fast_recovery_area/ORA11G/

首页 上一页 1 2 3 4 5 6 下一页 尾页 2/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇使用Linux Strace跟踪调试Oracle.. 下一篇使用Flashback Database进行数据..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: