具体的准备及安装部分见:http://blog.csdn.net/sunnyishere/article/details/3950114。下面主要是较麻烦解决的问题记录。
未装图形界面,静默安装了oracel10g,在配置安装网络监听时一直报错:
[oracle@localhost 102]$ ./bin/netca /silent /responseFile /opt/oracle/netca.rsp Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/oracle/product/102/jdk/jre/lib/i386/libawt.so: libXt.so.6: cannot open shared object file: No such file or directory
单独下载了libXp,libXt,libXi 等包安装未解决,结果:
yum install libXt.i686 libXtst.i686
给解决了。
创建数据库实例继续报错:
[oracle@localhost 102]$ ./bin/dbca -silent -responseFile /opt/oracle/dbca.rsp Template General Purpose does not exist. Please specify an existing template for database creation.
编辑dbca.rsp文件,修改TEMPLATE配置
#----------------------------------------------------------------------------- # Name : TEMPLATENAME # Datatype : String # Description : Name of the template # Valid values : Template name as seen in DBCA # Default value : None # Mandatory : Yes #这里原来是 TEMPLATENAME = "General Purpose" #----------------------------------------------------------------------------- TEMPLATENAME = "General_Purpose.dbc"
然后继续正常,创建有进度百分比了,到了100%成功了。
客户端机器用plsql配置好tns,连接报错:
原本已为一切就绪,只要创建用户,结果在数据库服务器本机sqlplus sys/密码 可以登录,但如何指定服务名sqlplus sys/密码@hzdev as sysdba 就报连接失败,百思不得其解。
使用
[oracle@localhost ~]$ lsnrctl status hzdev LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 19-MAR-2013 16:37:10 Copyright (c) 1991, 2005, Oracle. All rights reserved. Connecting to (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=hzdev.localdomain))(ADDRESS=(PROTOCOL=TCP)(HOST=60.191.124.xxx)(PORT=1521))) TNS-12535: TNS:operation timed out TNS-12560: TNS:protocol adapter error TNS-00505: Operation timed out Linux Error: 110: Connection timed out
发现连接的host并不是我本地的ip,百思不得其解。最后一想,反向找这IP发现是公司域名,才勉强想起来,在静默安装数据库实例hzdev时,我设置了 数据库全局名称 GODBNAME=db.hz.xxxxxx.com xxxxx即公司域名。
再用lsnrctl 看状态
[oracle@localhost ~]$ lsnrctl status LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 19-MAR-2013 16:46:23 Copyright (c) 1991, 2005, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production Start Date 19-MAR-2013 16:12:17 Uptime 0 days 0 hr. 34 min. 5 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /opt/oracle/product/102/network/admin/listener.ora Listener Log File /opt/oracle/product/102/network/log/listener.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.222.138.250)(PORT=1521))) Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... Service db.hz.xxxxx.com has 1 instance(s). Instance "hzdev", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully
看到这,将客户端tns里的service_name 由hzdev修改为上面红色域名,客户端终于给连接成功了。
用域名做service_name还是不爽的,于是编辑$ORACLE_HOME/network/admin/listener.ora
将我注册监听
SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /opt/oracle/product/102) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = db.hz.xxxxx.com) (ORACLE_HOME = /opt/oracle/product/102) (SID_NAME = hzdev) ) ) 上面的 (GLOBAL_DBNAME = db.hz.xxxxx.com) 给删除了。 再lsnrctl reload ,客户端也修改service_name=hzdev 一切都正常了。
为什么会这样,需要自己去搜下: oracle 监听 动态注册 静态注册了。