[20181010]v$rman_configuration沒有輸出.txt

lfree發表於2018-10-10

[20181010]v$rman_configuration沒有輸出.txt

--//別人問的問題,查詢v$rman_configuration沒有輸出,實際上這是正常的,如果rman全部使用是預設值.
--//查詢v$rman_configuration檢視沒有輸出是正常的.簡單的測試看看:

1.環境:
SCOTT@test01p> @ ver1
PORT_STRING                    VERSION        BANNER                                                                               CON_ID
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
IBMPC/WIN_NT64-9.1.0           12.2.0.1.0     Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production              0

SCOTT@test01p> select * from v$rman_configuration;
no rows selected

--//剛剛重新安裝,rman配置也沒有改動過.沒有輸出是正常的.

2.修改rman配置看看:

RMAN> show all;
RMAN configuration parameters for database with db_unique_name TEST are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\APP\ORACLE\PRODUCT\12.2.0\DBHOME_1\DATABASE\SNCFTEST.ORA'; # default
--//12c 資料庫 現在 CONFIGURE CONTROLFILE AUTOBACKUP ON; # default

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters are successfully stored

SYS@test> select * from v$rman_configuration;
     CONF# NAME                           VALUE                    CON_ID
---------- ------------------------------ -------------------- ----------
         1 CONTROLFILE AUTOBACKUP         OFF                           0

3.還原看看:
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

SYS@test> select * from v$rman_configuration;
     CONF# NAME                           VALUE                    CON_ID
---------- ------------------------------ -------------------- ----------
         1 CONTROLFILE AUTOBACKUP         ON                            0

--//oracle有時候真奇怪,這樣修改,oracle認為是使用者修改的.

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP CLEAR;
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN configuration parameters are successfully reset to default value

SYS@test> select * from v$rman_configuration;
no rows selected

--//再重複測試看看:
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

SYS@test> select * from v$rman_configuration;
     CONF# NAME                           VALUE                    CON_ID
---------- ------------------------------ -------------------- ----------
         1 CONTROLFILE AUTOBACKUP         ON                            0

4.如果rman配置改動太多.可以簡單使用DBMS_BACKUP_RESTORE.RESETCONFIG還原:

SYS@test> EXECUTE DBMS_BACKUP_RESTORE.RESETCONFIG;
PL/SQL procedure successfully completed.

SYS@test> select * from v$rman_configuration;
no rows selected

5.另外12c 如果在pdb下修改rman配置會報錯:

D:\tools\rlwrap>rman target sys/btbtms@test01p
Recovery Manager: Release 12.2.0.1.0 - Production on Wed Oct 10 19:51:28 2018
Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.
connected to target database: TEST:TEST01P (DBID=2923790755)

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
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/10/2018 19:51:34
RMAN-07536: command not allowed when connected to a Pluggable Database

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

相關文章