Today we will discuss about Hot Backups
What are Hot backups?
Hot backups method are exact opposite to Cold backups method. The backups what we take when the database is up and running.
Perform Hot Backups:
1) The first prerequisite is, You have to have database running in archive log mode. If your database running in NOARCHIVELOG mode. You have to change database NOARCHIVELOG mode to ARCHIVELOG. And have to provide ARCHIVELOG destination.
Command for checking whether the database is running NOARCHIVELOG or ARCHIVELOG. For that you have to make a directory called Archivelogs under the folder $ORACLE_HOME/dbs/ and start database
You can see above, my database is running in NOARCHIVELOG mode.. Now we have to change it first and then provide location for archive log switches
2) Please check below picture to change mode of database and give destination to archivelog files
If you want to change mode of database, you have to start database in mount mode. You must not open the database.
Now close the database, using ALTER command or restart the database in mount mode.
3) Now Start backup.. Please go through below picture
File No.1 Indicates SYSTEM tablespace
No.2 Indicates UNDOTBS1 tablespace
No.3 Indicates SYSAUX tablespace
No.4 Indicates Users tablespace
No need to worry about Temp tablespace. That is temporary one.
4) Create directory called Backups under Directory /u01/. Then start backup.
Now Get out of SQL and copy data files to backups directory.
5) Now It’s time to talk about Archivelogs, let me tell you how Switch logs will create and use of it. First let me show you how to create Switches. We will see use of those at the time of recovery.
Once backup of datafiles completed. Create one switch.
In this way we can create switches
6) Datafiles backup was completed now lets make a backup of control files
7) Just create a simple table, as shown in below (THIS IS only for testing purpose to know the use of switches. In real time the use of switches are differ. we have to create these, when work demands)
We already created one switch at the time end backup;
Now we created a 2nd switch once table created, Next one after creating 1st row.. and continues.
8) Now shutdown the database and corrupt it..
9) Now it’s time to recovery. Shut down the Instance then Copy all files to default directory from backups directory and create Controlfiles
10) Now we have three control files and all Datafiles now try to start the database;
We created some switched right?
Using those we can do media recovery
For that you need to start database in mount state
Before that go to archivelog directory check for switch files
Remember the squence number. we need to apply these files to recovery by using following command
as show in figure
11) let apply remaining files also
Now you completed recvery of database. This is the method of hot backup and recovery
In our next session I will show how to clone the database;