#!/bin/ksh
. ~/.profile
##
## script name : restore_spfile_from_tape.ksh
## Author : Ramakrishna Nemani
##
## Purpose :
## This script is for restoring the spfile from tape to default location.
##
## Note :
## You have to replace DBID value with the DBID that you are attempting to restore the spfile for.
## You have to modify sbt settings to suit your environment.
## To execute this script You need login as a unix id that belongs to DBA group.
## I have tested this script on UNIX/LINUX platform using Oracle 10g. Use it at your own risk.
##
## This is an example or sample script
##
export ORACLE_SID=slsd
rman << EOF > ./rstr_spfile_from_tape.log
CONNECT TARGET /
STARTUP FORCE NOMOUNT;
##
## set dbid because we are not using an rman catalog
##
SET DBID 3183102432 ;
##
## Specify AUTOBACKUP Format
##
SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F';
##
## Restore spfile from autobackup first
##
RUN {
ALLOCATE CHANNEL tape_1 DEVICE TYPE sbt
PARMS 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)'
FORMAT '%u_%p_%c' ;
RESTORE SPFILE FROM AUTOBACKUP ;
}
##
## Restart the database with newly restored SPFILE
##
SHUTDOWN IMMEDIATE;
STARTUP ;
EOF




No comments:
Post a Comment