时间:2021-07-01 10:21:17 帮助过:2人阅读
2.备份controlfile到trace file
alter database backup controlfile to trace;
trace file在alert log中记录也可在ORACLE_BASE/diag/rdbms/sid/sid/trace中查找
3.在RMAN中配置controlfile自动备份
RMAN> show all;
RMAN configuration parameters for database with db_unique_name OEM are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # 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 ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_oem.f‘; # default
RMAN> configure controlfile autobackup on;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
RMAN> show all;
RMAN configuration parameters for database with db_unique_name OEM are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
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 ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_oem.f‘; # default
RMAN>
通过备份控制文件到race file中,创建控制文件的命令如下:
CREATE CONTROLFILE REUSE DATABASE "OEM" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ‘/u01/app/oracle/oradata/oem/redo01.log‘ SIZE 512M BLOCKSIZE 512,
GROUP 2 ‘/u01/app/oracle/oradata/oem/redo02.log‘ SIZE 512M BLOCKSIZE 512,
GROUP 3 ‘/u01/app/oracle/oradata/oem/redo03.log‘ SIZE 512M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
‘/u01/app/oracle/oradata/oem/system01.dbf‘,
‘/u01/app/oracle/oradata/oem/sysaux01.dbf‘,
‘/u01/app/oracle/oradata/oem/undotbs01.dbf‘,
‘/u01/app/oracle/oradata/oem/users01.dbf‘,
‘/u01/app/oracle/oradata/oem/mgmt_ecm_depot1.dbf‘,
‘/u01/app/oracle/oradata/oem/mgmt.dbf‘,
‘/u01/app/oracle/oradata/oem/mgmt_deepdive.dbf‘,
‘/u01/app/oracle/oradata/oem/test0101.dbf
‘
CHARACTER SET AL32UTF8
;
在控制文件损坏时,可以通过备份的控制文件恢复。
版权声明:本文为博主原创文章,未经博主允许不得转载。
oracle 控制文件
标签: