rman backup script not running?? [message #236664] |
Thu, 10 May 2007 10:43 |
shaseeb
Messages: 113 Registered: April 2007 Location: Madison, WI
|
Senior Member |
|
|
Hi all,
I have created an rman cold backup script and when I run it, it just hangs...I mean nothings happens. Here is my script and the output when I run it:
##########################
# RMAN Cold Backup Script
##########################
#!/bin/bash
date
set ORACLE_SID=fprcdev
echo "RMAN Cold Backup about to begin for $ORACLE_SID ..."
rman
connect CATALOG rman/rman@fprccat
connect TARGET sys/passwd@fprcdev
run {
shutdown immediate
startup mount
allocate channel d1 type disk;
backup full
tag cold_backup
(database);
release channel d1;
alter database open
}
echo "RMAN Cold Backup for $ORACLE_SID is complete"
[oracle@rh-development scripts]$ ./backup_cold.sh
Thu May 10 10:36:54 CDT 2007
RMAN Cold Backup about to begin for FPRCDEV ...
|
|
|
|
|
Re: rman backup script not running?? [message #236678 is a reply to message #236664] |
Thu, 10 May 2007 11:05 |
shaseeb
Messages: 113 Registered: April 2007 Location: Madison, WI
|
Senior Member |
|
|
Oh ok. Well my database is 11GB. But does the script look ok?
Also, I did an RMAN backup manually (i.e. gave the BACKUP DATABASE command from the rman prompt) 2 days ago and the whole things was done in less than 1 minute (47 secs).
I can try it I guess after hours and see if it makes a difference.
|
|
|
|
Re: rman backup script not running?? [message #236691 is a reply to message #236686] |
Thu, 10 May 2007 11:24 |
shaseeb
Messages: 113 Registered: April 2007 Location: Madison, WI
|
Senior Member |
|
|
Ok. Well, we are not doing online backups because it's a dev environment. It's weird right now because this dev is the prod too. We are building the dev, stag and prod environments right now.
But thanks for your help all. I will try the backup after hours and if it still doesn't work then I shall post something.
Just a quick question. Can I put in comments with echo inside the RMAN script?
like
run{
echo "Database is shutting down"
shutdown immediate
echo "Database has been shutdown successfully"
..
..
[Updated on: Thu, 10 May 2007 11:24] Report message to a moderator
|
|
|
|
|
|
|
Re: rman backup script not running?? [message #236991 is a reply to message #236734] |
Fri, 11 May 2007 09:20 |
shaseeb
Messages: 113 Registered: April 2007 Location: Madison, WI
|
Senior Member |
|
|
Ok, I ran the script yesterday and it dodn't run. However, I think that I have figured out part of the problem. For some reason it is not going to the next line it my script. Here is my modified script;
##########################
# RMAN Cold Backup Script
##########################
#!/bin/bash
date
ORACLE_SID=fprcdev; export ORACLE_SID
export ORACLE_HOME
echo "RMAN Cold Backup about to begin for $ORACLE_SID ..."
$ORACLE_HOME/bin/rman - - - - - it is not executing below this line
connect CATALOG rman/rman@fprccat
connect TARGET sys/passwd@fprcdev
run {
shutdown immediate
startup mount
backup full database;
alter database open
}
echo "RMAN Cold Backup for $ORACLE_SID is complete"
[oracle@rh-development scripts]$ ./backup_cold.sh
Fri May 11 09:16:16 CDT 2007
RMAN Cold Backup about to begin for fprcdev ...
Recovery Manager: Release 10.2.0.3.0 - Production on Fri May 11 09:16:16 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
RMAN>
[Updated on: Fri, 11 May 2007 09:21] Report message to a moderator
|
|
|
|
Re: rman backup script not running?? [message #236996 is a reply to message #236993] |
Fri, 11 May 2007 09:49 |
shaseeb
Messages: 113 Registered: April 2007 Location: Madison, WI
|
Senior Member |
|
|
I'm almost there...It connected to both the target and catalog databases. But now I'm getting a syntax error:
#!/bin/bash
date
ORACLE_SID=fprcdev; export ORACLE_SID
export ORACLE_HOME
echo "RMAN Cold Backup about to begin for $ORACLE_SID ..."
$ORACLE_HOME/bin/rman <<EOF
connect CATALOG rman/rman@fprccat
connect TARGET sys/passwd@fprcdev
run {
shutdown immediate
startup mount
backup full database;
alter database open
}
EOF
echo "RMAN Cold Backup for $ORACLE_SID is complete"
[oracle@rh-development scripts]$ ./backup_cold.sh
Fri May 11 09:45:34 CDT 2007
RMAN Cold Backup about to begin for fprcdev ...
Recovery Manager: Release 10.2.0.3.0 - Production on Fri May 11 09:45:34 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
RMAN>
connected to recovery catalog database
RMAN>
connected to target database: FPRCDEV (DBID=3921599547)
RMAN> 2> 3> 4> 5> 6>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "}": expecting one of: "resetlogs, ;"
RMAN-01007: at line 6 column 1 file: standard input
RMAN>
Recovery Manager complete.
RMAN Cold Backup for fprcdev is complete
|
|
|
|
|