Chinaunix首页 | 论坛 | 博客
  • 博客访问: 253622
  • 博文数量: 22
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 518
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-13 12:03
文章分类

全部博文(22)

文章存档

2010年(1)

2009年(1)

2008年(20)

我的朋友

分类: LINUX

2008-03-31 09:12:23

编辑 vi /etc/sysctl.conf file:
 kernel.shmall = 2097152
 kernel.shmmax = 2147483648
 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=262144
 net.core.rmem_max=262144
 net.core.wmem_default=262144
 net.core.wmem_max=262144
运行下面命令使设置生效/sbin/sysctl -p
vi /etc/security/limits.conf
 * soft nproc 2047
 * hard nproc 16384
 * soft nofile 1024
 * hard nofile 65536
vi /etc/pam.d/login
 session required /lib/security/pam_limits.so
vi /etc/selinux/config
 SELINUX=disabled

安装下面的rpm包
rpm -Uvh setarch-2*
rpm -Uvh make-3*
rpm -Uvh glibc-2*
rpm -Uvh glibc-kernheaders*
rpm -Uvh glibc-headers*
rpm -Uvh glibc-devle*
rpm -Uvh libaio-0*
rpm -Uvh compat-libstdc++-33-3*
rpm -Uvh compat-gcc-34-3*
rpm -Uvh compat-gcc-34-c++-3*
rpm -Uvh gcc-4*
rpm -Uvh libXp-1* (AS4U5下没有这个包)
rpm -Uvh openmotif-2*
rpm -Uvh compat-db-4*
建立oracle用户和组

groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle

建立相应的目录
mkdir -p /oracle/app  (oracle将安装到这个目录)
chown -R oracle.oinstall /oracle/app
编辑/etc/redhat-release
vi /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga) 被 redhat-4 替换
登陆oracle 建立相应的环境变量
su - oracle
vi ~/.bash_profile
# Oracle Settings
ORACLE_BASE=/oracle/app/oracle;  export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=orclfweb;  export ORACLE_SID
PATH=$ORACLE_HOME/bin$PATH;  export PATH
export DISPLAY=192.168.0.3:0.0

启动安装程序
./runInstaller
#./runInstaller -ignoreSysPrereqs
安装结束后修改vi /etc/redhat-release 内容为
Red Hat Enterprise Linux Server release 5 (Tikanga)
设置开机启动vi /etc/oratab
TSH1:/u01/app/oracle/product/10.2.0/db_1:Y
编写oracle启动脚本
建立启动脚本 /etc/rc.d/init.d/oracle(注意不能存为windows下txt格式,否则脚本执行错误,vi下使用 % s^m//g来替换掉 ^M字符,Ctrl+v Ctrl+M输入)
/var/log/oracle.log 存放启动的日志,/var/lock/subsys/oracle用于操作系统关闭时,调用关闭脚本方式关闭数据库,否则操作系统将直接杀死数据库进程。
 
#!/bin/bash
#
# source function library
. /etc/rc.d/init.d/functions
LOG_FILE=/var/log/oracle.log
LOCK_FILE=/var/lock/subsys/oracle
start()
{
        touch $LOCK_FILE
        echo "Starting Oracle Database:"
        echo "--------------------------------------------------------------" >> $LOG_FILE
        date +"%T %a %D : Starting Oracle Database as part of system up." >> $LOG_FILE
        echo "--------------------------------------------------------------" >> $LOG_FILE
        su - oracle -c dbstart >> $LOG_FILE
        echo "Done!"
        echo "Starting Oracle Listeners:"
        su - oracle -c "lsnrctl start" >> $LOG_FILE
        echo "Done!"
        echo ""
        echo "--------------------------------------------------------------" >> $LOG_FILE
        date +"%T %a %D : Finished." >> $LOG_FILE
        echo "--------------------------------------------------------------" >> $LOG_FILE
        echo "Oracle Database started."
}
stop()
{
        rm -f $LOCK_FILE
        echo "Shutting Down Oracle Listeners:"
        echo "--------------------------------------------------------------" >> $LOG_FILE
        date +"%T %a %D : Shutting Down Oracle Database as part of system down." >> $LOG_FILE
        echo "--------------------------------------------------------------" >> $LOG_FILE
        su - oracle -c "lsnrctl stop" >> $LOG_FILE
        echo "Done!"
        echo "Shutting Down Oracle Database:"
        su - oracle -c dbshut >> $LOG_FILE
        echo "Done!"
        echo ""
        echo "--------------------------------------------------------------" >> $LOG_FILE
        date +"%T %a %D : Finished." >> $LOG_FILE
        echo "--------------------------------------------------------------" >> $LOG_FILE
        echo "Oracle Database stoped."
}
case "$1" in
        start)
           start
           ;;
        stop)
           stop
           ;;
        *)
           echo "Usage:oracle {start|stop|restart}"
           exit 1
           ;;
esac

设置运行权限
chmod +x /etc/rc.d/init.d/oracle
 
测试脚本
bash /etc/rc.d/init.d/oracle
 
创建链接到 rc3.d和rc5.d
ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc3.d/S89oralce
ln -s /etc/rc.d/init.d/oracle /etc/rc.d/rc5.d/S89oralce

启动企业管理器 em
 $ emctl start dbconsole
 $ emctl stop dbconsole

 (注意 变量ORACLE_SID的值要和数据库全局变量值一致)
启动iSql Plus Web 方式的SQL命令
 $ isqlplus start
 $ isqlplus stop
 
阅读(1631) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~