sqlplus timeout when connnecting

If you are using a pam_ldap or pam_nis environement and it happend that sqlplus does not want to connect as user but it does as root, waiting for :

socket(PF_FILE, SOCK_STREAM, 0)         = 3
connect(3, {sa_family=AF_FILE, path="/var/run/.nscd_socket"}, 110) =
-1 ENOENT (No such file or directory)
close(3)                                = 0
open("/etc/hosts", O_RDONLY)            = 3
fcntl64(3, F_GETFD)                     = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=286, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE
|MAP_ANONYMOUS, -1, 0) = 0x45b78000
read(3, "127.0.0.1tlocalhost.localdomaint"..., 4096) = 286
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x45b78000, 4096)                = 0
getpid()                                = 26002
getuid32()                              = 1121
futex(0x41239198, FUTEX_WAIT, 2, NULL 

You just to have make sure to have nscd up and running. dunno what sqlplus does :(

This entry was posted in Oracle. Bookmark the permalink.
  • http://www.suehappycowboy.org Outtascope

    Thank You! What an insane cause, I would NEVER have figured that out myself. Thank you, thank you, thank you!

  • Pingback: Outtascope Musings » Blog Archive » Hero for the day (sqlplus hang on linux)

  • Steve

    I kept Googling for “SQLPLUS HANGS”. I should have searched for “Oracle Miracle” first off.

    Thanks a lot, Chmouel. You saved me tons of grief!

  • http://krul.nu Dennis Krul

    Hah! Thanks for posting about this issue on your weblog! You probably just saved me a couple of hours worth of debugging time ;)

  • Teftin

    Thanks. I had the same problem. Other solution: if the users (in my case they are app-specific demon users) are in local database (/etc/passwd), switching in nsswitch.conf to:
    passwd: compat ldap
    stops hangs of sqlplus (or dbd::oracle ;) when runnig from local users.

    php-oci binding seams to be immune to this, as they are not using ociserverattach.