Monday, November 18, 2013

ORA-12641: Authentication service failed to initialize

Issue:
[oracle@linux01 ~]$ sqlplus system@orcldb

SQL*Plus: Release 11.2.0.3.0 Production on Fri Nov 15 06:44:44 2013

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

Enter password:
ERROR:
ORA-12641: Authentication service failed to initialize

Solution:
Step 1: Open the sqlnet.ora file present at $ORACLE_HOME/network/admin location 
Step 2: Check the value for parameter SQLNET.AUTHENTICATION_SERVICES
Step 3: If the value for SQLNET.AUTHENTICATION_SERVICES is ALL 

The contents of sqlnet.ora are as mentioned below
[oracle@linux01 admin]$ cat sqlnet.ora
# sqlnet.ora Network Configuration File: /u01/app/oracle/product/112030/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (ALL)

Step 4: Change the value for SQLNET.AUTHENTICATION_SERVICES to NONE

SQLNET.AUTHENTICATION_SERVICES= (NONE)



Monday, November 11, 2013

TNS-12555: TNS:permission denied | TNS-12560: TNS:protocol adapter error | TNS-00525: Insufficient privilege for operation | Linux Error: 1: Operation not permitted

Issue: while starting the listener we were getting the below error.

[oracle@linux01 ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 11-NOV-2013 01:53:59

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /app/oracle/diag/tnslsnr/linux01/listener/alert/log.xml
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12555: TNS:permission denied
 TNS-12560: TNS:protocol adapter error
  TNS-00525: Insufficient privilege for operation
   Linux Error: 1: Operation not permitted

Listener failed to start. See the error message(s) above...

The contents of the listener.ora file

[oracle@linux01 ~]$ cd $ORACLE_HOME
[oracle@linux01 admin]$ cat listener.ora
# listener.ora Network Configuration File: /app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = linux01)(PORT = 1521))
    )
  )

Solution 1: Recreate the directory /var/tmp/.oracle as mentioned below & then start the listener.

[oracle@slc00ryy ~]# cd /var/tmp
[oracle@slc00ryy tmp]# ls -la
drwxrwxrwt   2 root     oinstall  4096 Nov 11 02:00 .oracle

[oracle@slc00ryy tmp]# mv .oracle .oracle.orig
[oracle@slc00ryy tmp]# mkdir .oracle
[oracle@slc00ryy tmp]# chmod 01777 .oracle
[oracle@slc00ryy tmp]# chown -R root:oinstall .oracle
[oracle@slc00ryy tmp]# chgrp root .oracle
  
Solution 2: Change the KEY in the listener.ora file to EXTPROC0 (changed 1521 to 0 (zero)) and started the listener. It worked.

[oracle@linux01 admin]$ vi listener.ora
[oracle@linux01 admin]$ cat listener.ora
# listener.ora Network Configuration File: /app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
      (ADDRESS = (PROTOCOL = TCP)(HOST = linux01)(PORT = 1521))
    )
  )

[oracle@linux01 admin]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 11-NOV-2013 01:56:15
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
Starting /app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /app/oracle/diag/tnslsnr/linux01/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linux01)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                11-NOV-2013 01:56:15
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /app/oracle/diag/tnslsnr/linux01/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linux01)(PORT=1521)))
The listener supports no services
The command completed successfully

Thursday, November 7, 2013

ORA-01102: cannot mount database in EXCLUSIVE mode

Environment Details:
OS: Linux Server 5.8 64bit
Version: 11.2.0.3.0
Software Installation location: /u01/app/oracle/product/112030
Database Name: testdb
Datafile's Location: /u01/oradata/testdb

Issue: While starting the database we were getting the error "ORA-01102: cannot mount database in EXCLUSIVE mode".

Error Message:
oracle@linux01=> sqlplus sys as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed Nov 6 04:02:10 2013
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Enter password: 
Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area  680607744 bytes
Fixed Size                  2231472 bytes
Variable Size             507511632 bytes
Database Buffers          163577856 bytes
Redo Buffers                7286784 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode

Excerpt from the Alert log file
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
starting up 1 shared server(s) ...
ORACLE_BASE from environment = /u01/app/oracle
Wed Nov 06 04:02:44 2013
ALTER DATABASE   MOUNT
sculkget: failed to lock /u01/app/oracle/product/112030/dbs/lkTESTDB exclusive
sculkget: lock held by PID: 64
ORA-09968: unable to lock file
Linux-x86_64 Error: 11: Resource temporarily unavailable
Additional information: 64
ORA-1102 signalled during: ALTER DATABASE   MOUNT...

Solution:

  • Shutdown the database which is started(it will be in NOMOUNT Mode)
  • Check if any other process is running for that database, if yes kill those processes.
  • Copy the directory containing the datafiles to a different location.
  • Rename the directory to a different name and move the copied directory back to the same name.
  • Now go to $ORACLE_HOME/dbs and delete the file lkTESTDB
  • Start the database


89-oracle@linux01=> sqlplus sys as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed Nov 6 06:13:15 2013
Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Enter password: 

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown immediate 
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> exit

oracle@linux01=> ps -ef|grep testdb
oracle     974  6086  0 00:09 pts/1    00:00:00 grep testdb

oracle@linux01=> cd /u01/oradata
oracle@linux01=> cp -r testdb testdb.1
oracle@linux01=> mv -r testdb testdb.old
oracle@linux01=> mv testdb.1 testdb
oracle@linux01=> cd $ORACLE_HOME/dbs
oracle@linux01=> rm lkTESTDB

oracle@linux01=> sqlplus sys as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Wed Nov 6 04:25:12 2013
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Enter password: 
Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  680607744 bytes
Fixed Size                  2231472 bytes
Variable Size             507511632 bytes
Database Buffers          163577856 bytes
Redo Buffers                7286784 bytes
Database mounted.
Database opened.
SQL> exit