Once you have prepared your database and identified the necessary files, use the following steps to perform a closed database backup:
Step 1: First, shut down the Oracle instance with the SHUTDOWN NORMAL or the SHUTDOWN IMMEDIATE command.
It is important to note that the database must be shut down properly or you will have backed up a crashed database,
which is problematic in certain recovery scenarios. An example of an improper shutdown would be to use the
shutdown abort
command. The shutdown abort command is still available in Oracle 13c. It remains a valid option for forcefully shutting down the database instance. If this happens, you have to restart the database and shut it down properly.
The default shutdown parameter is "normal."
The database will not shut down with the command
SHUTDOWN NORMAL
or
SHUTDOWN
,
until the last user logs off. Use SHUTDOWN IMMEDIATE if there is any chance the database is still being accessed to avoid waiting for the last user to log off.
Step 2: Second, back up all datafiles, redo log files, control files, parameter files, and the password files with an operating system backup utility. Although parameter and password files are not physically part of the database and do not contain any user data, they are important because the files contain essential information about database startup and configuration. In order to ensure that every file is correctly backed up, a reliable and automated procedure for this operation can be established by creating and executing a simple script.
Next, restart the Oracle instance.
The image below illustrates the "closed backup process".
Performing Closed Database Backup in Oracle
The following series of steps below demonstrates the steps of a "closed database backup". A DBA can perform a closed database backup in Oracle 12c. This is known as an offline backup, and it is the most common type of backup for Oracle databases.
To perform a closed database backup, you would first need to shut down the database using the `SHUTDOWN NORMAL` command. Once the database is shut down, you can use the Oracle Recovery Manager (RMAN) to back up the database files.
Here are the steps to perform a closed database backup in Oracle 12c using RMAN:
Start RMAN.
Connect to the target database.
Run the following command to back up the database files:
RMAN> BACKUP DATABASE;
RMAN will prompt you to specify the location where you want to save the backup files.
Once you have specified the location, RMAN will begin backing up the database files.
Once the backup is complete, RMAN will display a confirmation message.
You can also use RMAN to back up specific tablespaces or data files.
To do this, you would use the `BACKUP` command and specify the names of the tablespaces or data files that you want to back up.
Example:
Here is an example of how to back up a specific tablespace using RMAN:
RMAN> BACKUP TABLESPACE USERS;
Here is an example of how to back up a specific data file using RMAN:
Once you have backed up the database, you can restart the database using the `STARTUP` command. It is important to note that you should always test your backups to ensure that they are working properly. You can do this by restoring the backups to a test environment.
The next lesson covers the advantages, disadvantages, and requirements for open database backup.
Performing Backup - Quiz
Click the link below to review your understanding of closed database backup options and methods. Performing Backup - Quiz