SQLPLUS calling Via Script

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers SQLPLUS calling Via Script
Prev   Next
# 6  
Old 11-06-2017
Hello All,
i am trying to extract the data file via sqlplus and i wanted to capture the output of sqlplus into a log file and check for any syntax,Connection, DB errors etc.
But for some reason my logfile is filled up with the data of sqlplus output, and also process is running a long time because of this.
Appreciate your further inputs.


Code:
#${ORACLE_HOME}/bin/sqlplus -s /nolog <<-EOF > ${LOG_DIR}/edw_extract_RDW_Partition.sh.${MP_BCH_OBJ_ID}_${partition}.sql.log
${ORACLE_HOME}/bin/sqlplus -s /nolog <<-EOF > /dev/null
conn ${APPLICATION_ID}/${DB_PASS}@${RDW_DB}
spool ${SRC_DIR}/RDW_SRVC_CONV_${MP_BCH_OBJ_ID}_${partition}.dat;
set pagesize 0
set trimspool on
set heading off
set feedback off
set linesize 500
select to_char(ACTVY_RPTNG_PER_DT,'mm/dd/yyyy hh24:mi:ss')||'|'||LN_ID||'|'||'|'||'|'||'|'||'|'||ARM_IDX_CD||'|'||'|'||'|'||'|'||'|'||'|'||'|'||RCRS_TYP_CD||'|'||'|'||'|'||LNDR_LN_ID||'|'||'|'||'|'||'|'||'${MP_BCH_OBJ_ID}'||'|'||'|'||'${MP_EDW_USR_ID}'||'|'||'${MP_BCH_STRT_DTTM}'||'|'||'|' from $RDW_Schema.LL_LN_ACTVY_3 partition(${partition});
spool off;
EXIT;
EOF

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Avoid $ symbol while calling sqlplus in shellscript.

