I am using following script to take controlfile backup. I have used SID variable to hold "ffin1" value, which I again subsitute in "'/db/ffin1/home/oraffin1/$SID_$wdate.ctl'" command. Well, after running this, SID variable does not subsittue it's value, while wdate subsitute.
the file is "090711.ctl' after running the following script.
#!/usr/bin/ksh
SID=ffin1
wdate=`date '+%m%d%y'`
sqlplus /nolog <<-EOF
conn / as sysdba
alter database backup controlfile to '/db/ffin1/home/oraffin1/$SID_$wdate.ctl' ;
EOF
#!/usr/bin/ksh
SID=ffin1
echo $SID #to check the value of SID
wdate=`date '+%m%d%y'`
sqlplus /nolog <<-EOF
conn / as sysdba
alter database backup controlfile to "/db/ffin1/home/oraffin1/$SID_$wdate.ctl" ;
EOF
even then , it turns out of no use. thanks for your help, anyway.
ffin1> ./ctl_bkp.sh
SQL*Plus: Release 8.1.7.0.0 - Production on Wed Sep 7 06:09:47 2011
(c) Copyright 2000 Oracle Corporation. All rights reserved.
06:09:47 SQL> Connected.
06:09:47 SQL> alter database backup controlfile to "/db/ffin1/home/oraffin1/090711.ctl"
*
ERROR at line 1:
ORA-00972: identifier is too long
SQL> alter database backup controlfile to "/my/path/backup/cntrl_backup.ora";
alter database backup controlfile to "/my/path/backup/cntrl_backup.ora"
*
ERROR at line 1:
ORA-00972: identifier is too long
SQL> alter database backup controlfile to '/my/path/backup/cntrl_backup.ora';
Database altered.
SQL>
#!/usr/bin/ksh
SID=ffin1
echo $SID #to check the value of SID
wdate=$(
date '+%m%d%y'
)
sqlplus <<EOF
/ as sysdba
alter database backup controlfile to '/db/ffin1/home/oraffin1/${SID}_$wdate.ctl' ;
EOF