Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Problem running plsql & unix commands in 1 script Post 302091693 by siog on Wednesday 4th of October 2006 03:47:33 PM
Old 10-04-2006
Problem running plsql & unix commands in 1 script

Hi, I need help again. When I run this shell script, it only runs the unld_date.sql piece and exits. How can I structure this to run all the way to the end? When I don't have the unld_date.sql piece in here, everything runs fine from the date compare piece all the way to the end. Thanks in advance.


#!/bin/sh
#
sqlplus -s <<EOF username/password @/dir1/unld_date.sql > /dir2/dt_file.dat
exit 0
#
dt=`cat dt_file.dat`
today_dt=`date +%m%d%Y`
if [ "$dt" = "$today_dt" ]
then
#
# run pl/sql procedures 1 and 2
sqlplus -s <<EOF username/username @/dir3/code1.prc > /dir4/code1.log
@/dir3/code2.prc > /dir4/code2.log
exit
EOF
#
tail -10 /dir4/code1.log > log1.txt
tail -10 /dir4/code2.log > log2.txt
#
exit
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

calling plsql function in a unix script

Could anyone please help me. I have a function in plsql that returns a number. But i am listing some records through that function using DBMS_OUTPUT.PUT_LINE. I want to catch those records by executing this function through a unix script. The following shows what i did echo "Connected from... (2 Replies)
Discussion started by: cobroraj
2 Replies

2. Programming

Running UNIX Commands from C

Hi, -How can I get number of files, cpu usage (percentage), memory usage, disk usage, ...etc, using C program ... I can use unix command ( system(command) )but I want the value to be returned back to my C program to use it in my code? How can I do that? Thanks in advance ... (2 Replies)
Discussion started by: zainab
2 Replies

3. UNIX for Advanced & Expert Users

Calling unix script from sql or plsql

Hi Can anyone please let me know how to call unix scripts from sql or plsql ASAP. (2 Replies)
Discussion started by: ksailesh
2 Replies

4. Programming

UNIX Shell Script to Create a Document of a PLSQL code.

