Database automation scripts.
Includes scripts to assist with the creation of a hot backup or incremental merge copy of a database. It creates a directory dbconfig either on the archive log file system (for hot backup mode) or the backup file system (for backup copy mode) that contains information that is helpful in the event a restore is necessary. This information is also used by the oracle-container-automation tool to create database copies in a container. Note - the S3 backup utility requires the AWS CLI.
To begin hot backup mode:
./db-hot-backup.sh -b -s proddbTo end hot backup mode:
./db-hot-backup.sh -e -s proddbTo create an incremental merge copy:
. ./setup.sh./db-incr-merge.sh -s proddb -d /oradb/backupTo upload an incremental merge copy to S3:
. ./setup.sh./db-s3-backup.sh -s proddb -d /oradb/backup -b bucketTo create a new database with archivelog mode enabled:
./db-create.sh -a -c -s demodb -d /db01/demodbTo remove a database:
./db-delete.sh -s demodbTo set up Data Guard:
On the primary side:
./db-dg-prep.sh -p oracle_sid -h remote_host_nameOn the secondary side:
./db-dg-prep.sh -p oracle_sid -h primary_host_name -rTo convert a physical standby to logical standby:
On the secondary side stop log apply:
./db-dg-prep.sh -p oracle_sid -s -rOn the primary side setup LogMiner:
./db-dg-prep.sh -p oracle_sid -mOn the secondary side convert the physical standby to logical standby:
./db-dg-prep.sh -p oracle_sid -l -rTo recreate a physical standby database:
Drop the standby database (this is a destructive action that can not be undone)
./db-dg-prep.sh -p oracle_sid -dOn the primary database host, copy the configuration to the secondary:
./db-dg-prep.sh -p oracle_sid -h remote_host_name -xRecreate the standby database:
./db-dg-prep.sh -p oracle_sid -h primary_host_name -rTo online relocate a database supply a target root directory. Subdirectories will be created for data files, the FRA, and archive logs. This supports FS to FS, ASM to FS, and FS to ASM.
./db-file-move.sh -s oracle_sid -d /pathTo test a move without actually moving anything:
./db-file-move.sh -s oracle_sid -d /path -tUse the prompt option to ask to move each data file type. If you respond "no" then it will skip that data file type.
./db-file-move.sh -s oracle_sid -d /path -pTo perform a move of one file type where the destination directory is a full path (no subdirectories are created - this will automatically enable prompting, and it will exit after finishing a file type relocation):
./db-file-move.sh -s oracle_sid -d /path -f