4am Backup and Recovery Notes Oracle University
4am Backup and Recovery Notes Oracle University
o Determine the maximum recoverability time based on your data's criticality and
backup frequency.
o By default, Oracle provides two control files. Consider adding a third control file on a
different disk with a different controller.
o Tip: Ensure control files are stored on separate disks to prevent data loss.
o Create approximately three redo log groups, each with three files, stored on different
disk groups.
o Remember to keep the number of files in each redo log group balanced.
o Identify the area for storing backup and recovery files, known as the Fast Recovery
Area (FRA).
o Calculate the necessary storage space for FRA considering archive logs, backup files,
and potential growth.
o Remember to ensure the FRA size is adequate for storing backups, archive logs,
flashback logs, and control files.
o Estimate the size of your backups and plan for future growth.
o Set up a retention policy for backups and archive logs to prevent indefinite retention.
o Key Advice: Retain backups and logs for a few days before offloading to tape and
removing them from the physical system.
o Remember to check reclaimable space regularly to manage archive log and backup
file retention.
Post-execution Steps
o Utilize GUI tools like Enterprise Manager Cloud Control for detailed monitoring.
o Set and maintain retention levels for data stored in the FRA.
o Ensure reclaimable space is managed by writing data to tape and deleting it from
FRA when no longer needed.
o Manage reclaimable space by offloading archive logs and backup files to tape, then
deleting them from the FRA.
Key Points
Tip: Multiplex control files and redo logs across different disks to prevent data loss.
Remember: Configure and monitor the FRA size and capacity to avoid system halts during
backups.
Remember: The control file is read by your database whenever it starts up.
Key Role: Controls information about all of the files on your system.
Purpose of Multiplexing:
o If one control file fails, you can use another copy to replace it.
o Multiple copies exist in different locations; if one is lost, the system can be recovered
using another copy.
At least two control files are required; three is optional but not mandatory.
Remember: Shut down the database in abort mode if control file loss occurs.
Replace the corrupted control file with a good copy, then restart the database.
Redo logs store redo information when changes are committed in the database.
Multiple groups ensure continuous data recording and switching between groups as needed.
Key Tip: Use LOG_ARCHIVE_DEST_N parameters for multiple archive log destinations.
Important: Enable archive log mode to retain permanent copies of redo logs.
Monitor and manage the Fast Recovery Area (FRA) to ensure sufficient space for backups and
logs.
o Problem: One of your control files is corrupted, and the database won't start.
o Solution:
Pre-requisite Steps:
Execution Steps:
SHUTDOWN ABORT;
cp /u01/app/oracle/oradata/ORCL/control01.ctl /u01/app/oracle/oradata/ORCL/control02.ctl
STARTUP;
o Solution:
Pre-requisite Steps:
Execution Steps:
o Solution:
Pre-requisite Steps:
Execution Steps:
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
Pre-requisite Steps
1. Log in as SYSDBA:
o Connect to your database as sysdba:
sqlplus / as sysdba
Execution Steps
o Show the current settings for the database recovery file destination:
o Increase the size of the FRA to accommodate all backups and files:
o Key Advice: Set the scope to BOTH to address changes in both memory and the SP
File.
Post-execution Steps
o Ensure the settings have taken effect and monitor the FRA to prevent reaching its
capacity.
o Remember: Regular monitoring of the FRA helps in managing space and ensuring
continuous operations.
o Problem: Need to configure and verify the Fast Recovery Area settings.
o Solution:
Pre-requisite Steps:
Log in as sysdba.
Execution Steps:
if in the value column there is address given then db is using a spfile otherwise pfile. Here it is using
spfile so we need to create a pfile from spfile using the same location where spfile is located like this
1. Log in as SYSDBA:
sqlplus / as sysdba
Now db is using pfile as there is not value in the value column.
Execution Steps
SHUTDOWN IMMEDIATE;
cd $ORACLE_HOME/dbs
vi initorcl.ora
o Add the new control file location to the control_files parameter with s single quote:
o Save and exit the vi editor.
sqlplus / as sysdba
startup nomount;
STARTUP;
Post-execution Steps
Multiplexing Redo:
Steps to Add a New Redo File to a Redo Group
1. Log in as SYSDBA:
sqlplus / as sysdba
startup;
Group 1: /u01/app/oracle/oradata/ORCL/redo01.log
Group 2: /u01/app/oracle/oradata/ORCL/redo02.log
Group 3: /u01/app/oracle/oradata/ORCL/redo03.log
o Group 2:
o Group 3:
o Run the query again to ensure the new files have been added:
o To allow the system to recognize the new files, perform log switches:
o Check the log groups and their current status to ensure the new files are recognized: