ITPub博客

首页 > 数据库 > Oracle > ​[20211020]改变备库的rman配置.txt

​[20211020]改变备库的rman配置.txt

原创 Oracle 作者:lfree 时间:2021-10-20 17:00:04 0 删除 编辑

[20211020]改变备库的rman配置.txt

--//想在备库上做备份,以前从来没有做过,需要修改rman的配置参数。遇到的问题。

1.环境:
SYS@192.168.aaa.bbb:1521/xxx999dg2> @ ver1

PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.3.0     Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

RMAN> show  RETENTION POLICY;
RMAN configuration parameters for database with db_unique_name xxx999DG2 are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;

RMAN> configure retention policy to recovery window of 8 days;
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 10/20/2021 16:43:11
RMAN-05021: this configuration cannot be changed for a BACKUP or STANDBY control file

--//尝试不在show all里面的一些特殊参数。
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK RATE 100 M;
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK RATE 100 M;
new RMAN configuration parameters are successfully stored
-//OK。

RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK clear ;
old RMAN configuration parameters are successfully deleted

2.常规方法很明显我只能在主库先修改参数,然后建立STANDBY control file,再拷贝到dg使用。

--//找到一个链接:

SYS@xxx999dg2> select dbms_backup_restore.setconfig('RETENTION POLICY','TO RECOVERY WINDOW OF 8 DAYS') from dual ;
DBMS_BACKUP_RESTORE.SETCONFIG('RETENTIONPOLICY','TORECOVERYWINDOWOF8DAYS')
--------------------------------------------------------------------------
                                                                         2

SYS@xxx999dg2> select * from v$rman_configuration;
     CONF# NAME                 VALUE
---------- -------------------- ----------------------------
         1 RETENTION POLICY     TO RECOVERY WINDOW OF 7 DAYS
         2 RETENTION POLICY     TO RECOVERY WINDOW OF 8 DAYS
--//昏遇到与原链接一样的情况,出现2行。

RMAN> show  RETENTION POLICY;
RMAN configuration parameters for database with db_unique_name xxx999DG2 are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 8 DAYS;

SYS@xxx999dg2> exec DBMS_BACKUP_RESTORE.DELETECONFIG(1);
PL/SQL procedure successfully completed.

SYS@xxx999dg2> select * from v$rman_configuration;
     CONF# NAME                 VALUE
---------- -------------------- ----------------------------
         2 RETENTION POLICY     TO RECOVERY WINDOW OF 8 DAYS

RMAN> show  RETENTION POLICY;
RMAN configuration parameters for database with db_unique_name xxx999DG2 are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 8 DAYS;

SYS@xxx999dg2> select dbms_backup_restore.setconfig('RETENTION POLICY','TO REDUNDANCY 1') from dual ;
DBMS_BACKUP_RESTORE.SETCONFIG('RETENTIONPOLICY','TOREDUNDANCY1')
----------------------------------------------------------------
                                                               1

SYS@xxx999dg2> exec DBMS_BACKUP_RESTORE.DELETECONFIG(2);
PL/SQL procedure successfully completed.

SYS@xxx999dg2> select * from v$rman_configuration;
     CONF# NAME                 VALUE
---------- -------------------- ---------------
         1 RETENTION POLICY     TO REDUNDANCY 1


RMAN> show  RETENTION POLICY;
RMAN configuration parameters for database with db_unique_name xxx999DG2 are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;

--//OK,通过这个参数可以实现修改备库的参数配置。

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

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    3080
  • 访问量
    6804684