2009年3月17日星期二

Oracle XE installed on SUSE 10 sp1 with none oracle account

根据oracle的规则,oracle的安装需要用oracle用户,但是因为环境的原因,所以不能用oracle用户安装oracle xe.
根据服务器上的经验,所以选择替代用户在本地建立本地账户。
在安装前,需要重新启动机器。保持kenerl的完整。 在offical的提示里面需要更改kernel的参数和oracle安装一样。这次装就没有 tips: 使用sysctl -p 可以在suse下/etc/sysctl.conf文件立即生效,同理与mount -a
1. #groupadd dba
#useradd -g dba -d /home/oracle -s /bin/bash oracle
$vi .profile
#!/bin/bashumask 022sh /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.shLC_CTYPE=C;export LC_CTYPEORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server; export ORACLE_HOMEPATH=$ORACLE_HOME/bin:$PATH; export PATHORACLE_SID=XE;export ORACLE_SIDLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:; export LD_LIBRARY_PATHTMP=/tmp; export TMPLANG=zh_CN.GBK; export LANGLC_ALL=zh_CN.GBK; export LC_ALLLANGUAGE=zh_CN.GBK; export LANGUAGENLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"; export NLS_LANG

2. #rpm -ivh oracle-xe-univ-10.2.0.1-1.0.i386.rpm
3. # chown -R oradmin1:dba /usr/lib/oracle/

4. 由于不是用默认的oracle用户修改,只能将启动和configure文件里的部分参数修改成已知参数,主要是将已写oracle改成oradmin1

Oracle Database 10g Express Edition Configuration-------------------------------------------------This will configure on-boot properties of Oracle Database 10g Express Edition. The following questions will determine whether the database should be starting upon system boot, the ports it will use, and the passwords that will be used for database accounts. Press to accept the defaults. Ctrl-C will abort.
Specify the HTTP port that will be used for Oracle Application Express [8080]:
Specify a port that will be used for the database listener [1521]:9093
Specify a password to be used for database accounts. Note that the samepassword will be used for SYS and SYSTEM. Oracle recommends the use of different passwords for each database account. This can be done after initial configuration:Confirm the password:
Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:y
Starting Oracle Net Listener...DoneConfiguring Database...DoneStarting Oracle Database 10g Express Edition Instance...DoneInstallation Completed Successfully.To access the Database Home Page go to "http://127.0.0.1:8080/apex"

网上说最好把监听端口改成8080,否则启动不起来。。。

5.# ps -ef grep oradmin1

oradmin1 5687 1 0 16:45 ? 00:00:00 xe_pmon_XE
oradmin1 5689 1 0 16:45 ? 00:00:00 xe_psp0_XE
oradmin1 5691 1 0 16:45 ? 00:00:00 xe_mman_XE

实例已经装载,但是监听没起来。

6.# netstat -an grep 9093
# netstat -an grep 8080
无结果,

7. /etc/init.d/oracle-xe status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 17-MAR-2009 16:49:45
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refusedConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=cnshc0030)(PORT=9093)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener Linux Error: 111: Connection refused

因为第一个没起来。。其实发觉第一段没用,用的是IPC,
所以到$ORACLE_HOME/network/admin/listener.ora把那一段给mark掉。
然后再启动lsrnctl start

8. # /etc/init.d/oracle-xe status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 17-MAR-2009 16:51:58
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=cnshc0030)(PORT=9093)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 10.2.0.1.0 - ProductionStart Date 17-MAR-2009 16:51:28Uptime 0 days 0 hr. 0 min. 29 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFDefault Service XEListener Parameter File /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/listener.oraListener Log File /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/log/listener.logListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cnshc0030.cnsh)(PORT=9093))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=8080))(Presentation=HTTP)(Session=RAW))Services Summary...Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...Service "XE" has 1 instance(s). Instance "XE", status READY, has 1 handler(s) for this service...Service "XEXDB" has 1 instance(s). Instance "XE", status READY, has 1 handler(s) for this service...Service "XE_XPT" has 1 instance(s). Instance "XE", status READY, has 1 handler(s) for this service...The command completed successfully

这个时候就启动了,同时listener启动的时候8080端口也同时启动了。
可以用url访问web管理页面


附注:修改部分节选more /tmp/oracle-xe
export SAVE_LLP=$LD_LIBRARY_PATH
export RETVAL=0
exportORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
#ORACLE_OWNER=oracle
export ORACLE_OWNER=oradmin1
export ORACLE_SID=XE
export LSNR=$ORACLE_HOME/bin/lsnrctl
export SQLPLUS=$ORACLE_HOME/bin/sqlplus
export SU=/bin/su
export PATH=$ORACLE_HOME/bin:$PATH
export LOG="$ORACLE_HOME_LISTNER/listener.log"
export LC_ALL=C
export CONFIG_NAME=oracle-xe
export CONFIGURATION="/etc/sysconfig/$CONFIG_NAME"
/bin/chown oradmin1:dba $ORACLE_HOME/network/admin/listener.ora

没有评论: