1. 安装操作系统Debian 5.0 amd64
a) /etc/resolv.conf 修改dns
b)
c)
d) 安装系统,设置ip,注意至少要有1024M的交换分区用于Oracle
e) 修改sources.list(手工修改用163的源),升级系统到最新版本
f) deb http://mirrors.163.com/debian stable contrib main non-free
ubuntu
deb http://mirrors.163.com/ubuntu/ hardy main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ hardy-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ hardy-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ hardy-backports main restricted universe multiverse
g) 升级操作系统
i. 更新源
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-cache search wqy
sudo apt-get install xfonts-wqy
h) 安装ssh
apt-get install openssh-server
i) 安装Oracle,apache,nginx使用的类库
sudo apt-get install libc6-i386
sudo apt-get install bc
sudo apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev
sudo apt-get install zip rar
2. 安装Oracle 10g XE
a) 安装需要的包
libaio_0.3.104-1_i386.deb
oracle-xe-universal_10.2.0.1-1.1_i386.deb
sudo dpkg -i --force-architecture libaio_0.3.104-1_i386.deb
sudo dpkg -i --force-architecture oracle-xe-universal_10.2.0.1-1.1_i386.deb
b) 配置Oracle
sudo /etc/init.d/oracle-xe configure
c) 修改Oracle配置
sudo passwd oracle来创建密码
su oracle:
source /etc/profile
d) 修改监听
# listener.ora Network Configuration File:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server)
(GLOBAL_DBNAME = XE)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
e) 监听查看方法
lsnrctl reload
lsnrctl status
f) 设置Oracle各项参数
sqlplus sys/maxinfo@XE as sysdba
SQL>EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE)
shutdown immediate ;
startup mount ;
alter system enable restricted session ;
alter system set JOB_QUEUE_PROCESSES=0;
alter system set AQ_TM_PROCESSES=0;
alter database open ;
alter database character set internal_use ZHS16GBK ;
shutdown immediate ;
startup ;
i. http://168.168.168.59:8080/apex/
g) 修改/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin,下面的listener.ora tnsnames.ora文件中的ip为服务器名称
h) 创建Oracle用户
create tablespace HR_TBSPACE datafile '/usr/lib/oracle/xe/oradata/HR_TBSPACE.dbf' size 1000m;
create user hrsystem identified by maxinfo default tablespace HR_TBSPACE temporary tablespace temp;
grant connect,resource to hrsystem;
3. 安装JDK环境和Jetty,ajaxterm
a) 安装JDK
chmod +x
sudo chown -Rf jetty ./jrmc
i. 安装JDK到 /opt/jrmc目录
ii. 修改/etc/profile,加入:
export JAVA_HOME=/opt/jrmc
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export TNS_ADMIN=/usr/lib/oracle
export PATH=$PATH:$ORACLE_HOME:$ORACLE_HOME/bin:$JAVA_HOME/bin
export ORACLE_SID=XE
source /etc/profile
b) 安装Jetty
i. 复制jetty文件到jetty6目录下解压缩,
ii. 复制.jettyrc文件到jetty目录
iii. 设置jetty自动启动
1. 将jetty安装目录下的jetty.sh cp到/etc/init.d/目录下
sudo cp bin/jetty.sh /etc/init.d/jetty6
2. 修改jetty6 增加 JAVA_HOME、JETTY_HOME
JAVA_HOME=/opt/jrmc
JETTY_HOME=/home/jetty/jetty6
3. 执行:
sudo update-rc.d jetty6 defaults
iv. 下载最新源码:
sudo apt-get install subversion
mkdir workspace
svn co http://dev.bjmaxinfo.com/svn/hr-system/trunk/hr-system -r HEAD
v. 打包(复制.m2.tar.gz,chmod +x *.sh)
c)
4. 导入Oracle数据
a) 导入测试库数据
imp hrsystem/maxinfo@133 file=d:\temp\hr_2010-04-02.dmp
b) 正式库数据需要等
5. 启动系统检查设置
a) 重启系统,检查jetty和Oracle是否正常启动
i. 检查润乾key是否被正确设置(context中的设置,key的设置,驱动的设置等)
6. 安装apache,nginx,ajaxterm,denyhosts
sudo apt-get install denyhosts
7. dns配置文件
a) /etc/resolv.conf
b) Host文件 /etc/hosts
1. 首先启动监听服务
2. cd $ORACLE_HOME #进入到oracle的安装目录
3. dbstart #重启服务器
4. lsnrctl start #重启监听器
来源:oschina
链接:https://my.oschina.net/u/84549/blog/11500