Nothing Special   »   [go: up one dir, main page]

Sqlplus Commands For Oracle

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

SQLPlus commands for Oracle

SQL*Plus is a command-line tool that provides access to the Oracle RDBMS. SQL*Plus enables you to:

Enter SQL*Plus commands to configure the SQL*Plus environment Startup and shutdown an Oracle database Connect to an Oracle database Enter and execute SQL commands and PL/SQL blocks Format and print query results

SQL*Plus is available on several platforms. In addition, it has a web-based user interface, iSQL*Plus. Following are some important commands to be used with SQLPlus. Log in to SQL*Plus
SQLPLUS [ { username[/passward][@connect_identifier] | / } [ AS { SYSDBA | SYSOPER } ] | /NOLOG ] HELP [ INDEX | topic ] HOST [ command ]

List help topics available in SQL*Plus Execute host commands

Show SQL*Plus system variables SHOW { ALL | ERRORS | USER | system_variable | ... } or environment settings Alter SQL*Plus system variables SET system_variable value or environment settings Start up a database Connect to a database List column definitions for a table, view, or synonym, or specifications for a function or procedure
STARTUP PFILE = filename [ MOUNT [ dbname ] | NOMOUNT | ... ] CONNECT [[username [/password] [@connect_identifier][ / AS {SYSOPER | SYSDBA}]] DESCRIBE [ schema. ] object

Edit contents of the SQL buffer or EDIT [ filename [ .ext ] ] a file Get a file and load its contents into the SQL buffer Save contents of the SQL buffer
GET filename [ .ext ] [ LIST | NOLLIST ] SAVE filename [ .ext ] [ CREATE | REPLACE |

to a file List contents of the SQL buffer Add new lines following current line in the SQL buffer

APPEND ] LIST [ n | n m | n LAST | ... ]

Delete contents of the SQL buffer DEL [ n | n m | n LAST | ... ]


INPUT [ text ]

Append text to end of current line APPEND text in the SQL buffer Find and replace first occurrence of a text string in current line of the SQL buffer Capture query results in a file and, optionally, send contents of file to default printer Run SQL*Plus statements stored in a file Execute commands stored in the SQL buffer List and execute commands stored in the SQL buffer Execute a single PL/SQL statement or run a stored procedure Disconnect from a database Shut down a database Log out of SQL*Plus
CHANGE sepchar old [ sepchar [ new [ sepchar ] ] ] sepchar can be any non-alphanumeric character such as "/" or "!" SPOOL [ filename [ .ext ] [ CREATE | REPLACE | APPEND | OFF | OUT ]

@ { url | filename [ .ext ] } [ arg... ] START filename [ .ext ] [ arg... ] .ext can be omitted if the filename extension is .sql / RUN EXECUTE statement

DISCONNECT SHUTDOWN [ ABORT | IMMEDIATE | NORMAL | ... ] { EXIT | QUIT } [ SUCCESS | FAILURE | WARNING | ... ] [ COMMIT | ROLLBACK ]

You might also like