0% found this document useful (0 votes)
447 views10 pages

Performing Cold Backup On Oracle 10g

Uploaded by

api-250287051
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
447 views10 pages

Performing Cold Backup On Oracle 10g

Uploaded by

api-250287051
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

2014

How to Perform hot backup for Oracle 10G


Lesson is done on windows 8 and the oracle is enterprise edition 10G

Performing Cold backup on Oracle 10G:


The following lesson contains a scenario of all the steps needed to be known for Oracle Database Administrator to successfully perform Cold backup on oracle10G and the same steps can be applied to oracle 11G. Before starting the lesson, there are couple of important points need to be kept in mind: 1- Cold Backup: cold backup is a manual backup and some name it the most reliable one, but it requires shutting down the database and then, make a full copy of everything related to database; data files, log files, and also, control files. But such method can be applied on small businesses databases. 2- Hot backup: hot backup is more reliable backup method and it can be down while the database is running; the term hot is referred to the performance while the database is running. Usually, it is applied in enterprise environments where database cannot be taken offline or shutdown. The following lesson will mainly talk about the procedures commonly followed to accomplish such task. 3- Recovery Manager backup: RM is the method used by database experts to perform backup and we will be talking about it more in detail later inshallah. 4- Data Guard: it is the most newly developed method of backup for database and it is a topic I am willing to discuss later inshallah. note: The following lesson is made on windows 8 and most codes will appear in the CMD window, and please write your comments on this lesson as you go on with your reading to make sure all the steps are fully understood. Cold backup of Oracle 10G:
The concept of cold backup resides in shutting down the database and copying all its files, DBF files, redo logs, and control files into a backup folder. In case of a database disaster, we can copy back our files from the backup folder and start our database, but the data appearing will be only the data saved at that point of time when the cold back is performed

What should we do first? We need to perform some checking on our database:

we set our oracle-SID to ahmed and then, checked to make sure it is ahmed, after connecting as sysdba, we checked the name of our database and its current log_mode, and it is in noarchivelog state; Meaning, not in a hot backup mode. We will first make a scenario to understand how cold backup functions: We mentioned earlier that cold backup is saving oracle control files, redo logs, and data files for a specific point; Meaning, if we performed a cold backup now, and later, created some new tables and inserted data to, and after doing so, our database crashed for any reason and we restored the cold backup, we will only restore our database at the point when it was backed up, the recently inserted information are lost. So for this purpose, we will backup our database now, and after performing the cold backup, we will create a table and name it emp, and insert some records into it. When our table creation is finished, we will insert couple of records, and save. After saving, we will delete our database files to cause a crash, and restore our cold backup, and observe the difference.

Let's begin our journey now: Lets first make a folder and call it cold_backup, and it is where our files will be stored:

We made a directory in drive E and called it cold_backup as it appears in the picture above. To perform a cold backup, we need to make sure our database is in noarchivelog mode, and to make sure, we can query v$database view through the following command:

Since it is not in the archive log, we can perform our cold backup; we need to do the following steps: 1- shutdown the database 2- locate our database files, and in this case, it is location: e:\oracle\product\10.2.0\oradata\ahmed\ 3- copy all the files from ahmed folder into our cold_backup folder. Shutting down the database:

we also can just say shutdown or shutdown abort in case if we want to speed up the shutdown. Locating our files:

disregard the archived_logs folder because it was made to keep track of logs when my database was in the archive log mode. We dont need it now. Copying all the database files into E:\cold_backup\ folder:

we have copied all the files, and lets double check with the cold_backup folder:

The backup is taken successfully.

Let's now continue our scenario and connect to the database and create our table emp and insert some records into it:

We have created our table and inserted some records into it. please be aware, this modification is taken place after the cold backup is performed, which means the cold backup doesn't contain the table. Lets now shutdown and delete all the files in the ahmed folder, which is the folder where our database files are stored:

we have deleted all the files, now if we try startup our database, we will get an error because the control files cannot be located; lets check to see:
7

ok, now we should shutdown the database in case if it is opened, and it isn't open now, and copy all the files from the cold_backup folder back to their original folder Ahmed, and then, try to restart our database:

all the files are copied to their original location and let's double check the ahmed folder to make sure all the files are there:

Let's try to start our database now:

The database is open, but the question is: Since we created a table and inserted some records into it, will it appear knowing we performed our cold backup before its creation?

Lets desc table emp now to see if it does exist or not?

So, I hope the idea is clear now. the cold backup restores the database to the point of its backup. anything comes after the cold backup is lost if cold backup is the only method applied to save the database, and it is also among the old perhaps dying methods used, but knowing it is very important. Who uses cold backup? Usually small businesses or individuals that don't need complicated servers and database environment use this method to keep backup archives of their database and of course knowing the database and the time of taking the cold backup is very important.

I hope this lesson is clear enough for the reader. Prayer for me please.

11

You might also like