我的编程空间,编程开发者的网络收藏夹
学习永远不晚

揭秘ORACLE备份之----RMAN之五(CATALOG)

短信预约 -IT技能 免费直播动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

揭秘ORACLE备份之----RMAN之五(CATALOG)

[root@rhel5 ~]# su - oracle
[oracle@rhel5 ~]$ rman catalog scott/tiger@wailon

Recovery Manager: Release 10.2.0.5.0 - Production on Thu Sep 5 04:20:38 2013

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to recovery catalog database

RMAN> create catalog;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-06426: RECOVERY_CATALOG_OWNER role must be granted to user SCOTT

RMAN> -- catalog管理用户必须要有RECOVERY_CATALOG_OWNER角色
RMAN> exit


Recovery Manager complete.
[oracle@rhel5 ~]$ sqlplus / as sysdba

SQL> grant recovery_catalog_owner to scott;

Grant succeeded.


 -- 授权后再次创建CATALOG
[oracle@rhel5 ~]$ rman catalog scott/tiger@wailon

RMAN> create catalog;

recovery catalog created


-- 创建CATALOG管理用户
[oracle@rhel5 ~]$ sqlplus / as sysdba

SQL> create user rman identified by rman;

User created.

SQL> grant recovery_catalog_owner to rman;

Grant succeeded.

SQL> alter user rman  quota 100m on user01;

User altered.

SQL> grant connect,resource to rman;

Grant succeeded.


 [oracle@rhel5 ~]$ rman catalog scott/tiger@wailon

RMAN> --删除catalog
RMAN> drop catalog;

recovery catalog owner is SCOTT
enter DROP CATALOG command again to confirm catalog removal

RMAN> drop catalog;

recovery catalog dropped


-- 建立RMAN用户管理的CATALOG
 [oracle@rhel5 ~]$ rman catalog rman/rman@wailon

RMAN> create catalog;

recovery catalog created


-- RMAN用户生成了CATALOG管理的相关对象
 [oracle@rhel5 ~]$ sqlplus rman/rman

SQL*Plus: Release 10.2.0.5.0 - Production on Thu Sep 5 04:26:46 2013

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from tab;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
RC_BACKUP_SET_SUMMARY          VIEW
RC_BACKUP_DATAFILE_SUMMARY     VIEW
RC_BACKUP_CONTROLFILE_SUMMARY  VIEW
RC_BACKUP_ARCHIVELOG_SUMMARY   VIEW
RC_BACKUP_SPFILE_SUMMARY       VIEW
RC_BACKUP_COPY_SUMMARY         VIEW
RC_PROXY_COPY_SUMMARY          VIEW
RC_PROXY_ARCHIVELOG_SUMMARY    VIEW
RC_UNUSABLE_BACKUPFILE_DETAILS VIEW
RC_RMAN_BACKUP_TYPE            VIEW
XAL                            TABLE
RSR                            TABLE
FB                             TABLE
GRSP                           TABLE
RC_DATABASE                    VIEW
RC_DATABASE_INCARNATION        VIEW
RC_RESYNC                      VIEW
RC_CHECKPOINT                  VIEW
RC_TABLESPACE                  VIEW
RC_DATAFILE                    VIEW
RC_TEMPFILE                    VIEW
RC_REDO_THREAD                 VIEW
RC_REDO_LOG                    VIEW
RC_LOG_HISTORY                 VIEW
RC_ARCHIVED_LOG                VIEW
RC_BACKUP_SET                  VIEW
RC_BACKUP_PIECE                VIEW
RC_BACKUP_DATAFILE             VIEW
RC_BACKUP_CONTROLFILE          VIEW
RC_BACKUP_SPFILE               VIEW
RC_DATAFILE_COPY               VIEW
RC_CONTROLFILE_COPY            VIEW
RC_BACKUP_REDOLOG              VIEW
RC_BACKUP_CORRUPTION           VIEW
RC_COPY_CORRUPTION             VIEW
RC_OFFLINE_RANGE               VIEW
RC_STORED_SCRIPT               VIEW
RC_STORED_SCRIPT_LINE          VIEW
RC_PROXY_DATAFILE              VIEW
RC_PROXY_CONTROLFILE           VIEW
RC_RMAN_CONFIGURATION          VIEW
RC_DATABASE_BLOCK_CORRUPTION   VIEW
RC_PROXY_ARCHIVEDLOG           VIEW
RC_RMAN_STATUS                 VIEW
ROUT                           TABLE
RC_RMAN_OUTPUT                 VIEW
RCVER                          TABLE
RC_BACKUP_FILES                VIEW
RC_RMAN_BACKUP_SUBJOB_DETAILS  VIEW
RC_RMAN_BACKUP_JOB_DETAILS     VIEW
RC_BACKUP_SET_DETAILS          VIEW
RC_BACKUP_PIECE_DETAILS        VIEW
RC_BACKUP_COPY_DETAILS         VIEW
RC_PROXY_COPY_DETAILS          VIEW
RC_PROXY_ARCHIVELOG_DETAILS    VIEW
RC_BACKUP_DATAFILE_DETAILS     VIEW
RC_BACKUP_CONTROLFILE_DETAILS  VIEW
RC_BACKUP_ARCHIVELOG_DETAILS   VIEW
RC_BACKUP_SPFILE_DETAILS       VIEW
DB                             TABLE
NODE                           TABLE
CONF                           TABLE
DBINC                          TABLE
CKP                            TABLE
TS                             TABLE
TSATT                          TABLE
DF                             TABLE
DFATT                          TABLE
TF                             TABLE
TFATT                          TABLE
OFFR                           TABLE
RR                             TABLE
RT                             TABLE
ORL                            TABLE
RLH                            TABLE
AL                             TABLE
BS                             TABLE
BP                             TABLE
BCF                            TABLE
CCF                            TABLE
XCF                            TABLE
BSF                            TABLE
BDF                            TABLE
CDF                            TABLE
XDF                            TABLE
BRL                            TABLE
BCB                            TABLE
CCB                            TABLE
SCR                            TABLE
SCRL                           TABLE
CONFIG                         TABLE

