Questions tagged [sqlplus]

SQL*Plus is a command-line interface for the Oracle RDBMS product. SQL*Plus questions should probably be also tagged with oracle.

SQL*Plus is a command-line interface for the Oracle RDBMS product. SQL*Plus can be installed as part of the Oracle database product, or as a separate client, as well as as an Instant Client.

SQL*Plus questions should probably be also tagged with .

While SQL commands can be run through SQL*Plus, the tag should be used for questions that relate specifically to the SQL*Plus tool (e.g., connection or formatting issues) and not for SQL statements where the use of SQL*Plus is incidental.

When asking questions regarding SQL*Plus, it is advisable to state the version of the client as well as the database version.

Useful links:

3440 questions
35
votes
3 answers

How to echo text during SQL script execution in SQLPLUS

I have a batch file which runs a SQL script in sqlplus and sends the output to a log file: sqlplus user/pw < RowCount.sql > RowCount.log My log file contains this: Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 -…
glenneroo
  • 1,908
  • 5
  • 30
  • 49
34
votes
4 answers

Sql*plus always returns exit code 0?

Whenever I run a sql script using Sql*plus and check for $?, I get 0 even when the script wasn't succesful. Example #$ sqlplus user/password@instance @script.sql SQL*Plus: Release 10.2.0.1.0 - Production on Wed Aug 7 14:20:44 2013 Copyright (c)…
Tulains Córdova
  • 2,559
  • 2
  • 20
  • 33
33
votes
5 answers

Oracle query execution time

I would like to get the query execution time in Oracle. I don't want the time Oracle needs to print the results - just the execution time. In MySQL it is easy to get the execution time from the shell. How can I do this in SQL*Plus?
user429743
  • 331
  • 1
  • 3
  • 3
33
votes
16 answers

sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory

Please suggest a solution for solving this issue?? While giving the command: sqlplus /nolog the error that occurred: sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
Priyanka U
  • 443
  • 1
  • 5
  • 8
33
votes
2 answers

How do I Suppress "PL/SQL procedure successfully completed" message in sqlplus?

Is there a way that you can have SERVEROUTPUT set to ON in sqlplus but somehow repress the message "PL/SQL procedure successfully completed" that is automatically generated upon completed execution of a plsql procedure?
JJMoho
  • 455
  • 1
  • 5
  • 8
33
votes
1 answer

PL/SQL ORA-01422: exact fetch returns more than requested number of rows

I get keep getting this error I can't figure out what is wrong. DECLARE * ERROR at line 1: ORA-01422: exact fetch returns more than requested number of rows ORA-06512: at line 11 Here is my code. DECLARE rec_ENAME EMPLOYEE.ENAME%TYPE; …
Hiram
  • 341
  • 1
  • 3
  • 4
33
votes
5 answers

How to output oracle sql result into a file in windows?

I tried select * from users save D:\test.sql create; But SQL plus gives me "no proper ended" How to specify path in oracle sql in windows?
Dreamer
  • 7,333
  • 24
  • 99
  • 179
32
votes
13 answers

How do I resolve this "ORA-01109: database not open" error?

I'm trying to create my own database using SQLPlus. So first I log into it as admin: sqlplus sys/sys_password as sysdba And then I try to create a new user, called sqlzoo : CREATE USER sqlzoo IDENTIFIED BY sqlzoo DEFAULT TABLESPACE…
Caffeinated
  • 11,982
  • 40
  • 122
  • 216
31
votes
3 answers

executing a function in sql plus

I created a function in oracle that inserts records in specific tables and return an output according to what occurs within the function. e.g (ins_rec return number) How do I call this function and see its output in sql plus
maher
  • 391
  • 1
  • 4
  • 4
30
votes
10 answers

How can I kill all sessions connecting to my oracle database?

I need to quickly (and forcibly) kill off all external sessions connecting to my oracle database without the supervision of and administrator. I don't want to just lock the database and let the users quit gracefully. How would I script this?
BIBD
  • 15,107
  • 25
  • 85
  • 137
30
votes
4 answers

How do I format my oracle queries so the columns don't wrap?

I've tried this, but it doesn't work: col * format a20000 Do I really have to list every column specifically? That is a huge pain in the arse.
someguy
  • 1,923
  • 5
  • 21
  • 19
29
votes
10 answers

Ugly formatting in SQL*Plus

It is really annoying that when I run a select command in SQL*Plus such as: SELECT * FROM books; The output is really badly formatted and unreadable (row cells are not in a row but separated by line breaks etc): How can I configure it to show…
Richard Knop
  • 81,041
  • 149
  • 392
  • 552
29
votes
8 answers

CLEAR SCREEN - Oracle SQL Developer shortcut?

With the aim of reducing mouse activity I was wondering if there was such a command shortcut (eg cls or Ctrl + L) to provide the SQL * Plus (?) "CLEAR SCREEN" command functionality found by clicking the rubber-on-end- of-pencil icon in Oracle SQL…
MarkyBoyMark
  • 361
  • 1
  • 3
  • 7
29
votes
5 answers

SQLPLUS error:ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

I downloaded SQLPLUS from Oracle: http://www.oracle.com/technetwork/topics/winx64soft-089540.html Basic Lite and SQL*Plus I then fired up SQL*Plus: c:\Program Files\Oracle\instantclient_12_1>sqlplus /nolog SQL*Plus: Release 12.1.0.2.0 Production on…
gbritton
  • 328
  • 1
  • 3
  • 7
29
votes
2 answers

How do I display the full content of LOB column in Oracle SQL*Plus?

When I try to display the contents of a LOB (large object) column in SQL*Plus, it is truncated. How do I display the whole thing?
Anonymoose
  • 5,662
  • 4
  • 33
  • 41