Thursday, 24 November 2016

Cold Backup Method - Duplicating Oracle Database

How to Duplicate a database using Cold Backup Method?

There are a lot of ways in Oracle Database Software to duplicate a database but in this article, I am going to demonstrate the fastest way of creating a duplicate database from an existing database. This article is divided into following categories:
  • Introduction - What exactly is Cold Backup?
  • How to take Cold Backup of Oracle Database?
  • How to Restore the Database from Cold Backup.
So let's start with Introduction to Cold Backup...

Normally, a Backup is something that is kept for safekeeping so that if we loose our original content due to any reason, we may always recover the loss i.e. Backup in general terms (as per Oracle Database) refers to making copies of data so that these additional copies may be used to restore the original whenever data loss happens. These additional copies are typically called "Backups."

Now a Cold Backup is taken when the database is not running or is not open - i.e. users are not logged on. In such scenario, no transactions are going on inside the database and hence it is easier to backup. This is also known as an Offline backup. There are a lot of Benefits of taking a Cold Backup. Also there are a lot of types in which backups are taken while the database is offline. But here we are going to discuss the way in which we simply copy all the physical files that contains the important data i.e. Parameter File, Control File and Redo Log Files and Data Files.

Restoring a database is copying the physical files from a backup medium (disk or tape) to the appropriate file locations for database operation.

How to take Cold Backup and Restore the Oracle Database - Complete Steps

Follow the below mentioned steps in order to take the Cold Backup of Oracle Database:

1. Make sure the database for which you are going to take the backup is in mount stage or open in the beginning.
2. Create PFILE from SPFILE.
3. Create Control File to trace.
4. After you have manually created Pfile and Controlfile, you can now shutdown the database.
5. Copy all the physical files which contains the remaining data i.e. Datafiles and RedoLog Files.
6. If you are going to create a duplicate database on the same server, you'll need to rename the database. But if you are going to duplicate the database on some other server, then you can keep the name same as before. But you'll have to copy those files to that server.
7. After you have moved your files to the new location, it's time to make some changes in manually created PFILE and Control File.
8. Make changes in the PFILE by opening it and replacing all the parameter values with the new ones.
9. Create the Oracle Service by initiating command: oradim –new –sid test –intpwd sys
10. After the PFile is altered, you can start the database in NOMOUNT state by provoking command - Startup nomount Pfile=the complete path as well as name where your altered Pfile is present
11. Alter the manually created Control File - Change the name and path for database and the files - Also replace REUSE keyword with SET and NORESETLOGS with RESETLOGS keyword
12. Copy the Code from the altered Control File and paste it in the SQL Prompt where database is started in NOMOUNT mode. It will create the Control Files again and will consider the mentioned Datafiles and RedoLog files for its use.
13. At the end, open the database with ResetLogs options.

Note: This article is short and simple just to provide the users a quick overview of the process. To understand the whole scenario in detail, please visit my article - How to Duplicate Oracle Database Using Cold Backup Method with demo.

I hope you'll like the article !!!

1 comment:

  1. Hi,
    in the end of this article you said "please visit my article - How to Duplicate Oracle Database Using Cold Backup Method with demo."

    how can I get this demo? :)
    Thank you

    ReplyDelete