91 rows selected.


-- 将目标库注册为CATALOG管理
[oracle@rhel5 ~]$ rman target / catalog rman/rman@wailon

Recovery Manager: Release 10.2.0.5.0 - Production on Thu Sep 5 04:27:09 2013

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: WAILON (DBID=2747751647)
connected to recovery catalog database

RMAN> --注册catalog
RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

-- 使用CATALOG管理后可以建立RMAN管理的备份脚本

RMAN> create script full_backup
2> {
3> backup database;
4> delete obsolete;
5> }


-- 执行备份脚本

RMAN> run {execute script full_backup;}

executing script: full_backup

Starting backup at 05-SEP-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=21 devtype=DISK
channel ORA_DISK_1: starting compressed full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/wailon/system01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/wailon/sysaux01.dbf
input datafile fno=00002 name=/u01/app/oradata/wailon/untotbs01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/wailon/user01.dbf
channel ORA_DISK_1: starting piece 1 at 05-SEP-13
channel ORA_DISK_1: finished piece 1 at 05-SEP-13
piece handle=/u01/app/flash_recovery_area/0coj2dmt_1_1.bkp tag=TAG20130905T042812 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting compressed full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 05-SEP-13
channel ORA_DISK_1: finished piece 1 at 05-SEP-13
piece handle=/u01/app/flash_recovery_area/0doj2dnc_1_1.bkp tag=TAG20130905T042812 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 05-SEP-13

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03015: error occurred in stored script full_backup
RMAN-03002: failure of delete command at 09/05/2013 04:28:31
RMAN-06525: RMAN retention policy is set to none

-- 查看备份脚本

RMAN> print script full_backup;

printing stored script: full_backup
 {backup database;
delete obsolete;
}

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

揭秘ORACLE备份之----RMAN之五(CATALOG)

下载Word文档到电脑,方便收藏和打印~

下载Word文档

猜你喜欢

编程热搜

  • Python 学习之路 - Python
    一、安装Python34Windows在Python官网(https://www.python.org/downloads/)下载安装包并安装。Python的默认安装路径是:C:\Python34配置环境变量:【右键计算机】--》【属性】-
    Python 学习之路 - Python
  • chatgpt的中文全称是什么
    chatgpt的中文全称是生成型预训练变换模型。ChatGPT是什么ChatGPT是美国人工智能研究实验室OpenAI开发的一种全新聊天机器人模型,它能够通过学习和理解人类的语言来进行对话,还能根据聊天的上下文进行互动,并协助人类完成一系列
    chatgpt的中文全称是什么
  • C/C++中extern函数使用详解
  • C/C++可变参数的使用
    可变参数的使用方法远远不止以下几种,不过在C,C++中使用可变参数时要小心,在使用printf()等函数时传入的参数个数一定不能比前面的格式化字符串中的’%’符号个数少,否则会产生访问越界,运气不好的话还会导致程序崩溃
    C/C++可变参数的使用
  • css样式文件该放在哪里
  • php中数组下标必须是连续的吗
  • Python 3 教程
    Python 3 教程 Python 的 3.0 版本,常被称为 Python 3000,或简称 Py3k。相对于 Python 的早期版本,这是一个较大的升级。为了不带入过多的累赘,Python 3.0 在设计的时候没有考虑向下兼容。 Python
    Python 3 教程
  • Python pip包管理
    一、前言    在Python中, 安装第三方模块是通过 setuptools 这个工具完成的。 Python有两个封装了 setuptools的包管理工具: easy_install  和  pip , 目前官方推荐使用 pip。    
    Python pip包管理
  • ubuntu如何重新编译内核
  • 改善Java代码之慎用java动态编译

目录