Doubt SQL * Plus - How to Connect

Scripts Diversos para o Oracle SQL*Plus. (Relacionado a ferramenta Oracle SQL*Plus, para questões de SQL, usar o forum SQL)
Post Reply
JSquare
Rank: Estagiário Sênior
Rank: Estagiário Sênior
Posts: 14
Joined: Thu, 02 Sep 2010 9:38 am
Location: Recife - PE

I'm trying to run a "file.sql" by SQL * plus and I can not ... (Linux)

Select all

SQL > SP2-0640: Not connected 
victorhugomuniz
Moderador
Moderador
Posts: 1396
Joined: Fri, 01 Feb 2008 2:06 pm
Location: Rio de Janeiro - RJ
Contact:
:D

Select all

SP2-0640 Not connected. 
PASSW[ORD] [username] 
 
Cause: The PASSWORD command was issued when there was no connection to the Oracle instance. 
 
Action: Connect to the Oracle database before re-issuing the PASSWORD command.
Connect Strings

To remotely connect you will need not only one User and password but a complete Oracle Net connection string. In addition to the database and password user you will need the computer name or IP that has the Oracle Database 10G Express Edition installed and that you want to connect, the TCP / IP port and the service name. These additional parameters are required for Oracle NET to fetch the host (computer that has the correct Oracle Database 10G Express Edition) and connect to the database. Oracle Net Connect String follows the following format:

Select all

username/password@[//]host[:port][/service_name]
Where:

"// is optional
]
Host is the computer name or IP that has Oracle Database 10g Express Edition installed and to which you want to connect

»Port (optional) and the number From the TCP port that Oracle Net Listener is "listening". If not specified, port 1521 will be assumed.

»Service_Name (optional) and the name of the database service you want to connect. For Oracle Database 10G Express Edition The service name is XE. If the service_name is omitted the Oracle Database 10G Express Edition client requires the default Database Service that was configured during the XE installation.

Important Note: Only Oracle Database 10g Express Edition Client supports the notion of Default Database Service. If you connect to Oracle Database 10G Express Edition using another Oracle client you need to include the XE service name.

For example, the figure below shows a user connecting remotely with SQL Command Line (SQL Plus) by typing the Connect command and including the connection string with the following parameters:

Select all

» username: hr 
» password: hr 
» host name: dbhost.xyz.com
This string connects to the Default Database Service (XE) through the Defauler port (1521).
[IMG [3]]
JSquare
Rank: Estagiário Sênior
Rank: Estagiário Sênior
Posts: 14
Joined: Thu, 02 Sep 2010 9:38 am
Location: Recife - PE

Greetings Victor ....

Once again thank you ..... I was missing to connect !!!

: -O
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests