05-08-2008
Seek UNIX script tutor and help
I am new to UNIX shell script programming. I have coded one korn shell script used on solaris 10 for Oracle database rman cold backup. The first part of script is working. But only following part is not working. Please help me to point out the problem and errors in my code. Thanks a lot.
# the first part has been omitted.
# Started to shutdown database and startup database mount for cold backup .
${ORACLE_HOME}/bin/sqlplus -s << EOF
conn / as sysdba
shutdown immediate;
${ORACLE_HOME}/bin/sqlplus -s << EOF
conn / as sysdba
startup mount;
# The above part works, then script stop here.
exit
rman NOCATALOG <<EOF
CONNECT TARGET SYS/$SYS_PASSWORD@$ORACLE_SID
if [ $? = 0 -o $? = 2 ]
then date +"%D %T: backup process started." >> pdedev$BACKUP_DAY.LOG
else date +"%D %T: Error start rman to do backup." >> pdedev$BACKUP_DAY.LOG
exit 1
fi
RUN
{
ALLOCATE CHANNEL ch1 DEVICE TYPE DISK
FORMAT = '$BACKUP_FOLDER/%d_DB_%u_%s_%p' MAXPIECESIZE 5G;
BACKUP DATABASE PLUS ARCHIVELOG DELETE ALL INPUT;
RELEASE CHANNEL ch1;
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
}
if [$? = 0]
then date +"%D %T: Rman backup successful." >> $BACKUP_DAY.LOG
echo "" >> $BACKUP_DAY.LOG
else date +"%D %T: Rman backup not successful." >> $BACKUP_DAY.LOG
date +"%D %T: Exiting script." >> $BACKUP_DAY.LOG
exit 1
fi
# Open database
${ORACLE_HOME}/bin/sqlplus -s << EOF
conn / as sysdba
alter database open;
echo " database $ORACLE_SID is up running." >> $BACKUP_DAY.LOG
exit
EOF
Last edited by duke0001; 05-09-2008 at 01:28 PM..
7 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have written a script to run on UNIX server. When I tested, it always hanged on after "date +"%D %T: XXXXXX script started." part. Then it wouldn't go further. UNIX server gave me one error message. I used the same code in another script. It works fine. I think the major problem may be in... (3 Replies)
Discussion started by: duke0001
3 Replies
2. Solaris
I am looking to enter into the IT field and i'm very interestd in the Solaris 10 OS.
Apart from shelling out outrageous sums to companies based here in the UK, I would appreciate any other advise on how to go about studying, understanding and certifiying in Solaris 10.
I have tried to install... (1 Reply)
Discussion started by: kress2m1
1 Replies
3. AIX
hello
i'm working with aix 5.3 hacmp 5.4 P550 and P520
those two serevr every 10 seconds seek connection to the internet web.
i check with sniffer software and i've got this details.
the problem is that when i've problem with the internet those server get frizzzzzzz. on those servers running... (0 Replies)
Discussion started by: ariec
0 Replies
4. UNIX for Advanced & Expert Users
I want to seek to a location on the hard drive that will be written to that is different from the output block size. Is this possible? It seems the man page implies you can only seek in increments of the number of bytes you output.
A bit of information about what I'm trying to do, if that... (6 Replies)
Discussion started by: silvermoon
6 Replies
5. UNIX for Dummies Questions & Answers
Seek help configuring Sendmail 8.14.4 Unix server.
Not sure if this is the correct place to post or the Unix/Linux Forums job board. Seeking help configuring sendmail 8.14.4 on my Unix server. It appears I have an open relay. I was advised I need to modify a etc/mail/dir , a command line entry... (0 Replies)
Discussion started by: raecampus
0 Replies
6. Emergency UNIX and Linux Support
I want to delete archivelog files that has been archived and applied from primary database
to standby database. This piece of script is working in Linux server. However, I copy it to
Unix server with tiny modification. It won't work and generate the error message. I have checked
code carefullt... (8 Replies)
Discussion started by: duke0001
8 Replies
7. Shell Programming and Scripting
Hi,
i like to know if any of the forum member happens to know any good tutor who is willing to provided on-line help to my scripting skills?
jared (5 Replies)
Discussion started by: Jared
5 Replies
LEARN ABOUT DEBIAN
condor_preen
condor_preen(1) General Commands Manual condor_preen(1)
Name
condor_preen remove - extraneous files from Condor directories
Synopsis
condor_preen [-mail] [-remove] [-verbose]
Description
condor_preenexamines the directories belonging to Condor, and removes extraneous files and directories which may be left over from Condor
processes which terminated abnormally either due to internal errors or a system crash. The directories checked are the LOG , EXECUTE ,
and SPOOL directories as defined in the Condor configuration files. condor_preenis intended to be run as user root or user condor peri-
odically as a backup method to ensure reasonable file system cleanliness in the face of errors. This is done automatically by default by
the condor_masterdaemon. It may also be explicitly invoked on an as needed basis.
When condor_preencleans the SPOOL directory, it always leaves behind the files specified in the configuration variable VALID_SPOOL_FILES
as given by the configuration. For the LOG directory, the only files removed or reported are those listed within the configuration vari-
able INVALID_LOG_FILES list. The reason for this difference is that, in general, the files in the LOG directory ought to be left alone,
with few exceptions. An example of exceptions are core files. As there are new log files introduced regularly, it is less effort to specify
those that ought to be removed than those that are not to be removed.
Options
-mail
Send mail to the user defined in the PREEN_ADMIN configuration variable, instead of writing to the standard output.
-remove
Remove the offending files and directories rather than reporting on them.
-verbose
List all files found in the Condor directories, even those which are not considered extraneous.
Exit Status
condor_preenwill exit with a status value of 0 (zero) upon success, and it will exit with the value 1 (one) upon failure.
Author
Condor Team, University of Wisconsin-Madison
Copyright
Copyright (C) 1990-2012 Condor Team, Computer Sciences Department, University of Wisconsin-Madison, Madison, WI. All Rights Reserved.
Licensed under the Apache License, Version 2.0.
See the Condor Version 7.8.2 Manualor http://www.condorproject.org/licensefor additional notices. condor-admin@cs.wisc.edu
September 2012 condor_preen(1)