Oracle SQL Developer Command Line (SQLcl) Version 17.2 |
---|
General Information | ||
Library Note |
|
|
Purpose | SQL Command Line is a command line tool intended not to replace SQL*Plus but to supplement it. There are things you can do with SQLcl that are incredibly easier to accomplish than the same task in any other command line Oracle product. | |
Installation | ||
Create a directory under ORACLE_BASE named sqlcl Download the installation .zip file from http://www.oracle.com/technetwork/developer-tools/sqlcl/overview/index.html Unzip the file In Windows start it using the sqlcl.bat file You may be required to also download Java if Java is not already installed in your operating environment. |
![]() ![]() |
|
Start sqlcl | ||
Change directory to $ORACLE_BASE\sqlcl\bin Execute the sql.bat file |
![]() |
|
Data Login | ||
Username should be entered as <username>@<service_name> Enter the password Hit the [Enter] key |
![]() |
|
@ | ||
@{url | file_name[.ext]} [arg ...] |
||
@@ | ||
@@ { url | file_name[.ext] } [arg ...] |
||
/ (slash) | ||
/ (slash) |
||
ACCEPT | ||
ACC[EPT] variable [NUM[BER] | CHAR | DATE | BINARY_FLOAT | BINARY_DOUBLE] [FOR[MAT] format] [DEF[AULT] default] [PROMPT text | NOPR[OMPT]] [HIDE] |
||
ALIAS | ||
ALIAS [<name>=<SQL statement>;| LOAD [<filename>]|SAVE [<filename>] | LIST [<NAME>] | DROP <name> | DESC <name> <Description String>] |
||
APEX | ||
APEX [export <application_id>] |
||
TBD | ||
APPEND | ||
A[PPEND] text |
||
ARCHIVE LOG LIST | ||
List archived redo logs | ARCHIVE LOG LIST |
|
BREAK | ||
BRE[AK] [ON report_element [action [action]]] ... |
||
BRIDGE | ||
Moves data between two
connections/schemas. Also includes functionality to dynamically create
Oracle tables which "fit" the data being received through JDBC. The
following functionality is available: - Query tables in other connections - Query tables in multiple connections in the same statement - Insert data from one connection into another - Create a table and insert data into it from another connection |
BRIDGE <targetTableName> as "<jdbcURL>"(<sqlQuery>); |
|
TBD | ||
BTITLE | ||
BTI[TLE] [printspec [text | variable] ...] | [ON | OFF] |
||
CD | ||
Change Directory | CD [<directory>] |
|
SQL> cd /u01/archive/scripts |
||
CHANGE | ||
C[HANGE] sepchar old [sepchar [new [sepchar]]] |
||
CLEAR | ||
Clears the screen (identical to SQL*Plus) | CL[EAR] option ... |
|
SQL> cl scr |
||
COLUMN | ||
Format a column display (identical to SQL*Plus) | COL[UMN] [{column | expr} [option ...]] |
|
SQL> select table_name from user_tables where rownum = 1; |
||
Header | ||
COMP[UTE] [function [LAB[EL] text] ... OF {expr | column | alias} ...ON {expr | column | alias | REPORT | ROW} ...] |
||
Header | ||
CONN[ECT] [{<logon>| / |proxy} [AS {SYSOPER | SYSDBA | SYSASM}] [edition=value]] |
||
SQL> conn uwclass/uwclass@pdbdevConnected. |
||
CTAS | ||
Generates the DDL for a full syntax Create Table As statement | CTAS [source_table_name] [new_table_name]; |
|
SQL> ctas servers servers_copy; |
||
COPY | ||
COPY {FROM database | TO database | FROM database TO database} {APPEND | CREATE | INSERT | REPLACE | APPEND_BYTE | CREATE_BYTE | REPLACE_BYTE} destination_table[(column, column, column, ...)] USING query |
||
DDL | ||
Generates the code to reconstruct the object listed. Use the type option for materialized views. Use the SAVE option to save the DDL to a file. | DDL [object_name [type] [SAVE filename]] |
|
SQL> ddl pk_servers |
||
DEFINE | ||
DEF[INE] [variable] | [variable = text] |
||
DEL | ||
DEL [n | n m | n * | n LAST | * | * n | * LAST | LAST] |
||
DESCRIBE | ||
Describe an object (essentially identical to SQL*Plus) | DESC[RIBE] {[schema.]object[@connect_identifier]} |
|
SQL> desc servers |
||
DISCONNECT | ||
DISC[ONNECT] |
||
EDIT | ||
Will either load a file into the local editor (vi or notepad) or retrieve for editing the command line buffer just as in SQL*Plus | ED[IT] [file_name[.ext]] |
|
SQL> ed |
||
EXECUTE | ||
EXEC[UTE] statement |
||
EXIT | ||
Exit the SQLcl program | EXIT [SUCCESS | FAILURE | WARNING | n | variable | :BindVariable] [COMMIT | ROLLBACK] |
|
SQL> exit; |
||
FIND | ||
Searches the SQLPATH and its directories for the specified file name | FIND [<filename>] |
|
TBD | ||
FORMAT | ||
FORMAT [BUFFER | RULES <filename> | FILE <input_file> <output_file>] |
||
GET | ||
GET [FILE] file_name[.ext] [LIST | NOLIST] |
||
HELP | ||
SQLcl command and syntax help | HELP | ? [topic] |
|
SQL> help history |
||
HISTORY | ||
Manages and displays the SQLcl history | HISTORY [index | FULL | USAGE | SCRIPT | TIME | CLEAR (SESSION)?] |
|
SQL> history clear |
||
HOST | ||
Shells out to the O/S command line identical to SQL*Plus | HO[ST] [command] |
|
SQL> host |
||
INFORMATION | ||
INFO[RMATION] {[schema.]object[@connect_identifier]} |
||
SQL> information servers |
||
INPUT | ||
I[NPUT] [text] |
||
LIST | ||
L[IST] [n | n m | n * | n LAST | * | * n | * LAST | LAST] |
||
LOAD | ||
LOAD [schema.]table_name[@db_link] file_name |
||
OERR | ||
OERR <facility> <error> |
||
PASSWORD | ||
PASSW[ORD] [username] |
||
PAUSE | ||
PAU[SE] [text] |
||
Header | ||
PRINT [variable ...] |
||
Header | ||
PRO[MPT] [text] |
||
QUIT | ||
Quit the SQLcl program | QUIT [SUCCESS | FAILURE | WARNING | n | variable | :BindVariable] [COMMIT | ROLLBACK] |
|
SQL> quit; |
||
REMARK | ||
REM[ARK] |
||
REPEAT | ||
REPEAT <iterations> <sleep> |
||
REPFOOTER | ||
REPFOOTER |
||
REPHEADER | ||
REPHEADER |
||
REST | ||
REST [export [<module_name> | <module_prefix>] | modules | privileges | schemas] |
||
RUN | ||
R[UN] |
||
SAVE | ||
SAV[E] [FILE] file_name[.ext] [CRE[ATE] | REP[LACE] | APP[END]] |
||
SCRIPT | ||
SCRIPT <script file> |
||
SET | ||
Define interface display options | SET <option> <value> |
|
SQL> set linesize 161 |
||
SET SQLFORMAT | ||
Defines query output in a specified format | SET SQLFORMAT {csv | html | xml | json | ansiconsole | insert | loader | fixed | default} |
|
SQL> set sqlformat csv |
||
Defines query output with the specified delimiter and enclosure | SET SQLFORMAT DELIMITED <delimiter> <left enclosure> <right enclosure> |
|
SQL> set sqlformat delimited | |
||
SHOW | ||
Displays the client encoding | SHO[W] [option] |
|
SQL> show encoding |
||
SHUTDOWN | ||
Shuts-down a database We recommend using SQL*Plus, Server Control, or OEM for this |
SHUTDOWN [ABORT | IMMEDIATE | NORMAL | TRANSACTIONAL [LOCAL]] |
|
SQL> shutdown immediate; |
||
SODA | ||
SODA |
||
SPOOL | ||
SPO[OL] [filename[.ext] [CRE[ATE] | REP[LACE] | APP[END]] | OFF | OUT] |
||
SQL> spool c:\temp\listing.txt |
||
SSHTUNNEL | ||
SSHTUNNEL <username>@<hostname> -i <identity_file> [-L localPort:Remotehost:RemotePort] |
||
TBD | ||
START | ||
STA[RT] { url | file_name[.ext] } [arg ...] |
||
STARTUP | ||
Starts a database instance or PDB We recommend using the proper tool for this: SQL*Plus, Server Control, or OEM |
STARTUP db_options | cdb_options | upgrade_options |
|
SQL> startup; |
||
STORE | ||
Allows schemaless application development using the JSON data model | STORE {SET} file_name[.ext] [CRE[ATE] | REP[LACE] | APP[END]] |
|
TBD | ||
TNSPING | ||
Runs the TNSPING for the specified TNSNAMES alias | TNSPING <address> |
|
SQL> tnsping pdbdev |
||
TITLE | ||
TTI[TLE] [printspec [text | variable] ...] | [ON | OFF] |
||
UNDEFINE | ||
UNDEF[INE] variable ... |
||
VERSION | ||
Displays the SQLcl version | VERSION |
|
SQL> version |
||
WHENEVER OSERROR | ||
WHENEVER OSERROR {EXIT [SUCCESS | FAILURE | n | variable | :BindVariable] [COMMIT | ROLLBACK] | CONTINUE[COMMIT | ROLLBACK | NONE]} |
||
WHENEVER SQLERROR | ||
WHENEVER SQLERROR {EXIT [SUCCESS | FAILURE | WARNING | n | variable | :BindVariable] [COMMIT | ROLLBACK] | CONTINUE [COMMIT | ROLLBACK | NONE]} |
||
WHICH | ||
WHICH <filename> |
||
TBD | ||
XQUERY | ||
XQUERY xquery_statement |
||
This site is maintained by Dan Morgan. Last Updated: | This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2023 Daniel A. Morgan All Rights Reserved | |||||||||
|
||||||||||