Hi All, I am supposed to present the documentation for the PLSQL code (PACKAGES, PROCEDURE, FUNCTIONS) of my application. There are sufficient comments in my code. Has anyone written any Shell Script Utility which can parse the PLSQL code and generate some kind of document ( preferrably HTML not... (1 Reply)
Discussion started by: gauravsachan
1 Replies

5. Programming

running PLSQL scripts through shell script

I am running the following ealth checks on my server there are two databases in my server . MODEL1 and MODEL2 i connect with the first database as sqlplus model1/password Then i exceute a query select x from table (4 Replies)
Discussion started by: asalman.qazi
4 Replies

6. Shell Programming and Scripting

Running multiple unix commands in a single script

Hi, I would like to write a script with include more than 6 unix commands. my script like below: echo " script started" ls -ld bdf | grep "rama" tail -10 log.txt ... .. ... now, i want to run above unix commands one by one. example: first the ls -ld command will be... (3 Replies)
Discussion started by: koti_rama
3 Replies

7. Shell Programming and Scripting

Running unix commands in a perl script

Executing two unix commads via perl script one after another e.g: make clean bsub -i -q short make have tried using exec but the second command doesnt executes (1 Reply)
Discussion started by: rajroshan
1 Replies

8. Shell Programming and Scripting

How to pass value from plsql script to unix bash?

Hi This is my bash script.i am calling validation.sql and passing a value to it using ${flds}. i want the cnt variable in plsql script to be passed to unix. LOADREC=`sqlplus -s $ORACLE_USR <<-EOF spool $ORACLE_LOG_FILE; echo "barani" @validation.sql #calling the plsql script ${flds}... (6 Replies)
Discussion started by: barani75
6 Replies

9. Shell Programming and Scripting

Problem running db2 commands in awk

Hi , I am trying to use the below in awk but failed, any one assist please, awk '{ print $0; if ( $0 ~ /LOADTMP1/ ) { print $4; Table_name=system($( db2 -x "SELECT TRIM(TD.BSCHEMA) || '.' || TRIM(TD.BNAME) AS TABLE_NAME FROM SYSCAT.TABDEP TD WHERE TD.BTYPE='T' AND... (2 Replies)
Discussion started by: Nandy
2 Replies

10. Shell Programming and Scripting

Problem running plsql using printf command on bash shell

I am running plsql using printf on a shell, but i am getting some strange error, can someone point what exactly am i missing, $ echo $SHELL /bin/bash $ printf " > SET serveroutput ON trimspool on feed off echo off > declare > p_val number; > d_val varchar2(10); > begin > SELECT... (1 Reply)
Discussion started by: kamauv234
1 Replies
RPIECE(1)						      General Commands Manual							 RPIECE(1)

NAME
rpiece - render pieces of a RADIANCE picture SYNOPSIS
rpiece [ -v ][ -x xres ][ -y yres ][ -X xdiv ][ -Y ydiv ][ -F|R syncfile ][ -T timelim ] [ $EVAR ] [ @file ] [ rpict options ] -o picture octree DESCRIPTION
Rpiece renders a RADIANCE picture a piece at a time, calling rpict(1) to do the actual work. This is useful for running multiple rpict processes on cooperating machines to render a single picture, which is a shared file specified with the -o option. The overall picture dimensions will be xres by yres (or smaller, depending on the -pa option and other view options), and the picture will be rendered in xdiv by ydiv pieces. There are two basic methods for telling rpiece which piece(s) of a picture to render. The explicit method is to write on the standard input the X and Y position of the desired piece(s), where X runs from zero to xdiv-1 and Y runs from zero to ydiv-1. (The lower left piece of a picture corresponds to (0,0) in this system.) Alternatively, the implicit specification method uses a synchronization file to deter- mine which piece is to be rendered next. Specified with the -F option, syncfile initially contains the values for xdiv and ydiv, so the -X and -Y options are unnecessary. (However, they are used if syncfile does not exist.) The first rpiece process puts a lock on syncfile and modifies its contents before starting work on the first piece of the image. It writes the X and Y position of the piece it will work on, so the next rpiece process to modify syncfile will start on the next piece. (When it finishes with its piece, it appends the index to the end of syncfile.) This procedure continues until all the pieces are done, at which point all of the rpiece processes will terminate. The -R option may be used instead of -F if some of the pieces were not properly finished by previous (killed) runs of rpiece. This option should be used by at most one rpiece process, which must be started first and with no other rpiece processes running or else it will reren- der the same pieces other processes have begun. Once the recover process is started, you may start other rpiece processes using the -F option to run simultaneously. If some processes die during execution, leaving one or more half-finished pieces in the picture even though the other processes think the work is done, you may run a single rpiece with the -R option by itself to repair the holes. The -v flag switches on verbose mode, where rpiece reports to the standard output after each piece begins and after each piece is finished. Options may be given on the command line and/or read from the environment and/or read from a file. A command argument beginning with a dollar sign ('$') is immediately replaced by the contents of the given environment variable. A command argument beginning with an at sign ('@') is immediately replaced by the contents of the given file. EXAMPLE
First rpiece process is started on the machine "goober": goober% echo 1 8 > syncfile goober% echo -F syncfile -x 1024 -y 1024 -vf view -o picture octree > args goober% rpiece @args & Second rpiece processes is started on the machine "sucker": sucker% rpiece @args & NOTES
Due to NFS file buffering, the network lock manager is employed to guarantee consistency in the output file even though non-overlapping writes are used. This would tend to slow the process down if rpiece were to wait for this I/O to complete before starting on the next piece, so rpiece forks separate processes to hang around waiting for I/O completion. The number of processes thus designated is set by the MAXFORK macro in the program (compiled in the src/util directory). If the fork call is slow on a system, it may actually be better to set MAXFORK to zero. In other cases, the network lock manager may be so slow that this value should be increased to get the best utilization. The output picture is not run-length encoded, and can be quite large. The approximate size (in kilobytes) can be computed by the simple formula: filesize = xres*yres/256 Make sure that there is enough space on the filesystem to hold the entire picture before beginning. Once the picture is finished, the ra_rgbe(1) program with the -r option may be used to convert to a run-length encoded picture for more efficient storage, although pfilt(1) or any of the other Radiance picture filters will do the same thing. The ALRM signal may be used to gracefully terminate an rpiece process after it finishes the current piece. This permits other currently running or subsequently started rpiece process(es) to continue rendering the picture without loss. The -T option will send the ALRM signal to rpiece after the specified number of (decimal) hours. This is the best way to force a time limit on the computation, since information will not be lost, though the process may continue for some time afterwards to finish its current piece. BUGS
This program may not work on some systems whose NFS lock manager is unreliable. In particular, some System V derivative UNIX systems often have problems with the network lock manager. If the output is scrambled or rpict aborts with some ambient file related problem, you should just remove the ambient file and go back to normal rendering. AUTHOR
Greg Ward SEE ALSO
getinfo(1), pfilt(1), ra_rgbe(1), rpict(1), ximage(1) RADIANCE
10/1/98 RPIECE(1)
All times are GMT -4. The time now is 04:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy