zl程序教程

您现在的位置是:首页 >  其它

当前栏目

How to Auto Backup The Control File

to The File How Control Auto backup
2023-09-14 09:13:29 时间

how to enable and disable the auto-backup of the control file in Oracle DB. In case you are not using the Recovery catalog, then enabling the auto backup of Control files of your database is highly recommended.

When does RMAN perform the Auto Backup of The Control files?

 RMAN auto backups the control file and server parameter file when

  1. RMAN has successfully completed the BACKUP or COPY command.
  2. RMAN has successfully completed the CREATE CATALOG command.
  3. When there are any changes to the physical structure of the database. And by changes to the physical structure, I mean Adding or deleting a tablespace or data file, Putting tablespace either online or offline, renaming a data file or adding online redo logs. RMAN will process the auto backup of the control file, even if those changes are made through SQL*Plus.

What Process Performs The Auto-Backup?

What process performs the auto backup of the control file in case of structural changes to the database?

Since everything is taking place in RMAN thus we tend to think and answer “The RMAN process” performs the auto backup. But it’s wrong, actually, Oracle Server Process performs the auto backup of the control file and server parameter file when there is any structural change in the database.

How To Enable Auto Backup of The Control File

Step 1: Start the RMAN and connect with your target database

[oracle@oracle-db-19c ~]$ 
[oracle@oracle-db-19c ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Feb 1 15:40:02 2023
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CDB1 (DBID=1093429351)

RMAN> 

Step 2: Enable the auto backup of the control file

RMAN> 

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

using target database control file instead of recovery catalog
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

RMAN> 

 On successful execution of this command, the auto backup of the control file will be enabled.

How To Disable Auto Backup of The Control File.

There are two ways to disable the auto backup of the control file.

Step 1: Start the RMAN and connect with your target database

[oracle@oracle-db-19c ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Feb 1 15:43:08 2023
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CDB1 (DBID=1093429351)

RMAN> 

Step 2: Disable the auto backup of the control file

RMAN> 

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP off;

using target database control file instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters are successfully stored

RMAN> 

 On successful execution of this command, the auto backup of the control file will be disabled.

That’s the first way to disable the auto backup of the control file. 

Reset the “CONTROLFILE AUTOBACKUP” parameter.

(another way to disable the auto backup of the control file)

Step 1: Start the RMAN and connect with your target database

[oracle@oracle-db-19c ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Feb 1 15:46:25 2023
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CDB1 (DBID=1093429351)

RMAN> 

Step 2: Reset the “CONTROLFILE AUTOBACKUP” parameter.


RMAN> 

RMAN> configure controlfile autobackup clear;

using target database control file instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
RMAN configuration parameters are successfully reset to default value

RMAN> 

On successful execution, this statement will reset the “CONTROLFILE AUTOBACKUP” parameter to its default state.