Sponsored Content
Special Forums UNIX and Linux Applications Execute Oracle pl/sql commands in a scrit using nohup Post 303009105 by jim mcnamara on Friday 8th of December 2017 09:38:51 PM
Old 12-08-2017
You have made the process hard to debug and to maintain.

First off spool files have limitations as to number of lines, for example.
Are you really expecting 10000 lines of output? I would consider using something like at
to run, logon as user oracle, then:
[code]
Code:
at -m now <<!
sqlplus /
set echo on verify on feedback 1 timing on time on pages 10000 lines 132 trimspool on tab off flush off
/
WHENEVER SQLERROR CONTINUE
set echo on verify on feedback 1 timing on time on pages 10000 lines 132 trimspool on tab off flush off
@install_1_0.sql
disconnect
!

Why? possibly because you have an error condition that generates tons of garbage.

But oracle user gets notified when the job ends - email - and you do not create a gigantic file except in /var/mail (or wherever mail text is stored in your system).
You may also want to edit the .sql file to remove a lot of chatty output. Otherwise your problems are lost in a sea of junk notifications.

BTW: if you are getting all of those ORA notifications (the ones you grep -v) your script or your data need to be looked at carefully. A script should throw one fatal error then abort not keep on running. Otherwise you run the risk of corrupting indexes, creating orphans and so on. Example ORA-01921 deals with junk/bogus roles in a connect string. That should never happen. Why would a process need to keep connecting to new db's if it is designed correctly? Aside from that fact, it is a huge overhead.

Last edited by jim mcnamara; 12-08-2017 at 10:45 PM..
 

9 More Discussions You Might Find Interesting

1. AIX

how can i install sqlplus and execute some sql commands

hi everybody, i am Talip, a begginner at unix based systems and i have a problem (actually, we may think myself as the problem, in this situation). i am not sure if this is the correct platform for my questions. if it is not please forgive me about this inappropriate mail. what i have: *... (2 Replies)
Discussion started by: talipk
2 Replies

2. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

3. Shell Programming and Scripting

using mutiple "nohup" to execute multiple commands.

I need to run multiple commands on remote server using the nohup... I have tried 2 options 1) rsh <SERVER_NAME> -n "nohup perl $SCRIPTS_DIR/abc.pl ; $SCRIPTS_DIR/xyz.ksh & " & 2) rsh <SERVER_NAME> -n "nohup perl $SCRIPTS_DIR/abc.pl & nohup $SCRIPTS_DIR/xyz.ksh & " & I need to know if... (2 Replies)
Discussion started by: aster007
2 Replies

4. Shell Programming and Scripting

Execute Script using nohup and &

Hi all, I have one script test.sh for which I pass two arguments. In the same script I need to submit this script in background using nohup. My script like this and it is working in HP-UX os but not Solaris. #! /bin/sh if then MTR_PID=$$ export MTR_PID echo "test.sh $1 $2... (3 Replies)
Discussion started by: sridhar_423
3 Replies

5. UNIX for Dummies Questions & Answers

Execute PL/SQL function from Unix script (.sql file)

Hi guys, I am new on here, I have a function in oracle that returns a specific value: create or replace PACKAGE BODY "CTC_ASDGET_SCHED" AS FUNCTION FN_ASDSCHEDULE_GET RETURN VARCHAR2 AS BEGIN DECLARE ASDSchedule varchar2(6); ASDComplete... (1 Reply)
Discussion started by: reptile
1 Replies

6. Shell Programming and Scripting

using nohup with set of commands

hi I want to use nohup command with set of commands .. my goofy sample : nohup while true do ; date; done and its not working . any idea ? cheers (1 Reply)
Discussion started by: kvok
1 Replies

7. Shell Programming and Scripting

Execute multiple SQL scripts from single SQL Plus connection

Hi! I would like to do a single connection to sqlplus and execute some querys. Actually I do for every query one connection to database i.e echo 'select STATUS from v$instance; exit' > $SQL_FILE sqlplus user/pass@sid @$SQL_FILE > $SELECT_RESULT echo 'select VERSION from v$instance;... (6 Replies)
Discussion started by: guif
6 Replies

8. UNIX for Dummies Questions & Answers

How to use 'nohup' and 'at' commands collectively?

I have a unix script named 'test1' and it can be run using parameters say a, b and c. i.e. the command would be test1 -a -b -c this script gives the output in the log file as script started start time: 10.22 pm 7 april end time: 10.30 pm 7 april script finished Now, i want to run... (3 Replies)
Discussion started by: swap21783
3 Replies

9. Linux

How to execute nohup cmd

Hi, nohup sar -u 10 $COUNT | awk 'NR>2 {$2=$4=$7="";}1' | tr -s ' ' '\t' 2>/dev/null >sar.out & i have execute above line from shell script .. but sar.out is created with ZERO bite size.. Help on that what is the problem here Thx, Mani (0 Replies)
Discussion started by: Mani_apr08
0 Replies
uucheck(1M)						  System Administration Commands					       uucheck(1M)

NAME
uucheck - check the uucp directories and permissions file SYNOPSIS
/usr/lib/uucp/uucheck [-v] [-x debug-level] DESCRIPTION
uucheck checks for the presence of the uucp system required files and directories. uucheck also does error checking of the Permissions file (/etc/uucp/Permissions). uucheck is executed during package installation. uucheck can only be used by the super-user or uucp. OPTIONS
The following options are supported: -v Give a detailed (verbose) explanation of how the uucp programs will interpret the Permissions file. -x debug-level Produce debugging output on the standard output. debug-level is a number from 0 to 9. Higher numbers give more detailed debugging information. FILES
/etc/uucp/Devices /etc/uucp/Limits /etc/uucp/Permissions /etc/uucp/Systems /var/spool/locks/* /var/spool/uucp/* /var/spool/uucppublic/* ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWbnuu | +-----------------------------+-----------------------------+ SEE ALSO
uucp(1C), uustat(1C), uux(1C), uucico(1M), uusched(1M), attributes(5) BUGS
The program does not check file/directory modes or some errors in the Permissions file such as duplicate login or machine name. SunOS 5.10 18 May 1993 uucheck(1M)
All times are GMT -4. The time now is 03:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy