Chinaunix首页 | 论坛 | 博客
  • 博客访问: 975142
  • 博文数量: 184
  • 博客积分: 10030
  • 博客等级: 上将
  • 技术积分: 1532
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-27 18:32
文章分类

全部博文(184)

文章存档

2009年(1)

2008年(63)

2007年(39)

2006年(79)

2005年(2)

我的朋友

分类: Oracle

2008-06-06 08:29:33

一、安装前准备,机器配置太垃圾了就不要尝试了。512内存,1g的swap,还有500M左右的temp。

如果不够的就自己添加,就不多说了。也可以自己建个新的temp
#mkdir /opt/tmp
#chown root.root /opt/tmp/
# chmod 1777 /opt/tmp
# echo TEMP
# export TEMP=/opt/tmp
# export TEMPDIR=/opt/tmp
系统参数调整

设置shell限制,在/etc/security/limits.conf添加
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

修改login设置,修改 /etc/pam.d/login,添加
session required /lib/security/pam_limits.so

在/etc/profile中添加以下语句:
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

二、安装
需要的软件包有#apt-get install gcc make binutils lesstif2 libc6 libc6-dev rpm libmotif3 libaio1 libstdc++5 gawk

系统中有以下组和用户,方法:
#grep dba /etc/group
#grep oinstall /etc/group
#grep nobody /etc/group

#id oracle
#id nobody

切换到root,添加oralce帐户
#su - root
#groupadd dba # group of users to be granted SYSDBA system privilege
#groupadd oinstall # group owner of Oracle files
#useradd -c "Oracle software owner" -g oinstall -G dba -d /opt/oracle oracle
#passwd oracle
输入oracle密码
************
添加nobody用户组:
#groupadd nobody

把nobody用户添加到新建的nobody组中
#usermod -G nobody nobody

建立oracle目录
#su root
#mkdir /opt/oracle
#chown -R oracle.oinstall /opt/oracle
mkdir -p /u01/app
chown -R oracle.oinstall /u01/app

debian需要额外的做以下操作:
# 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

模拟redhat-3进行安装,新建一个文件/etc/redhat-release,写入以下内容:
Red Hat Enterprise Linux AS release 3 (Taroon)

提前下好安装文件,oracle官方有,cn99上也有,下载后解压到用户目录

切换到oracle用户进行安装

往下要注意中文显示的问题了,不要使用oracle自带的jre

我的机器jre是apt安装的,找到jre的目录,然后
$./runInstaller -jreLoc /usr/lib/jvm/java-6-sun-1.6.0.00/jre

剩下的就和windows一样的安装界面了,都是中文,下一步下一步就是了

需要最高权限执行两个shell。具体干什么用的还没有考虑。

三、启动
oracle启动脚本/etc/init.d/oracle
QUOTE:
su
nano /etc/init.d/oracle
#!/bin/bash
#
# /etc/init.d/oracledb
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface

export ORACLE_HOME=/u01/app/oracle/oracle/product/10.2.0/db_1/
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin

ORA_OWNR="oracle"

# if the executables do not exist -- display error

if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi

# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display

case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
su $ORA_OWNR -c "$ORACLE_HOME/bin/dbstart"
touch /var/lock/oracle

su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole"
su $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctl start"
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su - $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctl stop"
su - $ORA_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"
su - $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
su - $ORA_OWNR -c "$ORACLE_HOME/bin/dbshut"
rm -f /var/lock/oracle

echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0

chmod 755 /etc/init.d/oracledb
update-rc.d oracledb defaults 99

可以通过/etc/init.d/oracle start来启动oracle。
阅读(1343) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~