暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片
单表数据恢复(在源库主机上利用rman备份恢复出一个新实例)
1216
12页
6次
2020-06-04
25墨值下载
利用 rman 备份恢复某张误操作表的数据,以下操作均在虚拟机下完成,生产请慎重操作!
一、准备工作
1.操作系统版本:
[oracle@primary ~]$ uname -a
Linux primary 2.6.32-431.el6.x86_64 #1 SMP Wed Nov 20 23:56:07 PST 2013 x86_64
x86_64 x86_64 GNU/Linux
2.数据库版本:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
3.测试用户及测试数据:
SQL> conn scott/tiger
Connected.
SQL> create table test as select * from (select * from dba_users where
rownum<=10);
Table created.
SQL> select count(*) from test;
COUNT(*)
----------
10
SQL> select CURRENT_SCN from v$database;
CURRENT_SCN
-----------
1152066
4.数据库全备
[oracle@primary ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Thu Jun 4 15:47:15 2020
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: PROD (DBID=432969167)
RMAN> backup database;
Starting backup at 04-JUN-20
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=36 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=00001 name=/u01/app/oracle/oradata/PROD/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/PROD/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/PROD/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/PROD/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/PROD/users01.dbf
channel ORA_DISK_1: starting piece 1 at 04-JUN-20
channel ORA_DISK_1: finished piece 1 at 04-JUN-20
piece
handle=/u01/app/oracle/fast_recovery_area/PROD/backupset/2020_06_04/o1_mf_nnndf_
TAG20200604T154719_hfk9r82w_.bkp tag=TAG20200604T154719 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 04-JUN-20
channel ORA_DISK_1: finished piece 1 at 04-JUN-20
piece
handle=/u01/app/oracle/fast_recovery_area/PROD/backupset/2020_06_04/o1_mf_ncsnf_
TAG20200604T154719_hfk9rj5s_.bkp tag=TAG20200604T154719 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 04-JUN-20
5.模拟误操作
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> /
System altered.
SQL> /
System altered.
SQL> conn scott/tiger
Connected.
SQL> delete from test where username='SCOTT';
1 row deleted.
SQL> commit;
Commit complete.
SQL> conn / as sysdba
Connected.
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> /
System altered.
SQL> select count(*) from test;
COUNT(*)
of 12
25墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

关注
最新上传
暂无内容,敬请期待...
下载排行榜
Top250 周榜 月榜