Questions tagged [sqlplus]

an Oracle cli tool to access databases, mixing SQL statements with the PL/SQL language.

8 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
386 views

Referencing dynamically created table names in Create statement written in shell script

I need to write a script to automatically generate a month end report. The generation process involved creating tables in database and then accessing them later in the same script to create another ...
1
vote
0answers
709 views

Running SQLPlus Oracle Command as Root returns incorrect answer

I am trying to create a script that checks the usage of each disk in an ASMDISK group. I have my script setup on one node in each RAC cluster. It works on several of the servers without issue, but ...
0
votes
0answers
19 views

How can I run sqlplus as nobody

I have a bash script (/bin/foo) where I export PATH, LD_LIBRARY_PATH, ORACLE_HOME, ORACLE_SID and I can run sqlplus (Oracle SQL client) from the script, but when I try to run it like this sudo -u ...
0
votes
1answer
78 views

Different output when executing script manually and via cron/jenkins job

I have a shell script which opens sqlplus and select some data from db containing chinese characters. When I execute it manually, the output contains those characters. When I do it via cron or jenkins ...
-1
votes
1answer
430 views

Generating .XLS file as an output file of sqlplus query and sending that .XLS file as an attachment in email

I am generating output file (.xls format) from the below DB query- sqlplus -S -L user/pass@DB <<EOF | sed '/^$/d' >> home/test/query_output.xls set line 22000 set head off set feedback ...
-1
votes
1answer
37 views

Pick Values From A Oracle Select Query

I have executed the below command (Part of a 2 step procedure required for password reset when we face the error ORA-28007). SQL> select USER#,NAME,PASSWORD FROM user$ where name='TESTUSER'; ...
-1
votes
1answer
2k views

save output into a file from sqlplus query in ksh script

The thing is that it overwrites in Result.txt and I only get the last query. How can I fix this? #!/bin/sh while read -r line do echo "'$line'" sqlplus -s whatever/whatever <<-EOF SPOOL ...
-2
votes
1answer
259 views

string comparison not working with sqlplus output

Code: iIMSI=`sqlplus -s ${APP_ORA_USER}/${APP_ORA_PASS}@${APP_DB_INST} << EOF SET HEAD OFF PAGESIZE 0 LINESIZE 1000 TRIMOUT ON TIMING OFF select resource_value from agd1_resources where ...