Skip to Main Content

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, aravindkumar.

Asked: February 13, 2007 - 10:28 am UTC

Last updated: November 30, 2011 - 7:15 am UTC

Version: 9.2.0.6

Viewed 1000+ times

You Asked

hi tom,
i have come across this error many times ora-01012 not logged on.what is the correct meaning of this error can u pls clarify it briefly.


regards,
arvind

and Tom said...

"U" isn't here. Should we wait for them? It could take a really long time as they never come to work.

I don't know what "U" would do as I haven't met them yet - however they are very popular, many people have asked for them.


Well, I don't really mean this sarcastically - but - ORA-01012 not logged on means simply...


You are not logged on?? You are disconnected, you are not in contact with the database, you need to logon.

Not sure what else to say

Rating

  (7 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

U is not here....

Tom, February 13, 2007 - 3:42 pm UTC

I don't know why it is so hard for people to go the extra distance (2 more keystrokes) to type you instead of 'u'.... Are we really that lazy or in that much of a hurry?
Tom Kyte
February 13, 2007 - 4:23 pm UTC

As you can probably tell, it is in fact a pet peeve of mine.

hw 2 sv kystrks

A reader, February 14, 2007 - 12:01 am UTC

It would have been less typing to phrase the question this way:
"What does ORA-1012 mean?"
I suppose Oracle could have beefed up the error message file so that the even less typing:
oerr ora 1012
at a Unix shell prompt would return a bit more detail than

01012, 00000, "not logged on"
// *Cause:
// *Action:

Something better would be along the lines of...
// *Cause: Please log on before executing SQL. If you
// were logged on, you may have missed a previous
// messages indicating why you were disconnected (e.g.
// fatal error message, session killed, instance
// shutting down, etc).
// *Action: Connect first or check for other error
// messages prior to ORA-1012.
.
I'm sure someone can improve on that wording. In some older version of Oracle, the oerr output used a bunch of OCI lingo, so it was not very understandable.

SP2-0640

Mr. U, February 14, 2007 - 7:26 am UTC

sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Mi Feb 14 13:21:14 2007

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

/nolog > select user from dual;
SP2-0640: Not connected

why don't I get an 01012 here ?
Tom Kyte
February 14, 2007 - 8:35 am UTC

because you are not connected

which is different from not being logged in.


sqlplus isn't connected to a database instance at all - there is nothing to submit your sql to and get a response back from

so, sqlplus tells you "hey, you are not connected - what do you want me to do with this nice string you just typed in"


Wouldn't it be simpler

M, February 14, 2007 - 11:37 am UTC

for Oracle to say:-

sqlplus tells you "hey, u are not connected "

Need more details

Bala, February 14, 2007 - 11:53 am UTC

What application are you running? What are the circumstances of the error?

If you are running Oracle Apps, check metalink Note:2105019.6

ORA-01012

Ivaylo, February 14, 2007 - 2:54 pm UTC

According to Oracle 10g R2 Administrator's Guide you get ORA-01012 for every attempt to submit a request to the database after receiving an ORA-00028 (your session has been killed) message: http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14231/manproc.htm#sthref705

Therefore examine your log files and check for errors that precede the ORA-01012 message.

ora-01012 happens repeatly after switch off autotrace

A reader, November 30, 2011 - 3:25 am UTC

hi tom,

everytime after i switch off the autotrace, i will come accross ora-01012 error, and have to re-connect the DB.

Could you please kindly help?

BTW, this seems just begin to happen these days. I am learning DBA staff, and could be modify some parameter or settings, but not sure how and why can result in this.

One suspection is i create a profile to limit concurrent sessions per user as 2. And i learned from some place that after we enable autotrace, actually create another session.
But i have drop that profile and assign default to users.

below is what i copy out from my SQL*PLUS for your reference.

SQL> conn /as sysdba
Connected.
SQL> select sysdate from dual;

SYSDATE
---------
30-NOV-11

SQL> set autotrace on
SQL> set autotrace off

SQL> /
select sysdate from dual
*
ERROR at line 1:
ORA-01012: not logged on
Process ID: 7683
Session ID: 46 Serial number: 129


SQL>

Tom Kyte
November 30, 2011 - 7:15 am UTC

DO NOT USE SYSDBA FOR ANYTHING like this, just stop.

test with a regular user, stop using sysdba - that is just a really bad (horrifically bad) idea.