Write whatever error in log file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Write whatever error in log file
# 1  
Old 06-19-2014
Write whatever error in log file

Hi all,

I have
Code:
export LOG_FILE=$HOME_DIR/error.log
sqlplus -s /nolog << EOF
whenever sqlerror exit sql.sqlcode
@$HOME_DIR/connect.sql
whenever sqlerror exit sql.sqlcode 
@$SQL_FILE
EOF

can display the sql error in putty, how can I write them into log file ?Smilie

Last edited by Franklin52; 06-19-2014 at 10:41 AM.. Reason: Please use code tags
# 2  
Old 06-19-2014
Do
Code:
sqlplus -s /nolog << EOF
spool error.log
whenever sqlerror exit sql.sqlcode
@$HOME_DIR/connect.sql
whenever sqlerror exit sql.sqlcode 
@$SQL_FILE
spool off;
EOF

This User Gave Thanks to Makarand Dodmis For This Post:
# 3  
Old 06-20-2014
Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ksh: How to write the log file simultaneously when .sql file executes by UNIX process

Hello Team- we would like to implement an approach which has to write the log file simultaneously when .sql file is executing by Unix process. At present,it is writing the log file once the process is completed. I've tested the current process with the below approaches and none of them... (1 Reply)
Discussion started by: Hima_B
1 Replies

2. Shell Programming and Scripting

Write log file for SFTP command

Hi I am transferring files to SFTP Server using sftp command(below), and want to write log file of this activity. Can you please advise if i am doing wrong. sftp -v -oIdentityFile=/home/bbm_user/bbm/private_open_ssh.ppm umf-sftp@bbm-prod-send.com <<EOF put $local_path/*.gz $remote_path/... (3 Replies)
Discussion started by: cnrj
3 Replies

3. Shell Programming and Scripting

Write out specific data from log to a new file

I got a huge log in zipped files, i need to write out lines by specific data and if the line with the same contains XML message with the same sessionID will be written to the file to. The log structure: 2013-08-16 16:31:06,810 ( 122: rogate) INFO - UId:10453, GId:5422: new... (16 Replies)
Discussion started by: batka
16 Replies

4. Shell Programming and Scripting

How to write a new entry at the beginning of a log file instead of at the end?

Hi Ladies and Gents, Explanation of my question with an example: Let's consider the script: backup_every_hour.sh #!/bin/bash rsync -auv $dir $backup_dir >> backup_every_hour_script.log Each time this script is called there will be a new entry at the end of the file... (1 Reply)
Discussion started by: freddie50
1 Replies

5. Shell Programming and Scripting

Multiple process write to same log file at the same time

If we have 3 process to write to same log file at the same time like below. will it cause the data outdated because the multiple process writing same time? It this a safe way to keep the log for multiple process? p1 >> test.log &; p2 >> test.log &; p3 >> test.log & Thanks, (5 Replies)
Discussion started by: casttree
5 Replies

6. UNIX for Advanced & Expert Users

Multiple processes write to log file at the same time

If we have 3 process to write to same log file at the same time like below. will it cause the data outdated because the multiple process writing same time? It this a safe way to keep the log for multiple process? p1 >> test.log &; p2 >> test.log &; p3 >> test.log & Thanks, (1 Reply)
Discussion started by: casttree
1 Replies

7. Solaris

fssnap error :snapshot error: File system could not be write locked

Hi Guys. This is part of my filesystem structure : Filesystem size used avail capacity Mounted on /dev/md/dsk/d0 47G 5.2G 42G 12% / /devices 0K 0K 0K 0% /devices ctfs 0K 0K 0K 0% ... (2 Replies)
Discussion started by: aggadtech08
2 Replies

8. Shell Programming and Scripting

Count number of Nodes created and write it to a Log file

Dear Experts, I have to count the number of AddressRecords formed in bbc.xml file using unix script file. For example: for below pasted file, I need to write an output to a log file as "No. of Address Records Created=4". Snippet of bbc.xml:- <?xml version="1.0" encoding="UTF-8" ?> -... (1 Reply)
Discussion started by: phani333
1 Replies

9. Shell Programming and Scripting

shell script to remove old files and write to a log file

Hi, I have a script that works on a unix box but am trying to get it working on a linux box that uses shell. I am not a programmer so this is proving harder than I imagined. I made some changes and ended up with the script below but when I run it I get the following messages. Any help would be... (4 Replies)
Discussion started by: yabai
4 Replies

10. Shell Programming and Scripting

how to write stderr in a subroutine log file?..

perl 5.6.1 in win2000: my program uses a subroutine which will write log file. i will call that sub routine like this &log_message("the file $inputfile opened"); what should i do to write the stderr on the same log file itself.. i tried to pass the stderr to the subroutine like ... (1 Reply)
Discussion started by: sekar sundaram
1 Replies
Login or Register to Ask a Question