Script for Export backup!!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script for Export backup!!
# 8  
Old 03-07-2012
Thank you Anchal for update.

I tried this code manually seems grep is not working ..
Code:
[oracle@prodb dump]$  egrep -q "ORA-|Linux-x86_64 Error|stopped|Failed" failelog07032012.log
[oracle@prodb dump]$ grep -i ORA- failelog07032012.log
ORA-31693: Table data object "PRODUCTION1"."TR33MTH2" failed to load/unload and is being skipped due to error:
ORA-19502: write error on file "/home/oracle/dump/07032012.dmp", blockno 162017 (blocksize=4096)
ORA-27072: File I/O error
ORA-31693: Table data object "PRODUCTION1"."CF89LOG" failed to load/unload and is being skipped due to error:
ORA-19502: write error on file "/home/oracle/dump/07032012.dmp", blockno 162273 (blocksize=4096)
ORA-27072: File I/O error
ORA-31693: Table data object "PRODUCTION1"."CF01OLAY" failed to load/unload and is being skipped due to error:
ORA-19502: write error on file "/home/oracle/dump/07032012.dmp", blockno 162529 (blocksize=4096)
ORA-27072: File I/O error
ORA-31693: Table data object "PRODUCTION1"."IV33DETAIL" failed to load/unload and is being skipped due to error:
ORA-19502: write error on file "/home/oracle/dump/07032012.dmp", blockno 162785 (blocksize=4096)
ORA-27072: File I/O error
ORA-31693: Table data object "PRODUCTION1"."GL13IMPORT" failed to load/unload and is being skipped due to error:
ORA-19502: write error

can you confirm me codes is correct?
Code:
egrep -q "ORA-|Linux-x86_64 Error|stopped|Failed" $LOG_FILE
if [ $? -eq 0 ]; then
uuencode $LOGFILE expdb_$CDATE | mail -s "$HOST_NAME:$SID Export backup success on `CDATE`" $ADMIN_EMAIL   
#update logfile----? wat i have to mention.
else
 #uuencode $LOGFILE expdb_$CDATE | mail -s "$HOST_NAME:$SID Export backup Failed on `CDATE`" $ADMIN_EMAIL   
 #update logfile----?wat i have to mention.
fi


Thanks you,
Fareed.

Last edited by Franklin52; 03-07-2012 at 06:13 AM.. Reason: Please use code tags for code and data samples, thank you
Mohammed Fareed
# 9  
Old 03-07-2012
-q is for [q]uiet mode. That doesn't output the matched records.
If you do want to check, re-run the command without -q option.

---------- Post updated at 16:06 ---------- Previous update was at 16:02 ----------

Quote:
egrep -q "ORA-|Linux-x86_64 Error|stopped|Failed" $LOG_FILE
if [ $? -eq 0 ]; then
uuencode $LOGFILE expdb_$CDATE | mail -s "$HOST_NAME:$SID Export backup success on `CDATE`" $ADMIN_EMAIL
#update logfile----? wat i have to mention.
else
#uuencode $LOGFILE expdb_$CDATE | mail -s "$HOST_NAME:$SID Export backup Failed on `CDATE`" $ADMIN_EMAIL
#update logfile----?wat i have to mention.
fi

The command will return 0 if it finds the matches (eg.errors in your case)
I guess you should revert the if/else cases. (as I mentioned in my previous post)
# 10  
Old 03-07-2012
Great Help!!! I'm finally i made this possible with the help of you,Thank you Anchal Khare!! I Apprecatied if you allow me in your Add list of this Group.
Mohammed Fareed
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Export Error in Shell script

All, While executing the bellow commnad after the sed, awk command to export the value to, i am getting the fallowing error. line="_AABBB.EEEEEEE.LOG4JDISPLAY.PATH_=/apps/opt/abcde/pdstdsd/esapp/apadsfasdf/logadsfasdf.xml" keystring=`echo $line | awk -F"=" '{ print $1 }'`... (1 Reply)
Discussion started by: jothi basu
1 Replies

2. Shell Programming and Scripting

Help with Backup Shell Script for Network Device Configuration backup

HI all, im new to shell scripting. need your guidence for my script. i wrote one script and is attached here Im explaining the requirement of script. AIM: Shell script to run automatically as per scheduled and backup few network devices configurations. Script will contain a set of commands... (4 Replies)
Discussion started by: saichand1985
4 Replies

3. Shell Programming and Scripting

export repository shell script

Hi Forum, I have script to export he Siebel repository. My requirment is to have a shell script in place so when placed in it in a cron it should generate the repsoitory dat file on date basis. Script for export: repimexp /a E /c UCM_ES_DEV2_DSN /u sadmin /p SADMIN /d siebel /r... (4 Replies)
Discussion started by: nuthakki
4 Replies

4. Shell Programming and Scripting

rsync backup mode(--backup) Are there any options to remove backup folders on successful deployment?

Hi Everyone, we are running rsync with --backup mode, Are there any rsync options to remove backup folders on successful deployment? Thanks in adv. (0 Replies)
Discussion started by: MVEERA
0 Replies

5. Shell Programming and Scripting

Export from perl script

Hi, Want to initaite the Oracle's Export utility from the perl script,but getting error as mentioned below: Script #!/usr/bin/perl -w my $username="system"; my $password = "manager"; my $tns = "DBLOCAL"; exp $username/$password@$tns Error $ ./testexp.pl Array found where... (4 Replies)
Discussion started by: milink
4 Replies

6. Shell Programming and Scripting

Use of export from a shell script..

Hi All, I am facing a problem while trying to export path variables from a script. Here's my situation 1. I have a script in which i have defined all the path variables to be exported: export ORACLE_HOME=/path/to/bin/ export NG_USER_HOME=/path/to/bin/ etc.... 2. I have another shell... (4 Replies)
Discussion started by: raghu_shekar
4 Replies

7. Shell Programming and Scripting

How to export an array to perl script?

hi all...... i want to use an array ,declared in bash, in embedded perl script. is there any way to export whole array so that i can use it '$ENV{}' or something.. thanx in advance!! regards, prayush (1 Reply)
Discussion started by: tprayush
1 Replies

8. UNIX for Dummies Questions & Answers

export script commands with xterm

I am attempting to write a shell script that runs a program which generates data and then runs another program to plot the data. The problem is that I need the plotting to take place in a different terminal window that stays open after the plotting has finished. I have experimented 'xterm -e '... (1 Reply)
Discussion started by: chris2051
1 Replies

9. Shell Programming and Scripting

script to export variables

Hi, I am a newbie to unix as well as scripting. I need to write a script, which on execution sets the necessay oracle variables. Can someone help me out as to how to proceed? also can u suggest good tutorial for bash/shell scripting? thanks (1 Reply)
Discussion started by: aboxilica
1 Replies

10. UNIX for Advanced & Expert Users

export UNIX95=1 in a script??

Hi, I have following script. It has a line export UNIX95=1 What does UNIX95 suggest? If I donot export UNIX95=1 , I get error "illegale option -o" for ps command. man ps donot show -o option. Any pointers?? Thanks in advance, -Ashish (2 Replies)
Discussion started by: shriashishpatil
2 Replies
Login or Register to Ask a Question