The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Command not found BigTool4u2 UNIX for Dummies Questions & Answers 2 03-08-2008 02:40 AM
cc command not found mishra_sk_in UNIX for Dummies Questions & Answers 4 08-14-2007 06:00 AM
how can i check in csh if command found or not found ? umen Shell Programming and Scripting 2 03-03-2007 07:38 PM
sh: Hello: command not found coolboarderguy Shell Programming and Scripting 2 06-24-2006 05:27 AM
xlf: command not found!!!! mzzt AIX 2 01-05-2006 05:19 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-08-2008
manna manna is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 40
Command not found

I ran the following script and it saying that sqlplus command not found. Please give me suggestions.

echo `date +%c` >> $LOG_FILE
echo "Database BACKUP starting." >> $LOG_FILE
ORACLE_HOME=/u01/app/oracle/product/10.2; export ORACLE_HOME
ORACLE_SID=SEED; export ORACLE_SID
PATH="$PATH:$ORACLE_HOME/bin"
sqlplus '/as sysdba' << EOF
shutdown immediate
exit EOF
if [ $? -eq 0 ]
then
echo "Database shut down." >> $LOG_FILE
echo "Previous Backup is being removed." >> $LOG_FILE
touch /u03/backups/abu/junk/ rm /u03/backups/abu/*

echo "Cold backup being performed." >> $LOG_FILE
cp -p -f -v /u01/oracle/admin/SEED/* /u03/backups/abu/nightly_backup/
cp -p -f -v /u02/oradata/SEED/* /u03/backups/abu/nightly_backup/
cp -p -f -v /u03/oradata/SEED/* /u03/backups/abu/nightly_backup/

echo "Cold backup of archive logs being performed." >> $LOG_FILE
mv -f -v /u01/app/oracle/product/10.2/dbs/arch/* /u03/backups/abu/nightly_backup/

echo "Restarting Database" >> $LOG_FILE
ORACLE_SID=SEED; export ORACLE_SID
$ORACLE_HOME/bin/sqlplus '/as sysdba' << EOF
startup
exit
EOF

if [ $? -eq 0 ]
then
echo "Database started up." >> $LOG_FILE
else
echo "Database will NOT start up." >> $LOG_FILE
fi

echo `date +%c` >> $LOG_FILE
echo "Database BACKUP has completed." >> $LOG_FILE
  #2 (permalink)  
Old 01-08-2008
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,245
Use code tags for code, it is in your own interest. Many poeple will not even read your post if you do not.
  #3 (permalink)  
Old 01-08-2008
manna manna is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 40
echo `date +%c` >> $LOG_FILE
echo "Database BACKUP starting." >> $LOG_FILE
ORACLE_HOME=/u01/app/oracle/product/10.2; export ORACLE_HOME
ORACLE_SID=SEED; export ORACLE_SID
PATH="$PATH:$ORACLE_HOME/bin"
sqlplus '/as sysdba' << EOF

shutdown immediate
exit EOF
if [ $? -eq 0 ]
then
echo "Database shut down." >> $LOG_FILE
echo "Previous Backup is being removed." >> $LOG_FILE
touch /u03/backups/abu/junk/ rm /u03/backups/abu/*

echo "Cold backup being performed." >> $LOG_FILE
cp -p -f -v /u01/oracle/admin/SEED/* /u03/backups/abu/nightly_backup/
cp -p -f -v /u02/oradata/SEED/* /u03/backups/abu/nightly_backup/
cp -p -f -v /u03/oradata/SEED/* /u03/backups/abu/nightly_backup/

echo "Cold backup of archive logs being performed." >> $LOG_FILE
mv -f -v /u01/app/oracle/product/10.2/dbs/arch/* /u03/backups/abu/nightly_backup/

echo "Restarting Database" >> $LOG_FILE
ORACLE_SID=SEED; export ORACLE_SID
$ORACLE_HOME/bin/sqlplus '/as sysdba' << EOF
startup
exit
EOF

if [ $? -eq 0 ]
then
echo "Database started up." >> $LOG_FILE
else
echo "Database will NOT start up." >> $LOG_FILE
fi

echo `date +%c` >> $LOG_FILE
echo "Database BACKUP has completed." >> $LOG_FILE
Quote:
Originally Posted by manna View Post
I ran the following script and it saying that sqlplus command not found. Please give me suggestions.

echo `date +%c` >> $LOG_FILE
echo "Database BACKUP starting." >> $LOG_FILE
OORACLE_HOME=/u01/app/oracle/product/10.2; export ORACLE_HOME
ORACLE_SID=SEED; export ORACLE_SID
PATH="$PATH:$ORACLE_HOME/bin"
sqlplus '/as sysdba' << EOF

startup
exit EOF
if [ $? -eq 0 ]
then
echo "Database shut down." >> $LOG_FILE
echo "Previous Backup is being removed." >> $LOG_FILE
touch /u03/backups/abu/junk/ rm /u03/backups/abu/*

echo "Cold backup being performed." >> $LOG_FILE
cp -p -f -v /u01/oracle/admin/SEED/* /u03/backups/abu/nightly_backup/
cp -p -f -v /u02/oradata/SEED/* /u03/backups/abu/nightly_backup/
cp -p -f -v /u03/oradata/SEED/* /u03/backups/abu/nightly_backup/

echo "Cold backup of archive logs being performed." >> $LOG_FILE
mv -f -v /u01/app/oracle/product/10.2/dbs/arch/* /u03/backups/abu/nightly_backup/

echo "Restarting Database" >> $LOG_FILE
ORACLE_SID=SEED; export ORACLE_SID
$ORACLE_HOME/bin/sqlplus '/as sysdba' << EOF
startup
exit
EOF

if [ $? -eq 0 ]
then
echo "Database started up." >> $LOG_FILE
else
echo "Database will NOT start up." >> $LOG_FILE
fi

echo `date +%c` >> $LOG_FILE
echo "Database BACKUP has completed." >> $LOG_FILE
  #4 (permalink)  
Old 01-08-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
You need to export that PATH variable for it to be used.
As reborg says, use CODE tags - it makes it much easier to read scripts etc as it protects formatting and prevents linewrapping etc.

[
Code:
]

your script

[

]

(but only one set or brackets instead of the two I've shown above)
  #5 (permalink)  
Old 01-08-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
Quote:
Originally Posted by Smiling Dragon View Post
You need to export that PATH variable for it to be used.
Have you tried this yet?
  #6 (permalink)  
Old 01-08-2008
manna manna is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 40
Yes, i exported the path variable. It says RMAN command not found.
Quote:
Originally Posted by Smiling Dragon View Post
Have you tried this yet?
  #7 (permalink)  
Old 01-08-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
So is rman on that path then?

If it is, run the script with the -x flag passed to the shell and post the output - use CODE tags for this please
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:06 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0