Showing posts with label SP2-0640. Show all posts
Showing posts with label SP2-0640. Show all posts

Wednesday, February 29, 2012

DISCONNECT

You can return from SQL*Plus to the operating system using exit or quit:
 
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
UNIX>
 
SQL> quit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
UNIX>
 
You can also use disconnect, which terminates your database session but leaves you in SQL*Plus:
 
SQL> show user
USER is "ORACLE"
SQL> disconnect
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
SQL> show user
USER is ""
SQL>
 
This lets you enter and/or modify SQL*Plus commands but does not allow you to run them:
 
SQL> select sysdate from dual
  2  /
SP2-0640: Not connected
SQL> c/sysdate/sysdate + 1/
  1* select sysdate + 1 from dual
SQL> /
SP2-0640: Not connected
SQL>
 
To do that, you have to reconnect to the database:
 
SQL> show user
USER is ""
SQL> conn /
Connected.
SQL> show user
USER is "ORACLE"
SQL> l
  1* select sysdate + 1 from dual
SQL> /
 
SYSDATE+1
---------
17-FEB-12
 
SQL>

Monday, February 07, 2011

sqlplus /nolog



This allows you to start a SQL*Plus session without connecting to a database:

TEST11>sqlplus /nolog

SQL*Plus: Release 11.1.0.6.0 - Production on Mon Feb 7 14:01:41 2011

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

SQL> SELECT SYS_CONTEXT('USERENV','DB_NAME') DATABASE
  2  FROM DUAL;
SP2-0640: Not connected
SQL> SHOW USER
USER is ""
SQL>