ITPub博客

首页 > 数据库 > Oracle > RMAN MAINTENANCE

RMAN MAINTENANCE

原创 Oracle 作者:sepulcrum 时间:2007-08-30 08:46:26 0 删除 编辑

取消註冊catalog
SQL> select db_key,db_id from db;
db_key db_id
429 201401412
SQL> execute dbms_rcvcat.unregisterdatabase(429,201401412);


/**** MAINTENANCE COMMANDS ****/

CROSSCHECK BACKUP;
delete expired backup;
REPORT NEED BACKUP;
DELETE OBSOLETE;

DELETE ALL OBSOLETE
DELETE ALL EXPIRED
EXPIRED 表示备份集在磁盘或者磁带上不存在了
OBSOLETE 表示根据保存策略判断备份集不再需要了
LIST BACKUP SUMMARY;
list backup of controlfile;
list backupset;
restore database validate; /* check if database can be restored */

allocate channel for maintenance type disk;
change archivelog all crosscheck;
CONFIGURE CONTROLFILE AUTOBACKUP ON;


connect target /
run{
ALLOCATE CHANNEL ch00 TYPE DISK;
BACKUP DATABASE format'C:oracleproduct10.1.0archackupdb_full_%U';
sql 'alter system archive log current';
RELEASE CHANNEL ch00;
# backup all archive logs
ALLOCATE CHANNEL ch00 TYPE DISK;
BACKUP filesperset 20 FORMAT 'C:oracleproduct10.1.0archackuparc_%s_%p_%t' ARCHIVELOG ALL DELETE INPUT;
RELEASE CHANNEL ch00;
--DELETE ARCHIVELOG UNTIL TIME 'SYSDATE-1';
# backup controlfile
ALLOCATE CHANNEL ch00 TYPE DISK;
BACKUP FORMAT 'C:oracleproduct10.1.0archackupcntrl_%s_%p_%t' CURRENT CONTROLFILE;
RELEASE CHANNEL ch00;
}


rman target sys/system catalog system/system@instance msglog /tmp/restore_time.log
startup nomount;
RUN {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
restore controlfile;--restore controlfile from autobackup;
sql 'alter database mount';
set until time "to_date('05/09/07 12:00:00','MM/DD/YY HH24:MI:SS')";
restore database;
recover database;
alter database open resetlogs;
RELEASE CHANNEL ch00;
}

RMAN-03002: failure of resync command at 06/08/2007 09:01:38
RMAN-06004: ORACLE error from recovery catalog database: ORA-06550: line 1, column 2273:
PLS-00302: component 'GETRANGEALBACKUP' must be declared
ORA-06550: line 1, column 2238:
PL/SQL: Statement ignored

PL/SQL package RPROD10G.DBMS_RCVCAT version 10.02.00.00 in RCVCAT database is not current
PL/SQL package RPROD10G.DBMS_RCVMAN version 10.02.00.00 in RCVCAT database is not current

lrwxrwxrwx 1 orai932 oinstall 36 Apr 30 14:32 libobk.so -> /usr/openv/netbackup/bin/libobk.so64
ln -s /usr/openv/netbackup/bin/libobk.so64 libobk.so

C:>rman target ... catalog ....
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Mar 14 12:39:37 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database:....
connected to recovery catalog database
PL/SQL package RMAN.DBMS_RCVCAT version 10.01.00 in RCVCAT database is too old
RMAN> upgrade catalog;
recovery catalog owner is RMAN
enter UPGRADE CATALOG command again to confirm catalog upgrade
RMAN> upgrade catalog;
recovery catalog upgraded to version 10.02.00.00
DBMS_RCVMAN package upgraded to version 10.02.00.00
DBMS_RCVCAT package upgraded to version 10.02.00.00

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10897379/viewspace-967015/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 常用的分析函数
下一篇: 固定行列转换
请登录后发表评论 登录
全部评论
  • 博文量
    26
  • 访问量
    169989