本文不需要安装Debian的桌面环境,具体的安装步骤如下:
1,修改/etc/apt/source.list,加入:
deb http://ftp.sjtu.edu.cn/debian/ squeeze main non-free contrib
deb http://ftp.sjtu.edu.cn/debian/ squeeze-proposed-updates main non-free contrib
deb http://ftp.sjtu.edu.cn/debian-security/ squeeze/updates main non-free contrib
deb http://mirrors.163.com/debian/ squeeze main non-free contrib
deb http://mirrors.163.com/debian/ squeeze-proposed-updates main non-free contrib
deb http://mirrors.163.com/debian-security/ squeeze/updates main non-free contrib
2,安装必要的软件
apt-get install build-essential alien debhelper gawk gettext html2text intltool-debian ksh lesstif2 libaio-dev libaio1 libbeecrypt7 libdb4.2 libmotif4 libelf-dev libelf1 libltdl7 libltdl-dev libodbcinstq1c2 libqt4-core libqt4-gui librpm1 libsqlite3-0 libstdc++6 libstdc++5 lsb lsb-core lsb-cxx lsb-desktop lsb-graphics lsb-qt4 lsb-rpm odbcinst1debian2 pax po-debconf sysstat unixodbc unixodbc-dev elfutils libeb13-dev pdksh
apt-get install sun-java6-jdk p7zip-full xorg ttf-wqy-zenhei
3,增加swap分区
dd if=/dev/zero of=/tmp/swap bs=1M count=1024
chmod 600 /var/tmp/swap
mkswap /var/tmp/swap
swapon /var/tmp/swap
可以使用swapon -s 来查看交换分区,在安装完oracle后使用命令swapoff /var/tmp/swap关闭交换分区
4、创建用户
要用oracle用户安装和启动数据库
groupadd oinstall
groupadd dba
groupadd nobody //创建这个组是因为oracle支持的redhat系统中默认有这个组,为了欺骗oracle,所以要建立这
个组
useradd -g oinstall -G dba -s /bin/bash -m -d /home/oracle oracle //新建一个oracle用户
passwd oracle //设置用户oracle的登录密码
usermod -g nobody nobody //将用户nobody用户添加到nobody组里
5,修改内核参数
vim /etc/sysctl.conf
添加:
kernel.shmmax = 3147483648
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
保存后执行 sysctl -p 是修改生效
6,创建链接
ln -s /usr/bin/awk /bin/awk
ln -s /usr/bin/rpm /bin/rpm
ln -s /usr/bin/basename /bin/basename
ln -s /etc /etc/rc.d
7,编辑/etc/profile
在文件末尾添加
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384
ulimit -n 65536
fi
fi
8,编辑/etc/security/limits.conf
在文件末尾添加
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
修改/etc/pam.d/login,添加
session required /lib/security/pam_limits.so
修改/etc/pam.d/su,添加
session required /lib/security/pam_limits.so
9,设置用户环境
vim /home/oracle/.profile
添加:
export ORACLE_BASE=/home/oracle/oracle
export ORACLE_HOME=$ORACLE_BASE/product/ 11.2.0 /db_1
export ORACLE_SID=test
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
将umask 022前的#删除
保存退出
echo "export DISPLAY=*.*.*.*:0.0" >> /home/oracle/.profile // //*.*.*.*指安装了NetSarang Xmanager Enterprise的
机器的IP地址
vim /home/oracle/.bashrc
添加:
ORACLE_BASE=/home/oracle/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
ORACLE_SID=test
TNS_ADMIN=$ORACLE_HOME/network/admin
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_BASE
export ORACLE_HOME
export ORACLE_SID
export TNS_ADMIN
export LD_LIBRARY_PATH
export PATH
unset USERNAME
10,安装准备
通过apt-get安装JDK的默认路径为/usr/lib/jvm/java-6-sun-1.6.0.26/
mkdir -p /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/fonts/fallback
cp /usr/share/fonts/truetype/wqy/wqy-zenhei.ttc /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/fonts/fallback
cd /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/fonts/fallback
mkfontdir
mkfontscale
echo "Red Hat Linux release 4.1" > /etc/redhat-release
11,安装过程
在一台windows机器上安装NetSarang Xmanager Enterprise,并且运行xmanager –Passive模式
假设下载的linux_11gR2_database_1of2.zip,linux_11gR2_database_2of2.zip在/opt下,执行:
7z x /opt/linux_11gR2_database_1of2.zip -o/opt
7z x /opt/linux_11gR2_database_2of2.zip -o/opt //解压文件到/opt目录
su – oracle //切换到用户oracle
cd /opt/database
./runInstaller -jreLoc /usr/lib/jvm/java-6-sun/jre
运行./runInstaller后,在安装了NetSarang Xmanager Enterprise的机器上就会弹出
oracle的安装界面,取消email输入,按向导完成安装步骤即大功告成。