当前位置: 代码迷 >> SQL >> Oracle sqlplus登陆异步io异常
  详细解决方案

Oracle sqlplus登陆异步io异常

热度:70   发布时间:2016-05-05 14:43:29.0
Oracle sqlplus登陆异步io错误
先简单交代一下操作环境,主机版本为AIX 5307,数据库版本为10.2.0.4。为贪图方便,我从另一环境下(操作系统也为aix 5307),直接将Oracle软件tar至本地主机。然后进行relink all。至此,一切正常。但执行sqlplus时,出现以下问题:
引用
$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.4.0 - Production on Fri Apr 1 09:51:47 2011

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

exec(): 0509-036 Cannot load program oracleorajf because of the following errors:
        0509-130 Symbol resolution failed for /usr/lib/libc.a[aio_64.o] because:
        0509-136   Symbol kaio_rdwr64 (number 1) is not exported from
                   dependent module /unix.
        0509-136   Symbol listio64 (number 2) is not exported from
                   dependent module /unix.
        0509-136   Symbol acancel64 (number 3) is not exported from
                   dependent module /unix.
        0509-136   Symbol iosuspend64 (number 4) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait (number 5) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait64 (number 6) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait_timeout (number 7) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait_timeout64 (number is not exported from
                   dependent module /unix.
        0509-026 System error: Error 0
        0509-192 Examine .loader section symbols with the
                 'dump -Tv' command.
ERROR:
ORA-12547: TNS:lost contact


Enter user-name: ^C

根据以上错误信息,一看就知道是aio配置问题。从AIX 5L开始,AIX开始支持2种aio:legacy AIO 和POSIX AIO。
配置legacy AIO(重启后生效)。可以用smitty aio或者用操作系统命令配置:chdev -P -l aio0 -a autoconfig=’available’
到11g为止,Oracle使用的是POSIX AIO(无需重启),配置POSIX AIO可以用如下命令
chdev -P -l posix_aio0 -a autoconfig=available。
当然也可以执行rootpre.sh来配置posix aio.
引用
# ./rootpre.sh
./rootpre.sh output will be logged in /tmp/rootpre.out_11-04-01.10:04:26
Saving the original files in /etc/ora_save_11-04-01.10:04:26....
Copying new kernel extension to /etc....
Loading the kernel extension from /etc

Oracle Kernel Extension Loader for AIX
       Copyright (c) 1998,1999 Oracle Corporation


Successfully loaded /etc/pw-syscall.64bit_kernel with kmid: 0x3ef8900
Successfully configured /etc/pw-syscall.64bit_kernel with kmid: 0x3ef8900
The kernel extension was successfuly loaded.

Configuring Asynchronous I/O....

Configuring POSIX Asynchronous I/O....

Checking if group services should be configured....
Nothing to configure.

打开rootpre.sh脚本可以看到如下语句,可以清楚的看到在AIX 5307上Oracle执行的就是红色标注部分:
引用
if [ $OSVER -lt 6 ]; then
  log_con "\nConfiguring Asynchronous I/O...."
  AIO=`${LSDEV} -C -t aio|${AWK} '{print $2}'`
  case ${AIO} in
    *Available*) log_con "Asynchronous I/O is already defined"
                 is_autoconfig_available "aio0"
                 if [ $? -ne 1 ]; then
                    log_con "Setting autoconfig to available for aio0"
                    log_do "${CHDEV} -P -l aio0 -a autoconfig=available"
                 fi
                 ;;
      *Defined*) log_do "${MKDEV} -l aio0"
                 log_do "${CHDEV} -P -l aio0 -a autoconfig=available"
                 ;;
              *) log_con "Asynchronous I/O is not installed on this system."
                 log_con "You will need to install it, and either configure it yourself using"
                 log_con "'smit aio' or rerun the Oracle root installation procedure."
                 ;;
  esac

  #--- configure POSIX AIO if AIX 5.2 or greater, we may want to use it
  if [ ${OSVER}${OSREL} -ge 52 ]; then
  log_con "\nConfiguring POSIX Asynchronous I/O...."
  POSIX_AIO=`${LSDEV} -C -t posix_aio|${AWK} '{print $2}'`
  case ${POSIX_AIO} in
    *Available*) log_con "Posix Asynchronous I/O is already defined"
                 is_autoconfig_available "posix_aio0"
                 if [ $? -ne 1 ]; then
                    log_con "Setting autoconfig to available for posix_aio0"
                    log_do "${CHDEV} -P -l posix_aio0 -a autoconfig=available"
                 fi
                 ;;
      *Defined*) log_do "${MKDEV} -l posix_aio0"
                 log_do "${CHDEV} -P -l posix_aio0 -a autoconfig=available"
                 ;;
              *) log_con "Posix Asynchronous I/O is not installed on this system."
                 log_con "You will need to install it, and either configure it yourself using"
                 log_con "'smit aio' or rerun the Oracle root installation procedure."
                 ;;
    esac
  fi
fi

执行结束后sqlplus正常:
引用
# su - oracle
$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.4.0 - Production on Fri Apr 1 10:05:01 2011

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> exit
Disconnected

  相关解决方案