RMAN配置示例

47328983發表於2009-03-09

1.         建立catalog資料庫:

dbca中使用new database資料庫進行建立,不使用現有模板,不需任何SQL附加產品選項。設定了較大的large pool

 

2.         作業系統的設定:

建立作業系統使用者rman,將其primary goup設為DBA。並對其.profile檔案做如下修改:

ORACLE_SID=catalog

ORACLE_HOME=/oracle/app/oracle/product/9.2.0.1.0

ORACLE_BASE=/oracle/app/oracle

PATH=$PATH:/oracle/bin:$ORACLE_HOME/bin

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

#DISPLAY=local:0

DISPLAY=10.250.4.87:0.0

export ORACLE_SID ORACLE_HOME ORACLE_BASE PATH LD_LIBRARY_PATH DISPLAY

 

 

NLS_LANG=AMERICAN

NLS_DATE_FORMAT="MON DD YYYY HH24:MI:SS"

export NLS_LANG NLS_DATE_FORMAT

 

 

 

3.         在新建立的資料庫上的操作:

1)        建立表空間ts_rman

2)        建立使用者rman,指定其預設表空間為ts_rman

3)        為使用者授權:grant connect,resource,RECOVERY_CATALOG_OWNER to rman;

 

4.         catalog資料庫中建立恢復目錄catalog

$ rman catalog rman/rman

 

Recovery Manager: Release 9.2.0.1.0 - Production

 

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

 

connected to recovery catalog database

recovery catalog is not installed

 

RMAN> create catalog tablespace ts_rman;

 

recovery catalog created

 

RMAN> exit

 

Recovery Manager complete.

 

 

 

5.         catalog中註冊需要備份恢復的資料庫(ora)

$ rman target sys/sys@ora

 

Recovery Manager: Release 9.2.0.1.0 - Production

 

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

 

connected to target database: ORA (DBID=1147939807)

 

RMAN> connect catalog rman/rman@catalog

 

connected to recovery catalog database

 

RMAN> register database;

 

database registered in recovery catalog

starting full resync of recovery catalog

full resync complete

 

RMAN> exit

 

Recovery Manager complete.

 

至此,RMAN的配置就完全結束了,可以對目標資料庫進行利用RMAN的備份以及恢復了。

 

6.         進行RMAN的測試:

$ rman target sys/sys@ora

 

Recovery Manager: Release 9.2.0.1.0 - Production

 

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

 

connected to target database: ORA (DBID=1147939807)

 

RMAN> connect catalog rman/rman@catalog

 

connected to recovery catalog database

 

RMAN> run {

allocate channel c1 type disk;

backup current controlfile;

}

 

allocated channel: c1

channel c1: sid=15 devtype=DISK

 

Starting backup at 25-JUN-04

channel c1: starting full datafile backupset

channel c1: specifying datafile(s) in backupset

including current controlfile in backupset

channel c1: starting piece 1 at 25-JUN-04

channel c1: finished piece 1 at 25-JUN-04

piece handle=/oracle/app/oracle/product/9.2.0.1.0/dbs/01fp7orm_1_1 comment=NONE

channel c1: backup set complete, elapsed time: 00:00:01

Finished backup at 25-JUN-04

released channel: c1

 

RMAN> list backup;

 

 

List of Backup Sets

===================

 

BS Key  Type LV Size       Device Type Elapsed Time Completion Time

------- ---- -- ---------- ----------- ------------ ---------------

21      Full    1M         DISK        00:00:00     25-JUN-04

        BP Key: 22   Status: AVAILABLE   Tag: TAG20040625T184158

        Piece Name: /oracle/app/oracle/product/9.2.0.1.0/dbs/01fp7orm_1_1

  Controlfile Included: Ckp SCN: 623816       Ckp time: 25-JUN-04

 

RMAN>

 

測試成功,可以進行進一步的rman的備份恢復了。

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

相關文章