Friday, February 14, 2014

Oracle Database COLD BACKUP Shell Script

Creating a script to take a cold backup of a database may be a time-consuming task, but creating a script to restore this cold backup later is certainly a daunting task.

The shell script I'm sharing will take a database cold backup and then will create a restore script (to be used in case you will restore the cold backup later).

Script download:
https://www.dropbox.com/s/sjibiupwic9oxt1/COLD_BACKUP.sh?dl=0

How it works:

The script checks the current running databases on the server and will ask you to select the number of the database you want to backup from the list (The database you want to back it up should be up and running in order to get the script know the database files location).

It will shutdown the database, take a cold backup, create a script to restore the cold backup and finally startup the database.

This script is RAC aware, it will detect if your database is RAC or a standalone one, if it's a RAC DB the script will ensure that there is no other instances are currently running for the same database before starting the cold backup procedure.

Note: This script is not designed for databases having their files located on ASM  :-)

DISCLAIMER: THIS SCRIPT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY. IT IS PROVIDED "AS IS".

The script is part of the database administration bundle, this bundle includes more than 45 scripts covering day to day database administration tasks, you can download the DBA BUNDLE from here: 
[http://dba-tips.blogspot.ae/2014/02/oracle-database-administration-scripts.html].



No comments: