Environment variable not evaluated in rman [message #486749] |
Mon, 20 December 2010 01:11 |
jimit_shaili
Messages: 237 Registered: June 2006 Location: India, Ahmedabad
|
Senior Member |
|
|
Dear Friends
I m facing problem of os environment variables not evaluated in rman scripts. Here below i'm displaying my try. please suggest/correct me where i made mistake.
[oracle1@WBH-DB1 smbshare]$ export BACKUP_DIR=/home/myrman/backup
[oracle1@WBH-DB1 smbshare]$ echo $BACKUP_DIR
/home/myrman/backup
[oracle1@WBH-DB1 smbshare]$ rman target sys/devadmin@mydata.wbh-db1 catalog rman_cat/rman_cat@myrman.wbh-db1
Recovery Manager: Release 11.2.0.1.0 - Production on Mon Dec 20 12:32:35 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: MYDATA (DBID=2873395220)
connected to recovery catalog database
RMAN> run {
backup
format '$BACKUP_DIR/rman_CTL__%d.%U.bak'
(current controlfile);
}
Starting backup at 20-DEC-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=68 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 20-DEC-10
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 12/20/2010 12:33:
09
ORA-07217: sltln: environment variable cannot be evaluated.
RMAN>
Regards
Jimit
|
|
|
|
Re: Environment variable not evaluated in rman [message #486763 is a reply to message #486755] |
Mon, 20 December 2010 02:29 |
jimit_shaili
Messages: 237 Registered: June 2006 Location: India, Ahmedabad
|
Senior Member |
|
|
Dear Michel
Actually i have created one .sh file which is as below, i incorporate your suggestion, but still it giving me some other error. Which may be different from earlier one.
RmanBackup.sh file
echo "setting variables"
export ORACLE_SID=myrman
export TDAY=`date +%Y-%m-%d`
export BACKUP_DIR=/home/myrman/backup
export LOGFILE=$BACKUP_DIR/RmanBackup$TDAY.log
echo "end of setting variables"
echo "Backup Started at `date` \n" >$LOGFILE
echo "ORACLE_SID = "$ORACLE_SID
rman <<EOF
connect target sys/devadmin@mydata.wbh-db1
connect catalog rman_cat/rman_cat@myrman.wbh-db1
run {
backup
format '$BACKUP_DIR/rman_CTL__%d.%U.bak'
(current controlfile);
}
exit
EOF
echo "Backup Finished at `date` \n" >>$LOGFILE
Calling RmanBackup.sh file
[oracle1@WBH-DB1 smbshare]$ ./RmanBackup.sh
setting variables
end of setting variables
: No such file or directoryome/myrman/backup
ORACLE_SID = myrman
Recovery Manager: Release 11.2.0.1.0 - Production on Mon Dec 20 13:51:29 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
RMAN>
connected to target database: MYDATA (DBID=2873395220)
RMAN>
connected to recovery catalog database
RMAN> 2> 3> 4> 5>
Starting backup at 20-DEC-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 20-DEC-10
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 12/20/2010 13:51:
37
/rman_CTL__MYDATA.4vm01kn7_1_1.bak"home/myrman/backup
ORA-27040: file create error, unable to create file
Linux Error: 2: No such file or directory
RMAN>
Recovery Manager complete.
: No such file or directoryhome/myrman/backup
Directory exists
[oracle1@WBH-DB1 smbshare]$ ll -ltrh /home/myrman/backup/
total 0
Please suggest me,what i m missing
Regards
Jimit
Reg
[Updated on: Mon, 20 December 2010 02:30] Report message to a moderator
|
|
|
|
|
|
Re: Environment variable not evaluated in rman [message #486774 is a reply to message #486771] |
Mon, 20 December 2010 03:33 |
jimit_shaili
Messages: 237 Registered: June 2006 Location: India, Ahmedabad
|
Senior Member |
|
|
Dear Michel
i have tried to once again to set all the parameter's but it still gives me an error. here i'm giving your required output. Also i have given full rights the that folder. such as
chmod -R 777 /home/myrman/backup/
[oracle1@WBH-DB1 smbshare]$ ll -ltrh $BACKUP_DIR
total 0
Regards
Jimit
|
|
|
|
Re: Environment variable not evaluated in rman [message #486795 is a reply to message #486778] |
Mon, 20 December 2010 05:36 |
jimit_shaili
Messages: 237 Registered: June 2006 Location: India, Ahmedabad
|
Senior Member |
|
|
Dear Michel
It was my mistake,i forget quotes. Here once again i m displaying my try.
RmanBackup.sh file
echo "setting variables"
export ORACLE_SID=myrman
export TDAY=`date +%Y-%m-%d`
export BACKUP_DIR=/home/myrman/backup
export LOGFILE=$BACKUP_DIR/RmanBackup$TDAY.log
echo "end of setting variables"
echo "Backup Started at `date` \n" >$LOGFILE
rman <<EOF
connect target sys/devadmin@mydata.wbh-db1
connect catalog rman_cat/rman_cat@myrman.wbh-db1
run {
backup
format '$BACKUP_DIR/rman_CTL__%d.%U.bak'
(current controlfile);
}
exit
EOF
echo "Backup Finished at `date` \n" >>$LOGFILE
Run RmanBackup.sh file
[oracle1@WBH-DB1 smbshare]$ ./RmanBackup.sh
setting variables
end of setting variables
: No such file or directoryome/myrman/backup
Recovery Manager: Release 11.2.0.1.0 - Production on Mon Dec 20 17:02:49 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
RMAN>
connected to target database: MYDATA (DBID=2872293250)
RMAN>
connected to recovery catalog database
RMAN> 2> 3> 4> 5>
Starting backup at 20-DEC-10
starting full resync of recovery catalog
full resync complete
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=132 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 20-DEC-10
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 12/20/2010 17:02:
58
/rman_CTL__MYDATA.5sm01vu1_1_1.bak"home/myrman/backup
ORA-27040: file create error, unable to create file
Linux Error: 2: No such file or directory
RMAN>
Recovery Manager complete.
: No such file or directoryhome/myrman/backup
Listing the Backup_Dir
[oracle1@WBH-DB1 smbshare]$ ll -ltrh "BACKUP_DIR"
ls: BACKUP_DIR: No such file or directory
Regards
Jimit
[Updated on: Mon, 20 December 2010 05:39] Report message to a moderator
|
|
|
|
Re: Environment variable not evaluated in rman [message #486803 is a reply to message #486798] |
Mon, 20 December 2010 06:15 |
jimit_shaili
Messages: 237 Registered: June 2006 Location: India, Ahmedabad
|
Senior Member |
|
|
Sorry Michel
I'm frustrated by all this, i have tried various things and not succeeded. I'm doing some silly mistake but not getting it for whole day. Laughing on my own. sorry again and pasting the result.
[oracle1@WBH-DB1 smbshare]$ ll -ltrh "$BACKUP_DIR"
ls: : No such file or directory
Regards
Jimit
|
|
|
|
Re: Environment variable not evaluated in rman [message #486810 is a reply to message #486807] |
Mon, 20 December 2010 06:31 |
jimit_shaili
Messages: 237 Registered: June 2006 Location: India, Ahmedabad
|
Senior Member |
|
|
Dear Michel
You are absolutely right,100% right. First i have created this file with vi editor and during modification i opened or created again with Utlraedit with windows machine. After your suggestion i delete the file and once again create with vi. It is working ok on first shot without any error. Thanks for your extended support.
Regards
Jimit
|
|
|
|
|
|