Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Oracle|dbaportal.eu|Page2
Tracing ORA01031
NOV 2
Posted by alesk
Several months ago I got a brand new Lenovo Think Centre workstation at workplace with Windows 7
Enterprise Edition (x64). Of course, the first thing I always do is to install a bunch of Oracle software that
serves as a playground. So, I installed 10gR2 and 11gR2 and created test databases for both versions. In
addition to RDBMS I installed several other tools that I use more or less on a daily basis, or that I need
while reproducing end user errors.
Everything worked as expected. At least at the beginning. After awhile, I noticed unsuspected error while
connecting locally as sysdba on 11g instance.
I could successfully connect / as sysdba for two or three times in a row after fresh OS reboot, then
when I tried to connect for third or forth time in a row as sysdba, I got ORA01031 error out of the blue
sky:
SQL>altersystemsetevents'1031tracenameerrorstacklevel3;namelibrary_cachelevel10';
data:text/htmlcharset=utf8,%3Ch2%20class%3D%22posttitle%22%20style%3D%22border%3A%200px%3B%20margin%3A%200.5em%200px%200.3em%
1/3
4/5/2015
Oracle|dbaportal.eu|Page2
Now, I should have a trace file generated for the ORA01031 error, so I looked in alert.log for trace file:
1
2
3
4
...
WedNov0214:42:432011
ErrorsinfileE:\ORACLE\diag\rdbms\test11\test11\trace\test11_ora_1936.trc:
ORA01031:insufficientprivileges
It took me some time glimpsing through file test11_ora_1936.trc as it was about 38MB in size.
When I saw tnsManager entry in error stack, I knew something weird is going on
What the heck is tnsManager* doing in the trace file, if Im not using this service at all in my 11g
installment.
It turned out that I somehow forgot that I setup TNS_ADMIN variable system wide pointing to the
tnsManager home directory. In that directory sqlnet.ora file was not setup properly (NTS was turned off),
dont have a clue why 10g worked despite that and why 11g worked sometimes. The bottom line is that
thanks to error stack trace I was able to pinpoint the problem.
Finally, I disabled tracing with:
1
sql>altersystemsetevents'1031tracenameerrorstackoff;namelibrary_cacheoff';
As Miladin pointed out in his blog, errostack tracing is useful also for other common errors, such as ORA
data:text/htmlcharset=utf8,%3Ch2%20class%3D%22posttitle%22%20style%3D%22border%3A%200px%3B%20margin%3A%200.5em%200px%200.3em%
2/3
4/5/2015
Oracle|dbaportal.eu|Page2
00942, where Oracle reports error and then its up to you to pinpoint which permission is missing and this
is more often than not a pain in the *ss.
Side note*: if youre not familiar with tnsManager then you dont know what youre missing, its a great little
gem.
data:text/htmlcharset=utf8,%3Ch2%20class%3D%22posttitle%22%20style%3D%22border%3A%200px%3B%20margin%3A%200.5em%200px%200.3em%
3/3