linux_oracle配置文档
时间:2021-07-01 10:21:17
帮助过:9人阅读
必须配置固定IP地址1、系统需求硬件需求:内存2G,SWAP4G ,磁盘空间大于8G,TMP大于1G软件需求:yum install elfutils-libelf-devel gcc gcc-c++ libaio-devel sysstat unixODBC unixODBC-devel compat-libstdc++-33-3.2.3 -yrpm -ivh pdksh-5.2.14-36.el5.i386.rpm用户环境:groupadd oinstall&&groupadd dba&&useradd -g oinstall -G dba oracle passwd oraclemkdir /opt/oracle&&chown -R oracle:oinstall /opt/&&chmod -R 775 /opt[root@dbserver ~]# vim ~oracle/.bash_profile……ORACLE_BASE=/optORACLE_HOME=$ORACLE_BASE/oracleORACLE_OWNER=oracleORACLE_TERM=xtermORACLE_SID=orclPATH=$ORACLE_HOME/bin:$PATH:$HOME/binLANG=zh_CN.UTF-8export ORACLE_BASE ORACLE_HOME LANG ORACLE_OWNER ORACLE_TERM ORACLE_SID PATH内核要求:vim /etc/sysctl.conffs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586sysctl -p会话要求:vim /etc/pam.d/loginsession required pam_limits.sovim /etc/security/limits.conforacle soft nproc 8192oracle hard nproc 16384oracle soft nofile 32768oracle hard nofile 65536reboot 以ORACLE用户登录二、ORACLE安装mkdir /opt/sourcedbcp -rv /misc/cd/* /opt/sourcedbcd /opt/sourcedb./runInstaller -jreLoc /usr/lib/jvm/jre-1.6.0如果提示网络配置助手(net configuration assistant)出错,关闭安装程序,删除产品清单目录,重新安装。rm -rf /opt/oracle/oraInventory/三、ORACLE配置1、运行dbstart时启动数据库实例vim /etc/orataborcl:/opt/oracle:Y2、启动ORACLE数据库ORACLE侦听器:lsnrctl status/start/stopORACLE企业管理器:emctl start/stop/status dbconsole启动关闭ORACLE数据库:dbstart/dbshutvim /opt/oracle/bin/dbstart把ORACLE_HOME_LISTNER=$1替换为ORACLE_HOME_LISTNER=$ORACLE_HOMEvim /opt/oracle/bin/dbshut把ORACLE_HOME_LISTNER=$1替换为ORACLE_HOME_LISTNER=$ORACLE_HOME3、为避免手动启动ORACLE数据库,需将ORACLE注册为系统服务vim /root/oracled#!/bin/bash# chkconfig: 35 88 99# description: Oracle Database Service Daemon.ORACLE_BASE="/opt"ORACLE_HOME=$ORACLE_BASE/oracleORACLE_OWNER=oraclecase "$1" in start) su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start" #//启用监听器 su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME" #//启用数据库 su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole" #//启用OEM ;; stop) su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole" #//停止OEM su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME" #//停止数据库 su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop" #//停止监听器 ;; status) if(pgrep "tnslsnr" && netstat -anpt | grep ":1521") &> /dev/null then echo "Oracle 11g Net Listener is running." else