码迷,mamicode.com
首页 > 数据库 > 详细

RMAN-catalog备份及恢复数据库

时间:2014-10-08 02:35:54      阅读:389      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   color   io   使用   ar   for   strong   

1、Set Up a Recovery Catalog and Target Database
Setting up a recovery catalog is a very simple process. This can be done through the Enterprise Manager GUI or through some simple commands in SQL*Plus and the RMAN command-line interface. In SQL*Plus, all you need to do is to create a tablespace to store the catalog data in, create an RMAN user, and then grant the  recovery_catalog_owner role to the RMAN user. In RMAN, run the  create     catalogstatement:  (以sys连接到rman实例,创建数据表空间,创建rcat用户并授权)                                    

SQL> conn sys/rman@rman as sysdba;--需要创建一个新的实例rman,并使用sys用户连接到rman
已连接。
SQL> create tablespace rcatts datafile D:\rman\rman_data\rcatts.dbf size 1024M;

表空间已创建。

SQL> create user rcat identified by rcat temporary tablespace temp
  2     default tablespace rcatts quota unlimited on rcatts;

用户已创建。

SQL> grant connect, resource, recovery_catalog_owner to rcat;

授权成功。

SQL> exit
从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断开

C:\Users\Administrator>

2、In the RMAN command-line interface, log in and create the catalog:

(使用上一步创建的rcat用户登录并创建恢复目录)

C:\Users\Administrator>rman catalog=rcat/rcat@rman;

恢复管理器: Release 11.2.0.1.0 - Production on 星期二 10月 7 23:52:05 2014

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

连接到恢复目录数据库

RMAN> create catalog;

恢复目录已创建

RMAN>

3、把目标数据库注册到恢复目录catalog中

Now you need to register the target database in the catalog. To do this, connect to the target and the catalog database and then register the target database in the catalog. This can be done from either location. The target connection must have a user ID with sysdba privileges, so an Oracle password file must be created using the orapwd utility. As described in Chapter 3, you also need to create the Oracle networking configuration using tnsnames or an equivalent for both the target and recovery catalog instances:

RMAN> connect catalog rcat/rcat@rman;--连接到恢复目录数据库

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-06167: 已经连接

RMAN> connect target rusky/rusky@orcl;--连接目标数据库orcl,用户为rusky,密码为rusky

连接到目标数据库: ORCL (DBID=1385990360)

RMAN> register database;

注册在恢复目录中的数据库
正在启动全部恢复目录的 resync
完成全部 resync

RMAN>

4、It’s now time to back up your entire database

....

RMAN-catalog备份及恢复数据库

标签:des   style   blog   color   io   使用   ar   for   strong   

原文地址:http://www.cnblogs.com/rusking/p/4010341.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!