linux平台上面oracle不是自动启动的,需要手动进行,具体操作如下
(一)
在命令模式下面先启动监听:
#>lsnrctl start
这个命令会执行较长时间,需要耐心等待,成功后会出现这样的信息:
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 03-DEC-2010 15:26:25
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /opt/oracle/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /opt/oracle/10.2.0/db_1/network/admin/listener.ora
Log messages written to /opt/oracle/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.16)(PORT=1521)))
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 03-DEC-2010 15:26:27
Uptime 0 days 0 hr. 3 min. 9 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/10.2.0/db_1/network/admin/listener.ora
Listener Log File /opt/oracle/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.16)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "kids21" has 1 instance(s).
Instance "kids21", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
(二)
在命令模式下登录到sqlplus
#>sqlplus /nolog
(三)
转接到数据库,这个时候,数据库还没有启动,只启动了监听
sql>connect /as sysdba
这个地方,如果输入用户名和密码写成:
sql>connect sys/kids21这样的方式连接的话有可能出现这样的错误:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
如果写成这样:
sql>connect sys/kids21@kids21这样的方式连接的话可能出来这样的错误:
ORA-12505: TNS: 监听程序当前无法识别连接描述符中所给出的SID
原因是listener.ora里面是这样配置的:
# listener.ora Network Configuration File: /opt/oracle/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle/10.2.0/db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.16)(PORT = 1521))
)
)
需要在里面加入这样的配置:
# listener.ora Network Configuration File: /opt/oracle/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = kids21)
(ORACLE_HOME = /opt/oracle/10.2.0/db_1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.16)(PORT = 1521))
)
)
也可以直接修改成这样的配置:
# listener.ora Network Configuration File: /opt/oracle/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = kids21)
(ORACLE_HOME = /opt/oracle/10.2.0/db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.16)(PORT = 1521))
)
)
(四)
启动数据库,如果在启动之前就用plsql连接的话可能会出现“connection to server failed,probable Net8 admin err”这样的错误,表明数据库还没有启动,需执行下面的命令
sql>startup
(五)
启动工具连接,如果出现
adapter not available
的错误,则表明服务器的防火墙打开了,需要设置通过
(六)
这个时候,em控制台没有启动,还不能通过浏览器直接访问需要手动启动:
#> emctl start dbconsole
然后http://192.168.1.16:1158/em/就可以访问了
(七)
这个时候,isqlplus没有启动,还不能通过浏览器直接访问isqlplus需要手动启动:
#>isqlplusctl start
然后http://192.168.1.16:5560/isqlplus/就可以访问了
注意:
如果前面检查的时候,网络检查没有通过的话,后面的两步可能都没法启动的。所以一定要参照hosts的配置
(八)
通常情况下,浏览器访问后,所有按钮显示的都是乱码,主要是字体不对应造成的,操作如下:
#>cd /opt/oracle/10.2.0/db_1/jdk/jre/lib
#>mv font.properties font_bak.properties(备份)
#>cp font.properties.zh_CN.Redhat font.properties(改名)
把font.properties的最后一行改成,本机上可以找到的字体如:
filename.-misc-zysong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1=/usr/share/fonts/chinese/TrueType/uming.ttf
#>cp font.properties /opt/oracle/10.2.0/db_1/jre/1.4.2/lib(copy到jre下面)
#>cp font.properties /opt/oracle/10.2.0/db_1/javavm/lib/ojvmfonts(copy到ojvmfonts下面)
#>cd /opt/oracle/10.2.0/db_1/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs
#>rm *.gif(删掉这下面的缓存文件)
#>cd /opt/oracle/10.2.0/db_1/oc4j/j2ee/oc4j_applications/applications/isqlplus/isqlplus/cabo/images/cache/zhs
#>rm *.gif
#>emctl start dbconsole(重启)
#>isqlplusctl start(重启)