Database Reference
In-Depth Information
Now it is time to develop a script for full database level 0 backup to initiate a base backup for subsequent
incremental backups. The following script will have two channels allocated to TAPE, will back up the database along
with the archive logs, and will also remove the archive logs after the backup:
--- rondb_full_db_bkp.sh
--- RONDB RMAN ONLINE FULL DATABASE BACKUP, LEVEL 0
rman{
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' CONNECT sys/password@rondb_1;
ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE' CONNECT sys/password@rondb_2;
SEND 'NB_ORA_CLIENT=host_name,NB_ORA_POLICY=RONDB_FULL_LEVEL0,NB_ORA_SERV=netbackup_master_server_name';
BACKUP DATABASE INCREMENTAL LEVEL= 0 FORMAT 'u%ROMDB_FULL_LEVEL_0.bkp' plus
ARCHIVELOG DELETE INPUT;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
}
Now we will have an incremental cumulative database level 1 backup script. The following script performs an
incremental cumulative backup to back up a database and archive logs together. Of course, the logs will be removed
after the backup:
--- rondb_incr_db_bkp.sh
--- RONDB RMAN ONLINE INCREMENTAL DATABASE BACKUP, LEVEL 1
rman{
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' CONNECT sys/password@rondb_1;
ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE' CONNECT sys/password@rondb_2;
SEND 'NB_ORA_CLIENT=host_name,NB_ORA_POLICY=RONDB_FULL_LEVEL0,NB_ORA_SERV=netbackup_master_server_name';
BACKUP DATABASE INCREMENTAL LEVEL= 1 CUMULATIVE FORMAT
'u%RONDB_FULL_LEVEL_0.bkp' plus ARCHIVELOG DELETE INPUT;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
}
Having developed a full and incremental database backup, we typically schedule full database level 0 backup
once a week followed by the incremental backup for the rest of the week. You can schedule the jobs through
netbackup, in the crontab on a Unix platform, and so on.
If the application is highly OLTP and the database is tending to generate a huge number of archived logs, you
may also develop a separate script scheduled at regular intervals to back up the archived logs and remove them after
backup to avoid a database hang situation due to a lack of space left for archiving.
You should alter the preceding scripts to suit your environment and schedule the backup policy as per your
organizational standards.
Restore a RAC Database to a Single-Instance Database
Notwithstanding clustered or nonclustered, the database restore procedure remains the same. However, the following
additional post-database restore steps need to be carried out on the single-instance database after opening the database:
Proceed with disabling additional instances thread and remove redo groups.
SQL> SELECT instance,thread#,status,enabled FROM v$thread;
SQL> SELECT instance,group# FROM v$log WHERE thread=<thread_number>;
SQL> SELECT tablespace_name,contents FROM dba_tablespaces WHERE contents = 'UNDO';
 
Search WWH ::




Custom Search