Sql*Plus User’s Guide and Reference


Example 3–3 Full connection identifier for SALES1


Download 5.34 Mb.
Pdf ko'rish
bet41/103
Sana04.08.2023
Hajmi5.34 Mb.
#1665146
1   ...   37   38   39   40   41   42   43   44   ...   103
Bog'liq
E18404-12

Example 3–3
Full connection identifier for SALES1
SQLPLUS hr@\"(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521) )
(CONNECT_DATA=
(SERVICE_NAME=sales.us.acme.com) ) )\"
Easy Connection Identifier
The easy or abbreviated connection identifier has the syntax:
[//]
host
[:
port
][/
service_name
]
Example 3–4
Start a command-line session to the sales database using the easy 
connection identifier
sqlplus hr@\"sales-server:1521/sales.us.acme.com\"
Example 3–5
CONNECT to the sales database using the easy connection identifier
When the password is omitted, the connect string needs to be quoted.
connect hr@"sales-server:1521/sales.us.acme.com"
The easy connection identifier can be used wherever you can use a full connection 
identifier, or a net service name. The easy syntax is less complex, and no tnsnames.ora 
entry is required. 
Connectionless Session with /NOLOG
In the command-line interface, it is possible to start SQL*Plus without connecting to a 
database. This is useful for performing some database administration tasks, writing 
transportable scripts, or to use SQL*Plus editing commands to write or edit scripts. 
You use the /NOLOG argument to the SQLPLUS command to start a connectionless 
command-line session. After SQL*Plus has started you can connect to a database with 
the CONNECT command. 
Example 3–6
Start a connectionless SQL*Plus session with /NOLOG
SQLPLUS /NOLOG 
Starting SQL*Plus
If you are connecting to a remote Oracle database, make sure your Oracle Net software 
is installed and working properly. For more information, see the Oracle Database Net 
Services Administrator's Guide.


Starting SQL*Plus
Starting SQL*Plus
3-5
When you start a SQL*Plus command-line session, and after a CONNECT command 
in that session, the site profile, glogin.sql, and the user profile filelogin.sql, are 
processed:

After SQL*Plus starts and connects, and prior to displaying the first prompt. 

After SQL*Plus starts and connects, and prior to running a script specified on the 
command line.

Prior to the first prompt when /NOLOG is specified on the command line and no 
connection is made.
The site profile file, glogin.sql is processed first, then the user profile file, login.sql.
Behavior in SQL*Plus 10.1 may be unexpected depending on the setting of SET 
SQLPLUSCOMPATIBILITY. For example, processing glogin.sql and login.sql after a 
CONNECT command only occurs with the default SQLPLUSCOMPATIBILITY setting 
of 10.1. For more information, see 
SET SQLPLUSCOMPAT[IBILITY] {x.y[.z]}
 on 
page 12-148.

Download 5.34 Mb.

Do'stlaringiz bilan baham:
1   ...   37   38   39   40   41   42   43   44   ...   103




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling