frequently used:
Sqlplus Username/password such as: normal user login Sqlplus Scott/tiger sqlplus username/[email protected]net_service_name such as: Sqlplus Scott/[email protected]
Sqlplus Username/password as SYSDBA: Sqlplus sys/admin as Sysdba sqlplus username/[email Protected]//host:port/sid NOTE: SYS and system need to be logged in SYSDBA
can use Conn to connect to other users after entering Sql*plus, e.g. Conn Sys/admin as SYSDBA
in a DOS environment, enter "Sqlplus/?", for example the following:
C:\Documents and Settings\hh>sqlplus/?
Sql*plus:release 11.2.0.1.0 Production on Saturday August 13 16:56:46 2011
Copyright (c) 1982, Oracle. All rights reserved.
Sql*plus:release 11.2.0.1.0 Production
Copyright (c) 1982, Oracle. All rights reserved.
Run SQL, PL, and sql*plus statements using Sql*plus.
How to use 1:sqlplus-h | -V
-H Displays the Sql*plus version number and the use method Help.
-V Displays the Sql*plus version number. use Method 2:sqlplus [[<option>] [{logon |/nolog}] [<start>]<option>: [-C <version>] [-l] [-m] <options> "] [-R <level>] [-S]-C <version> Sets the compatibility of the affected command to the <version> specified version number. The version number has the format "X.y[.z". For example,-C 10.2.0
-L just try to log in once, not prompt again on error.
-M "<options>" sets the output of its own active HTML tag. The format of the options is:
HTML [on| OFF] [HEAD text] [BODY text] [TABLE text][entmap {on| OFF}] [SPOOL {on| OFF}] [Pre[format] {on| OFF}]
-R <level> Set restricted mode to disable the Sql*plus command that interacts with the file system. The level can be 1, 2, or 3. The maximum limit level is-R 3, which disables all user commands that interact with the file system.
-S sets the silent mode, which hides the display of the command's Sql*plus flag, hints and echoes.
<logon> for: {<username>[/<password>][@<connect_identifier>] |/}[as {SYSDBA | Sysoper | SYSASM}] [Edition=value]
Specifies the connection identifier for the Database account username, password, and database connection. Assuming there is no connection identifier, Sql*plus will connect to the default database.
As SYSDBA, the as Sysoper and as sysasm options are database administrative permissions.
The form of <connect_identifier> can be a Net service name or easy to connect.
@[<net_service_name> | [//] host[:P Ort]/<service_name>]
<net_service_name> is the simple name of the service, which resolves to a connection descriptive descriptor.
Demo Sample: Connect to the database using the Net service name, and the database Net service name is ORCL.
Sqlplus Myusername/[email protected]
host specifies the hostname or IP address of the database server computer.
PORT specifies the listening port on the database server.
<service_name> Specifies the service name of the database to be interviewed.
Demo Sample: Connect to the database with an easy connection and the service name is ORCL.
Sqlplus Myusername/[email PROTECTED]/ORCL
The/nolog option launches Sql*plus without connecting to the database.
EDITION Specifies the value of the session version number.
<start>: @<url>|<filename>[.<ext>] [<parameter> ...]
Executes the specified Sql*plus script from the WEB server (URL) or local file system (FILENAME.EXT) using the specified parameters that will be assigned to the substitution variables in the script.
After you start Sql*plus and execute the CONNECT command, the Web site profile (for example, $ORACLE _home/sqlplus/admin/glogin.sql) and user profiles such as Login.sql in the working folder are executed. These filesincludes the Sql*plus command.
for specific information, please refer to the Sql*plus User Guide and references.
Sqlplus Login, connect command