當需要變更 Control File 的參數時,必須按以下步驟完成。
以 MAXLOGFILES 為例:
備份 controlfile & 查詢 MAXLOGFILES 目前設定
SQL> show parameter user_dump_dest NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ user_dump_dest string /opt/oracle/admin/oddfdc/udump SQL> Select 'MAXLOGFILES: ' || records_total from v$controlfile_record_section where type = 'REDO LOG'; 'MAXLOGFILES:'||RECORDS_TOTAL ----------------------------------------------------- MAXLOGFILES: 5
修改 controlfile 內容
從 udump 目錄找尋最新的 *.trc,內容有建立 crontrolfile 的內容
例如 oddfdc_ora_18405.trc:
複製以下這一段內容,用來建立 create_controlfile.sql
.... CREATE CONTROLFILE REUSE DATABASE "ODDFDC" RESETLOGS NOARCHIVELOG ... ... CHARACTER SET AL32UTF8 ;
新增 create_controlfile.sql:
CREATE CONTROLFILE REUSE DATABASE "ODDFDC" RESETLOGS NOARCHIVELOG MAXLOGFILES 10 MAXLOGMEMBERS 5 MAXDATAFILES 100 MAXINSTANCES 1 MAXLOGHISTORY 292 LOGFILE GROUP 1 '/opt/oracle/oradata/oddfdc/redo01.log' SIZE 2048M, GROUP 2 '/opt/oracle/oradata/oddfdc/redo02.log' SIZE 2048M, GROUP 3 '/opt/oracle/oradata/oddfdc/redo03.log' SIZE 2048M, GROUP 4 '/opt/oracle/oradata/oddfdc/redo04.log' SIZE 2048M -- STANDBY LOGFILE DATAFILE '/opt/oracle/oradata/oddfdc/system01.dbf', '/opt/oracle/oradata/oddfdc/undotbs01.dbf', '/opt/oracle/oradata/oddfdc/sysaux01.dbf', '/opt/oracle/oradata/oddfdc/STDB-01.dbf', '/opt/oracle/oradata/oddfdc/CDB-01.dbf', '/opt/oracle/oradata/oddfdc/STDB-02.dbf' CHARACTER SET AL32UTF8 ;
重建 controlfile
最後檢查