​[20211020]改變備庫的rman配置.txt

lfree發表於2021-10-20

[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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章