Menu Close
Oracle_Spikeage Tutorial

SQL (Structured Query Language) is standard for DBMS SQL Server, MySQL, Sybase, Oracle all use the same syntax but SQL*Plus is a tool of Oracle that provides greate functionalities to work with Oracle Database. SQL*Plus is a command-line tool of Oracle that provides access to the Oracle RDBMS. SQL*Plus enables you to:

Enter SQL*Plus commands to configure the SQLPlus 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. Windows/Linux

Oracle Work on Client-Server Architecture, So, first Check Communication with the Server by using the Command :

In Windows :

Ping <ip address of Server> 

e.g. ping 192.168.112.111 -t 

If you get the Reply then your communication with the Server is Okey Next check Environment Variable(EV) for Oracle. Files for APEX need not to install any files or set the EV but for Client for Oracle need to install files and set the EV.

Path and TNS_ADMIN variables are important EV must point to Client files.

Now, Connect with the Server and Start SQL*Plus :

for best practice type with Caps Lock ON state

2. SQLPLUS USERNAME/PASSWORD@CONNECT_IDENTIFIER

You will get the SQL> prompt or there is something wrong.

COPY/PASTE Commands at SQL> Prompt ONLY BOLD COMMANDS

HOST DIR

HOST <OS Commands> Run OS Commands from SQL Prompt

SHOW SQLPROMPT

SHOW AUTOCOMMIT

SHOW PAUSE

SHOW USER

SHOW UNDERLINE

SHOW LINESIZE

SHOW ALL

(Show all variables)

SET LINESIZE 200

CLEAR SCREEN

CL SCR

HOST CLS

Clear Screen

SET SQLPROMPT “SURENDER>”

SET System_variables or Environment Settings

EDIT

Edit contents of the SQL buffer or a file

SAVE A.TXT

Save contents of the SQL buffer to a file

GET A.TXT

Get a file and load its contents into the SQL buffer

LIST

List contents of the SQL buffer

DEL

Delete contents of the SQL buffer

INPUT text

Add new lines following current line in the SQL buffer

APPEND text

Append text to end of current line in the SQL buffer

SPOOL EXPERIMENT1.TXT

Capture query results in a file and, optionally, send contents of file to default printer

@C:\TEST.TXT

Run SQL*Plus statements stored in a file, ext can be omitted if the filename extension is .sql

/

Execute commands stored in the SQL buffer

RUN

List and execute commands stored in the SQL buffer

EXECUTE

Execute a single PL/SQL statement or run a stored procedure

DISCONNECT

Disconnect from a database

EXIT

Log out of SQL*Plus

Download Oracle XE 11g R2 for Windows 64bit

Download Oracle XE 11g R2 for Windows 32bit

 

 

7 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *