oracle安装
1.上传解压
2.yum源配置
2.1本地yum源配置
查看挂载的设备df -h
挂载 mount /dev/scd0 /mnt
cd /etc/yum.repos.d/ vi rhel-source.repo [yum] name=Red Hat Enterprise Linux $releasever -$basearch - Debug
baseurl=file:///mnt/Server 注意是是三个/ enabled=1 gpgcheck=0
yum list
3.执行以下脚本
#let script exit if a command fails(remember:this command should use at the top of the scripts)
set -o errexit
#let script exit if an unused variable is used
set -o nounset
#!/bin/bash #Purpose:Create 3 groups named 'oinstall','dba','oper', plus 1 users named 'oracle'. #Also setting the Environment #variable for oracle user. #variable for grid user. #Usage:Log on as the superuser('root'),and then execute the command:#./1preusers.sh #Author:eric echo "Now create 3 groups named 'oinstall','dba','oper'" echo "Plus 1 users named 'oracle',Also setting the Environment" groupadd -g 1000 oinstall groupadd -g 1300 dba groupadd -g 1301 oper useradd -u 1101 -g oinstall -G dba,oper -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle echo "node1" | passwd --stdin oracle cat >>/home/oracle/.bash_profile <<EOF export ORACLE_BASE=/opt/oracle export ORACLE_HOME=\$ORACLE_BASE/product/11201/db1 export ORACLE_SID=orcl export ORACLE_OWNER=oracle export PATH=\$PATH:\$ORACLE_HOME/bin:\$HOME/bin export PATH=\$ORACLE_HOME/bin:\$PATH LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib export LD_LIBRARY_PATH CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib CLASSPATH=\$CLASSPATH:\$ORACLE_HOME/network/jlib export CLASSPATH export ORA_NLS33=\$ORACLE_HOME/nls/data export LANG=en_US EOF source /home/oracle/.bash_profile echo "192.168.81.11 oracle" >> /etc/hosts echo "The Groups and users has been created" echo "The Environment for oracle also has been set successfully" #Purpose:Create the necessary directory for oracle users and change the authention to oracle users. #Usage:Log on as the superuser('root'),and then execute the command:#./2predir.sh #Author:eric echo "Now create the necessary directory for oracle users and change the authention to oracle users..." mkdir -p /opt/oracle chown -R oracle:oinstall /opt chmod -R 775 /opt mkdir -p /opt/oracle/oradata mkdir -p /opt/oracle/product/11201/db1 mkdir /opt/oraInventory/ chown oracle:oinstall /opt/oracle/ -R chown oracle:oinstall /opt/oraInventory/ -R echo "The necessary directory for oracle users and change the authention to oracle users has been finished" #Purpose:Change the /etc/security/limits.conf. #Usage:Log on as the superuser('root'),and then execute the command:#./3prelimits.sh echo "Now modify the /etc/security/limits.conf,but backup it named /etc/security/limits.conf.bak before" cp /etc/security/limits.conf /etc/security/limits.conf.bak cat >>/etc/security/limits.conf <<EOF oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 EOF #Purpose:Modify the /etc/sysctl.conf. #Usage:Log on as the superuser('root'),and then execute the command: #./4presysctl.sh echo "Now modify the /etc/sysctl.conf,but with a backup named /etc/sysctl.bak" cp /etc/sysctl.conf /etc/sysctl.conf.bak cat >>/etc/sysctl.conf <<EOF fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 4294967295 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048586 EOF /sbin/sysctl -p yum -y install binutils compat-db compat-libstdc++-296 compat-libstdc++-33 control-center gcc gcc-c++ glibc glibc-common libstdc++ libstdc++-devel make pdksh sysstat xscreensaver setarch libaio libaio-devel libXp elfutils-libelf-devel
4.图形化配置
5.OK 棒棒哒
ps:1.yum安装rpm包时遇到“warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY”的解决办法
在Redhat Linux下用yum安装rpm时有时候会出现下面错误导致安装失败
- warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID*****
这是由于yum安装了旧版本的GPG keys造成的,解决办法是可以运行下面命令:
$ sudo rpm --import /etc/pki/rpm-gpg/RPM*
We only live once, and time just goes by.