Tuesday, 22 July 2014

Shell script to rebuild an entire database.

Shell script to rebuild an entire database.

The script creates a tar files with the export output and the necessary loads command.

Example:

Our environment:
db name: DAN_PROD

Run the rebuiddb.ksh script on the source server like:

./rebuiddb.ksh dan_prod


A tar file will be created:

file name has the following syntax:  <db name>._rebuild.tar.gz

In this case the file name will be: dan_prod_rebuild.tar.gz



Move this files to the target server, uncompress it and run the following script like:

script name syntax: <db name>.rebuld_onTarget.ksh

In this case the script name will be: dan_prod.rebuld_onTarget.ksh


Run it as follow:


./dan_prod.rebuld_onTarget.ksh dan_prod




Note: When migrating a database to case insensitive ( for example, version v8 or v9.1 to v9.5 ) letters with accent will use the double of length. This script increase 30% of length to all char, varchar and character.

No comments:

Post a Comment