Hot Backup in Oracle Database
Published by : Obay Salah , November 19, 2024
What if your database cannot be closed even for a moment due to the nature of its work, such as the databases of telecommunications companies, as well as points of sale and automated teller machines.
In this case, we cannot close the database and we also need to make backup copies of it so that we do not lose it in the event of a failure.
The solution in such a case is Hot Backup, which is to make a backup copy of the database without closing it, i.e. while users are working. In order to understand this type of backup, here are the following points:-
1- To make this type of backup, the database must be in Archive log Mode, because in the recovery process we need the archive
Simple Restore cannot be done during the recovery process from Hot Backup.
SELECT LOG_MODE FROM V$DATABASE;
2- Hot Backup is done while users are working, but this may lead to a decrease in performance in the database, so it is preferable to do Hot Backup of the database during non-peak times.
3- Tablespaces can be backed up individually after writing the following code:
ALTER TABLESPACE TABLESPACENAME BEGIN BACKUP;
After writing this code directly, we make copies of the Data files that belong to the above Tablespace via the operating system.
After the copying process is finished via the operating system, we make a backup copy of the Tablespace by writing the following code:
ALTER TABLESPACE TABLESPACENAME END BACKUP;
4- As for the Control File, we do not make a copy of it via the operating system, but only after the backup of the Tablespace is finished, we make a backup copy of the Control File via SQL.
ALTER DATABASE BACKUP CONTROL FILE TO 'C:\CONTROL.CTL;
This is how we backed up the Control File via SQL.
No backup is made for the Redolog Files.
5- When restoring the database from the Hot Backup, you must do Restore + Recovery if you cannot do Restore only.
So we must have at least One Archive File, so it is better to do Switch Logfile after finishing the Hot Backup.
6- As for the recovery process, it is no different from the recovery process from Cold Backup, except that in Hot backup we must do Restore + Recovery.
7- In Oracle10g version, it has become possible to put all databases in Hot Backup mode.
ALTER DATABASE BEGIN BACKUP;
Then we backup the Datafiles via the operating system and then backup the Control File via SQL. But it must be taken into account that there is not a large group of processes working on the database during this type of backup. After completing the backup (Hot Backup), we write the following code to finish the backup mode of the database.
ALTER DATABASE END BACKUP;
Comments
no comment yet!