Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Trouble calling sqlplus within script Post 303045386 by SIMMS7400 on Thursday 19th of March 2020 06:55:40 AM
Old 03-19-2020
Trouble calling sqlplus within script

Hi Folks -


I'm trying to create a simple script I can run for a migration effort I will be doing.



The issue I am having trouble with is calling sqlplus within my script. Here is my script, am I doing anything wrong?
Code:
cd /u01/app/oracle/admin/ORCL/
sudo -s mkdir -p dpdumpstg
sudo -s mkdir -p dpdumpintg
sudo -s rm -f /dpdumpstg/*.*
sudo -s rm -f /dpdumpintg/*.*
sudo -s chown oracle:oinstall ./dpdumpstg
sudo -s chown oracle:oinstall ./dpdumpintg
sudo -s setfacl -m 'u:opc:rwx' /u01/app
sudo -s setfacl -m 'u:opc:rwx' /u01/app/oracle
sudo -s setfacl -m 'u:opc:rwx' /u01/app/oracle/admin
sudo -s setfacl -m 'u:opc:rwx' /u01/app/oracle/admin/ORCL
sudo -s setfacl -m 'u:opc:rwx' /u01/app/oracle/admin/ORCL/dpdumpstg/
sudo -s setfacl -m 'u:opc:rwx' /u01/app/oracle/admin/ORCL/dpdumpintg/
sudo -su oracle sqlplus /nolog <<EOF
connect / as sysdba;
CREATE OR REPLACE DIRECTORY DATA_PUMP_STG AS '/u01/app/oracle/admin/ORCL/dpdumpstg/';
EOF


It claims sqlplus is not a valid command. But if i sudo -su oracle manually in the command window, and then do sqplus / as sysdba it works.



Any ideas? Thank you!
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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

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

7. 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

8. 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

9. 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

10. UNIX for Beginners Questions & Answers

SQLPLUS calling Via Script

Hello All, Could you please help me if i am doing anything wrong in below script, especially the sqlplus part performance wise or anything else i could improvise in the script. Thank you. #!/bin/ksh ## Batch Obj Id MP_BCH_OBJ_ID=$1 PASS=$2 partition=$3 ## script dir... (6 Replies)
Discussion started by: Ariean
6 Replies
bioutil(1)						    BSD General Commands Manual 						bioutil(1)

NAME
bioutil -- tool for viewing/changing Touch ID configuration and listing/deleting enrolled fingerprints SYNOPSIS
bioutil {-r | -w [-f { 0 | 1 }] [-u { 0 | 1 }] [-a { 0 | 1 }]} | [-c] | [-p] | [-d <uid>] [-s] DESCRIPTION
bioutil provides the possibility of viewing and changing Touch ID configuration, both system-wide and user-specific. It also allows listing and deleting enrolled fingerprints. OPTIONS
-r, --read Read Touch ID configuration. -w, --write Write Touch ID configuration. -s, --system Indicates that system-wide configuration is to be read/written (user-specific configuration is the default) or that a system-wide list/delete operation is to be performed. -f, --function Enables (1) or disables (0) overall Touch ID functionality (system-wide configuration only). -u, --unlock Enables (1) or disables (0) Touch ID for unlock. -a, --applepay Enables (1) or disables (0) Touch ID for ApplePay (user-specific configuration only). -c, --count Provides number of enrolled fingerprints of the current user or of all users (when run with -s as an administrator) -p, --purge Deletes all enrolled fingerprints of the current user or of all users (when run with -s as an administrator) -d, --delete Deletes all enrolled fingerprints of the user with given user ID (must be run as an administrator) EXAMPLES
bioutil -r Reads Touch ID configuration for the current user. bioutil -r -s Reads system-wide Touch ID configuration. bioutil -w -u 1 Enables Touch ID for unlock for the current user. sudo bioutil -w -s -u 0 Disables Touch ID for unlock for the whole system. bioutil -c Prints the number of enrolled fingerprints of the current user. bioutil -p Deletes all enrolled fingerprints of the current user. sudo bioutil -c -s Prints numbers of enrolled fingerprints of all enrolled users. sudo bioutil -p -s Deletes all fingerprints from the system. sudo bioutil -s -d 501 Deletes all fingerprints of user 501. Darwin May 31, 2019 Darwin
All times are GMT -4. The time now is 09:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy