rman 使用catalog备份的演示
介绍了如何使用catalog方式做RMAN备份,以及如何取消以catalog方式做备份。
第一步:创建RMAN CATALOG表空间及用户。
[oracle@oel-01 ~]$ sqlplus / as sysdba
SQL> create tablespace catalog1 datafile '/u01/app/oracle/oradata/bys001/catalog1.dbf' size 50m ;
Tablespace created.
SQL> create user rmanuser identified by rmanuser default tablespace catalog1;
User created.
SQL> grant connect,resource,recovery_catalog_owner to rmanuser;
Grant succeeded.
SQL> select * from role_sys_privs where role='RECOVERY_CATALOG_OWNER';
ROLE PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
RECOVERY_CATALOG_OWNER CREATE SYNONYM NO
RECOVERY_CATALOG_OWNER CREATE CLUSTER NO
RECOVERY_CATALOG_OWNER ALTER SESSION NO
RECOVERY_CATALOG_OWNER CREATE DATABASE LINK NO
RECOVERY_CATALOG_OWNER CREATE SESSION NO
RECOVERY_CATALOG_OWNER CREATE TABLE NO
RECOVERY_CATALOG_OWNER CREATE SEQUENCE NO
RECOVERY_CATALOG_OWNER CREATE PROCEDURE NO
RECOVERY_CATALOG_OWNER CREATE VIEW NO
RECOVERY_CATALOG_OWNER CREATE TYPE NO
RECOVERY_CATALOG_OWNER CREATE TRIGGER NO
11 rows selected.
第二步:注册数据库到RMAN CATALOG
[oracle@oel-01 ~]$ rman target
sys/sys@192.168.1.212:1521/bys001 catalog rmanuser/rmanuser
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Jun 19 14:28:59 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: BYS001 (DBID=2041679290)
connected to recovery catalog database
RMAN>
register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
第三步:查看是否注册
SQL> conn rmanuser/rmanuser
Connected.
SQL> select * from rc_database;
DB_KEY DBINC_KEY DBID NAME RESETLOGS_CHANGE# RESETLOGS
---------- ---------- ---------- -------- ----------------- ---------
2 4 2041679290 BYS001 1143629 16-JUN-13
第四步:到RMAN中执行全备备份
[oracle@oel-01 ~]$ rman target
sys/sys@192.168.1.212:1521/bys001
catalog rmanuser/rmanuser
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Jun 19 14:28:59 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: BYS001 (DBID=2041679290)
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN> backup database;
Starting backup at 19-JUN-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=38 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/bys001/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/bys001/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/bys001/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/bys001/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/bys001/catalog1.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/bys001/users01.dbf
channel ORA_DISK_1: starting piece 1 at 19-JUN-13
channel ORA_DISK_1: finished piece 1 at 19-JUN-13
piece handle=/u01/app/oracle/flash_recovery_area/BYS001/backupset/2013_06_19/o1_mf_nnndf_TAG20130619T143220_8w2n3r2o_.bkp tag=TAG20130619T143220 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:12:38
Finished backup at 19-JUN-13
Starting Control File and SPFILE Autobackup at 19-JUN-13
piece handle=/backup/ctl_c-2041679290-20130619-08 comment=NONE
Finished Control File and SPFILE Autobackup at 19-JUN-13
第五步:取消使用CATALOG备份
这是使用list backup 查出来的信息,信息太多,只截了此次使用CATALOG备份的两个备份集。
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
545 Full 1.13G DISK 00:12:34 19-JUN-13
BP Key: 548 Status: AVAILABLE Compressed: NO Tag: TAG20130619T143220
Piece Name: /u01/app/oracle/flash_recovery_area/BYS001/backupset/2013_06_19/o1_mf_nnndf_TAG20130619T143220_8w2n3r2o_.bkp
List of Datafiles in backup set 545
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 1305626 19-JUN-13 /u01/app/oracle/oradata/bys001/system01.dbf
2 Full 1305626 19-JUN-13 /u01/app/oracle/oradata/bys001/sysaux01.dbf
3 Full 1305626 19-JUN-13 /u01/app/oracle/oradata/bys001/undotbs01.dbf
4 Full 1305626 19-JUN-13 /u01/app/oracle/oradata/bys001/users01.dbf
5 Full 1305626 19-JUN-13 /u01/app/oracle/oradata/bys001/example01.dbf
6 Full 1305626 19-JUN-13 /u01/app/oracle/oradata/bys001/catalog1.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
559 Full 9.52M DISK 00:00:01 19-JUN-13
BP Key: 566 Status: AVAILABLE Compressed: NO Tag: TAG20130619T144500
Piece Name: /backup/ctl_c-2041679290-20130619-08
SPFILE Included: Modification time: 19-JUN-13
SPFILE db_unique_name: BYS001
Control File Included: Ckp SCN: 1306060 Ckp time: 19-JUN-13
RMAN> unregister database; 取消当前登陆的数据库注册到catalog
database name is "BYS001" and DBID is 2041679290
Do you really want to unregister the database (enter YES or NO)? y
database unregistered from the recovery catalog
RMAN> list backup;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of list command at 06/19/2013 15:15:22
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog
RMAN> exit
Recovery Manager complete.
报错是因为登陆时是以指定catalog方式登陆,退出重新查询就可以了。
在SQLPLUS中查询
SQL> conn rmanuser/rmanuser
Connected.
SQL> select * from rc_database;
DB_KEY DBINC_KEY DBID NAME RESETLOGS_CHANGE# RESETLOGS
---------- ---------- ---------- -------- ----------------- ---------
2 4 2041679290 BYS001 1143629 16-JUN-13
SQL> select * from rc_database;
no rows selected
第六步:重新登陆RMAN查看备份集信息:
[oracle@oel-01 ~]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Jun 19 15:15:48 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: BYS001 (DBID=2041679290)
RMAN> list backup;
using target database control file instead of recovery catalog
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
81 Full 9.52M DISK 00:00:03 19-JUN-13
BP Key: 81 Status: AVAILABLE Compressed: NO Tag: TAG20130619T110902
Piece Name: /backup/ctl_c-2041679290-20130619-02
SPFILE Included: Modification time: 18-JUN-13
SPFILE db_unique_name: BYS001
Control File Included: Ckp SCN: 1277256 Ckp time: 19-JUN-13
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
82 32.50K DISK 00:00:00 19-JUN-13
BP Key: 82 Status: AVAILABLE Compressed: NO Tag: BYS001-1
Piece Name: /backup/full/bys001arch_BYS001_818507657_87
rman 使用catalog备份的演示的更多相关文章
- catalog备份数据库及RMAN存储脚本
环境说明: 提前配置好两个库的监听与tnsnames.oraIP:10.100.25.13 为目标数据库 IP:10.100.25.14 为恢复目录数据库(catalog database) 以下操 ...
- 中小型数据库 RMAN CATALOG 备份恢复方案(二)
中小型数据库呈现的是数据库并发少,数据库容量小,版本功能受限以及N多单实例等特点.尽管如此,数据库的损失程度也会存在零丢失的情形.企业不愿意花太多的钱又要保证数据库的可靠稳定,可是苦煞了我这些搞DB的 ...
- RMAN完整全备份
1.以CATALOG模式连接到目标数据库和恢复目录(如:目标数据库为ORCL) C:\Users\Administrator>RMAN TARGET / CATALOG RMANCT/RMANC ...
- 如何通过rman的增量备份恢复dataguard中standby端的数据
很多正在使用dataguard的客户,都会遇到一个棘手的问题: 在备份端与主库同步的过程中由于网络原因或磁盘问题导致一个或多个归档日志丢失,进而dataguard同步无法继续.很多客户都选择了重新全库 ...
- RMAN Recovery Catalog
RMAN用来存放数据库元数据的schema. the catalog includes the following types of metadata:-Data file and archived ...
- 【转】RMAN删除过期备份或非过期备份
(一)删除备份--DELETE命令用于删除RMAN备份记录及相应的物理文件.当使用RMAN执行备份操作时,会在RMAN资料库(RMAN Repository)中生成RMAN备份记录,默认情况下RMAN ...
- 【原创】rman 全库备份脚本
rman 全库备份脚本 run { allocate channel d1 type disk; allocate channel d2 type disk; backup full database ...
- Oracle的Rman差异增量备份
所谓增量备份,顾名思义即是每次备份操作那些发生了"变化"的数据块.在RMAN增量备份中有两种:Differential(差异备份)和Cumulative(增量备份)方式.由于需求这 ...
- 1.6 NBU Catalog备份还原
用户的数据保存到了磁盘或者磁带中,并且是安全的,NBU所在的机器还有可能发生故障,需要重新安装或者将NBU部署到其他的机器中继续使用. 在这种情况下,如何让NBU知道用户已经存在的备份策略和存储单元配 ...
随机推荐
- Struts学习之自定义拦截器
* 所有的拦截器都需要实现Interceptor接口或者继承Interceptor接口的扩展实现类 * 要重写init().intercept().destroy()方法 * in ...
- Python 错误和异常
1.Python异常类 Python是面向对象语言,所以程序抛出的异常也是类.常见的Python异常有以下几个,大家只要大致扫一眼,有个映像,等到编程的时候,相信大家肯定会不只一次跟他们照面(除非你不 ...
- Fedora 19下Guacamole的安装使用
由于我要使用RDP实现web远程桌面,因此需要用到了Guacamole这个开源的软件.之前用Ubuntu12.04折腾了一晚上,也没有找到依赖库文件,而Guacamole的官方安装说明却没有介绍这个依 ...
- 深度探索QT窗口系统(五篇)
窗口作为界面编程中最重要的部分,没有窗口就没有界面,是窗口让我们摆脱了DOS时代,按钮是一个窗口,文本框是一个窗口,标签页是一个窗口,...一个窗口可以由多个窗口组成,每天我们都在与窗口打交道,当你打 ...
- Uber在华从沸点到冰点 搞定这些才能继续走下去
腾讯科技 蒋栩根 5月6日报道 五一前夕,本应坐等笑看小长假带来的喜人业绩的Uber被广州市工商.交委.公安部门的联合检查当头浇了一盆冷水,也被戴上了一顶“涉嫌非法运营”的帽子.而一天前,它才与广物汽 ...
- uva-699 Not so Mobile (杠杆,巧妙递归)
Not so Mobile Before being an ubiquous communications gadget, a mobile was just a structure made ...
- HDU5280 Senior's Array(简单DP)
题目链接:pid=5280">传送门 题意: 给定一个长度为n的序列,和一个改动的值p,必须从原序列中选一个位置改动成p, 求改动后的区间和的最大值. 分析: 枚举位置+最大区间和. ...
- 飘逸的python - 有的升序有的降序的情况下怎么多条件排序
之前在统计导出各区服玩家消费的时候需要进行升序降序混搭的多条件排序. 需求是这样的.区服从小到大排,如果区服相同,则按消费从大到小排. 实现方法是利用python的sort算法是稳定排序,对数据进行多 ...
- HTML5 RPG游戏示例
演示地址 点击打开链接
- Android 开发UI牛博[转]
Android 新兴的UI模式——侧边导航栏 侧边导航栏也就是大家熟知的SliddingMenu,英文也叫Fly-In App Menu.Side Navigation等.当然谷歌现在已经推出类似这个 ...