Frequently used:
Sqlplus username/password for example: normal user login sqlplus Scott/tigersqlplus username/password @ net_service_name For example: sqlplus Scott/tiger @ orcl
Sqlplus username/password as sysdba For example: sqlplus sys/admin as sysdbasqlplus username/password @ // host: Port/Sid Note: SYS and system must be logged on with sysdba
After entering SQL * Plus, you can use conn to connect to other users, such as Conn sys/admin as sysdba.
In the DOS environment, enter "sqlplus /?", As follows:
C: \ Documents ents and Settings \ HH> sqlplus /?
SQL * Plus: Release 11.2.0.1.0 production on Saturday August 13 16:56:46 2011
Copyright (c) 1982,201 0, Oracle. All rights reserved.
SQL * Plus: Release 11.2.0.1.0 Production
Copyright (c) 1982,201 0, Oracle. All rights reserved.
Use SQL * Plus to execute SQL, PL/SQL, and SQL * Plus statements.
Usage 1: sqlplus-H |-V
-H displays the SQL * Plus version and usage help.
-V displays the SQL * Plus version. Usage 2: sqlplus [[<option>] [{logon |/nolog}] [<Start>] <option>: [-C <version>] [-L] [-M "<Options>"] [-r <level>] [-S]-C <version> will be affected the compatibility is set to the specified version. This version is in the "x. y [. Z]" format. For example,-C 10.2.0
-L only attempts to log on once, instead of prompting again when an error occurs.
-M "<Options>" sets the output automatic 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> sets the 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 is-R 3, which disables all user commands that interact with the file system.
-S sets the no-Prompt mode. In this mode, the SQL * Plus mark of the command is hidden, and the prompt and echo display are displayed.
<Logon> {<username> [/<password>] [@ <connect_identifier>] |/} [as {sysdba | sysoper | sysasm}] [Edition = value]
Specifies the database account username, password, and database connection identifier. If there is no connection identifier, SQL * Plus will connect to the default database.
As sysdba, as sysoper, and as sysasm options are database management permissions.
<Connect_identifier> can be a net service name or easily connected.
@ [<Net_service_name> | [//] host [: Port]/<SERVICE_NAME>]
<Net_service_name> is a simple name of the service, which is parsed as a connection descriptor.
Example: use the net service name to connect to the database, and the database net service name is orcl.
Sqlplus myusername/mypassword @ orcl
Host specifies the host name or IP address of the database server computer.
Port specifies the listening port on the database server.
<SERVICE_NAME> specify the service name of the database to be accessed.
Example: connect to the database with ease and the service name is orcl.
Sqlplus myusername/mypassword @ host/orcl
The/nolog option enables SQL * Plus instead of connecting to the database.
Edition specifies the value of the session version.
<Start> is: @ <URL >|< FILENAME> [. <ext>] [<parameter>...]
Run the specified SQL * Plus script from the Web server (URL) or local file system (filename. ext) using the specified parameter that will be assigned to the substitution variable in the script.
After SQL * Plus is started and the connect command is executed, the site profile (for example, $ ORACLE_HOME/sqlplus/admin/glogin) is run. SQL) and user profile, such as login in the working directory. SQL ). These files contain SQL * Plus commands.
For more information, see the SQL * Plus User Guide and reference.