Hi All, we have requirement, i am created a shell script , inside i am connecting sqlplus and execute the query. below my code for your reference. get_sqlid () { sqlid=$( sqlplus -s $PBDW_USERID/$PBDW_PW@$PBDW_SID <<EOF DEFINE TBLNAME=$1 set feedback off set serverout on size... (4 Replies)
Discussion started by: KK230689
4 Replies

2. Shell Programming and Scripting

Oracle/SQLPlus help - ksh Script calling .sql file not 'pausing' at ACCEPT, can't figure out why

Hi, I am trying to write a script that calls an Oracle SQL file who in turns call another SQL file. This same SQL file has to be run against the same database but using different username and password at each loop. The first SQL file is basically a connection test and it is supposed to sort... (2 Replies)
Discussion started by: newbie_01
2 Replies

3. Shell Programming and Scripting

Control not returning from Sqlplus to calling UNIX shell script.

Hello All, I have exactly same issue @vikas_trl had in following link: https://www.unix.com/shell-programming-and-scripting/259854-control-not-returning-sqlplus-calling-unix-shell-script.html I wonder if he or somebody else could find the issue's cause or the solution. Any help would... (4 Replies)
Discussion started by: RicardoQ
4 Replies

4. Shell Programming and Scripting

Control not returning from Sqlplus to calling UNIX shell script.

Hello All, I have a UNIX script which will prepare anonymous oracle pl/sql block in a temporary file in run time and passes this file to sqlplus as given below. cat > $v_Input_File 2>>$v_Log << EOF BEGIN EXECUTE IMMEDIATE 'ALTER SESSION FORCE PARALLEL DML PARALLEL 16'; EXECUTE... (1 Reply)
Discussion started by: vikas_trl
1 Replies

5. UNIX for Dummies Questions & Answers

calling a unix shell script from sqlplus

I want to execute a shell script from sqlplus prompt and get its output back to sqlplus. Is this possible? if yes just give me an example for doing that. (2 Replies)
Discussion started by: boopathyvasagam
2 Replies

6. Shell Programming and Scripting

Help supressing spool output from screen when calling sqlplus from script

I'm calling an embedded sql from my shell script file. This sql does simple task of spooling out the contents of the table (see below my sample code) into a spool file that I specify. So far so good, but the problem is that the output is also displayed on screen which I do NOT want. How can I... (3 Replies)
Discussion started by: MxC
3 Replies

7. Shell Programming and Scripting

Error in calling store procedure using SQLPLUS in unix

Hi, I am facing the following error in calling the stored procedure from SQLPLUS in unix environment. SQL> set serveroutput on SQL> var store number; SQL> exec test_proc(:store, 200); BEGIN TEST_PROC(:store, 200); END; * ERROR at line 1: ORA-01858: a non-numeric character was found... (8 Replies)
Discussion started by: pradeep7986
8 Replies

8. Shell Programming and Scripting

calling sqlplus, read table return etc

I have korn shell scripts. I want to pass a variable to a script which will execute a a sql script to read a table that contains env. variables. I want to read and then somehow export at unix level variables example for every row selected from the table build export command line field1... (5 Replies)
Discussion started by: TimHortons
5 Replies

9. Shell Programming and Scripting

calling sqlplus from within a for loop

i'm not new to programming, but i AM new to unix scripting. here's my deal. this works: #!/bin/ksh echo "HELLO" /oracle_home/bin/sqlplus username/password@MYDB<<EOF SELECT COUNT(*) FROM EMPLOYEES; EOF exit echo "GOODBYE" this doesn't: #!/bin/ksh echo "HELLO" for x in 1 2... (4 Replies)
Discussion started by: akosz
4 Replies

10. Shell Programming and Scripting

calling sqlplus from shell

Hi All, I am executing the following code :- sqlplus -s ${DATABASE_USER} |& print -p -- 'set feed off pause off pages 0 head off veri off line 500' print -p -- 'set term off time off serveroutput on size 1000000' print -p -- "set sqlprompt ''" print -p -- "SELECT run_command from... (2 Replies)
Discussion started by: suds19
2 Replies
Login or Register to Ask a Question
Net::Sieve::Script(3pm) 				User Contributed Perl Documentation				   Net::Sieve::Script(3pm)

NAME
Net::Sieve::Script - Parse and write sieve scripts SYNOPSIS
use Net::Sieve::Script; my $test_script = 'require "fileinto"; # Place all these in the "Test" folder if header :contains "Subject" "[Test]" { fileinto "Test"; }'; my $script = Net::Sieve::Script->new ($test_script); print "OK" if ( $script->parsing_ok ) ; print $script->write_script; or my $script = Net::Sieve::Script->new(); my $cond = Net::Sieve::Script::Condition->new('header'); $cond->match_type(':contains'); $cond->header_list('"Subject"'); $cond->key_list('"Re: Test2"'); my $actions = 'fileinto "INBOX.test"; stop;'; my $rule = Net::Sieve::Script::Rule->new(); $rule->add_condition($cond); $rule->add_action($actions); $script->add_rule($rule); print $script->write_script; DESCRIPTION
Manage sieve script Read and parse file script, make Net::Sieve::Script::Rule, Net::Sieve::Script::Action, Net::Sieve::Script::Condition objects Write sieve script Support RFC 5228 - sieve base RFC 5231 - relationnal RFC 5230 - vacation Draft regex missing 5229 variables 5232 imapflags 5233 subaddress 5235 spamtest notify draft CONSTRUCTOR
new Argument : optional text script Purpose : if param, put script in raw, parse script Return : main Script object Accessors : ->raw() : read or set original text script ->require() : require part of script ->rules() : array of rules ->max_priority() : last rule id METHODS
parsing_ok return 1 on raw parsing success write_script Purpose : write full script, require and rules parts Return : set current require, return rules ordered by priority in text format equals $object->equals($test_object): return 1 if $object and $test_object are equals read_rules $script->read_rules() : read rules from raw $script->read_rules($some_text) : parse text rules use of read_rules set $script->rules() Return 1 on success find_rule Return Net::Sieve::Script::Rule pointer find by priority Return 0 on error, 1 on not find swap_rules Swap priorities, now don't take care of if/else/elsif Return 1 on success, 0 on error reorder_rules Reorder rules with a list of number, start with 1, and with blanck separator. Usefull for ajax sort functions. Thank you jeanne for your help in brain storming. Return 1 on success, 0 on error delete_rule Delete rule and change priority, delete rule take care for 'if' test if deleted is 'if' delete next if next is 'else' change next in 'if' next is 'elsif' Return : 1 on success, 0 on error add_rule Purpose : add a rule in end of script Return : priority on success, 0 on error Argument : Net::Sieve::Script::Rule object BUGS
Rewrite a hand made script will lose comments. Verify parsing success with parsing_ok method before write a new script. SUPPORT
Please report any bugs or feature requests to "bug-net-sieve-script at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Sieve-Script>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. AUTHOR
Yves Agostini - Univ Metz - <agostini@univ-metz.fr> <http://www.crium.univ-metz.fr> COPYRIGHT
Copyright 2008 Yves Agostini - <agostini@univ-metz.fr> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. SEE ALSO
Net::Sieve perl v5.10.0 2008-09-15 Net::Sieve::Script(3pm)