9I Catalog Configure

ysjxjf發表於2008-02-14

SQL> create tablespace rman datafile 'E:ORACLEORADATATEST003RMAN.DBF' size 1

0M;

表空間已建立。

Create a user and schema for the recovery catalog. For example, enter:

SQL>

SQL> create user rman identified by rman

2 temporary tablespace temp

3 default tablespace rman

4 quota unlimited on rman;

使用者已建立

SQL>

Grant the RECOVERY_CATALOG_OWNER role to the schema owner. This role provides the user with privileges to maintain and query the recovery catalog.

SQL> grant recovery_catalog_owner to rman;

授權成功。

Grant other desired privileges to the RMAN user.

SQL> grant connect , resource to rman;

授權成功。

Creating the Recovery Catalog

After creating the catalog owner, create the catalog itself with the RMAN CREATE CATALOG command.

To create the recovery catalog:

  1. Connect to the database that will contain the catalog as the catalog owner. For example, enter the following from the operating system command line:

2. % rman CATALOG rman/rman@wilian

3.

You can also connect from the RMAN prompt:

% rman

RMAN> CONNECT CATALOG rman/rman@rcat

  1. Run the CREATE CATALOG command to create the catalog. If the catalog tablespace is this user's default tablespace, then you can run this command:

3. CREATE CATALOG;

4.

If the catalog tablespace is not the user's default tablespace, then you must specify it explicitly, as in this example:

# cattbs is not the catalog owner's default tablespace

CREATE CATALOG TABLESPACE cattbs;

Note that the creation of the catalog can take several minutes.

  1. Optionally, start SQL*Plus and query the recovery catalog to see which tables were created:

4. SQL> SELECT TABLE_NAME FROM USER_TABLES;

Before using RMAN with a target database, you must register the target database in the recovery catalog. RMAN obtains all information it needs to register the target database from the database itself.

As long as each target database has a distinct DBID, you can register more than one target database in the same recovery catalog. For example, you can register target databases prod1, prod2, and prod3 in catalog schema rcat1. Note that you cannot register a specific database multiple times in the same recovery catalog: registration occurs only once. However, you can register a target database is multiple catalogs. For example, you can register target database prod1 in catalog schema rcat1 and in catalog schema rcat2.

Each database registered in a given catalog must have a unique database identifier (DBID), but not necessarily a unique database name. Consequently, you cannot clone a database manually and then register it in the same catalog with its parent. Instead, use the DUPLICATE command to create a test database with a unique identifier.

To register the target database:

  1. Connect to the target database and recovery catalog. For example, issue the following to connect to the catalog database rcat as RMAN:

2. % rman TARGET / CATALOG rman/rman@rcat

3.

  1. If the target database is not mounted, then mount or open it. For example, issue:

3. STARTUP MOUNT;

4.

The recovery catalog database must be open.

  1. To use RMAN with a target database, you must first register the database. Run the following command:

4. REGISTER DATABASE;

5.

After you run REGISTER DATABASE, RMAN creates rows in the repository that contain information about the target database. Then, RMAN performs a full resynchronization with the catalog in which it transfers all pertinent data about the target database from the control file and saves it in the catalog.

  1. Test that the registration was successful by running REPORT SCHEMA. This command shows the database structure as it is stored in the repository. For example:

RMAN> report schema;

  1. If there are any existing user-created copies of datafiles or archived logs on disk that were created under Oracle release 8.0 or higher, you can add them to the recovery catalog with the CATALOG command. For example:

CATALOG DATAFILECOPY '/os_backup/df1.bak';

CATALOG ARCHIVELOG '/backup/log1.arc', '/backup/log2.arc', '/backup/log3.arc';

6.

In some cases, datafile copies made of an Oracle7 database with operating systems can be cataloged. To be usable, the copies must not require any Oracle7 redo to be recovered, that is, they must be either of the following:

    • Datafile copies made when the database was shut down consistently. The database must not have been opened again before being migration.
    • Datafile copies made after a tablespace became offline normal or read-only. The tablespaces must not have been brought online or made read/write again before migration.

    Note:

    To determine whether log records have aged out of the control file, compare the number of logs on disk with the number of records in V$ARCHIVED_LOG.


    C:Documents and SettingsAdministrator>rman catalog rman/rman@wilian

    恢復管理器: 版本9.2.0.1.0 - Production

    Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

    連線到恢復目錄資料庫

    未安裝恢復目錄

    RMAN> create catalog;

    恢復目錄已建立

    RMAN> connect target sys/oracle@orcl

    連線到目標資料庫: ORCL (DBID=1173949920)

    RMAN> register database;

    註冊在恢復目錄中的資料庫

    正在啟動全部恢復目錄的 resync

    完成全部 resync

    RMAN>

    [@more@]

    來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/66634/viewspace-999506/,如需轉載,請註明出處,否則將追究法律責任。

    相關文章