Oracle11G for Linux安装记录
#!/bin/bash
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 505 asmoper
groupadd -g 506 asmdba
useradd -g oinstall -G dba,asmdba,oper oracle
useradd -g oinstall -G asmadmin,asmdba,asmoper grid
echo grid|passwd --stdin grid
echo oracle|passwd --stdin oracle
/*新建目录*/
mkdir -p /oracle/app/grid
mkdir -p /oracle/app/11.2.0/grid
mkdir -p /oracle/app/oraInventory
mkdir -p /oracle/app/oracle
chown -R grid:oinstall /oracle
chown -R grid:oinstall /oracle/app/oraInventory
chown -R oracle:oinstall /oracle/app/oracle
chmod -R 775 /oracle
#/*修改linux内核参数*/
echo "kernel.shmmax = 536870912" >> /etc/sysctl.conf
echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
echo "kernel.shmall = 2097152" >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
echo "fs.file-max = 65536" >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 1024 65000" >> /etc/sysctl.conf
echo "net.core.rmem_default = 4194304" >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf
echo "net.core.wmem_default = 4194304" >> /etc/sysctl.conf
echo "net.core.wmem_max = 4194304" >> /etc/sysctl.conf
echo "kernel.panic = 60" >> /etc/sysctl.conf
#/*修改oracle用户登录使用资源数*/
echo "oracle soft nofile 65536" >> /etc/security/limits.conf
echo "oracle hard nofile 65536" >> /etc/security/limits.conf
echo "oracle soft nproc 16383" >> /etc/security/limits.conf
echo "oracle hard nproc 16384" >> /etc/security/limits.conf
echo "grid soft nofile 65536" >> /etc/security/limits.conf
echo "grid hard nofile 65536" >> /etc/security/limits.conf
echo "grid soft nproc 16383" >> /etc/security/limits.conf
echo "gird hard nproc 16384" >> /etc/security/limits.conf
#/*修改登录模块*/
echo "session required pam_limits.so" >> /etc/pam.d/login
############################################################
alias qsqlplus='rlwrap sqlplus'
alias qrman='rlwrap rman'
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/home/oracle/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0; export ORACLE_HOME
ORACLE_SID=racdb; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK"
export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"
#########################################################
17 rpm -ivh libaio-0.3.107-10.el6.i686.rpm
18 rpm -ivh libaio-devel-0.3.107-10.el6.i686.rpm
19 rpm -ivh compat-libstdc++-33-3.2.3-69.el6.i686.rpm
20 yum install ompat-libstdc++-33-3.2.3-69.el6.i686.*
21 yum install ompat-libstdc++-33-3.2.3-69.el6.i*
22 yum install compat-libstdc++-33-3.2.3-69.el6.i*
23 rpm -ivh libgcc-4.4.7-4.el6.i686.rpm
24 rpm -ivh libstdc++-4.4.7-4.el6.i686.rpm
25 rpm -ivh libstdc++-devel-4.4.7-4.el6.i686.rpm
26 rpm -ivh unixODBC-2.2.14-12.el6_3.i686.rpm
27 yum install unixODBC-2.2.14-12.el6_3.i686*
28 rpm -ivh unixODBC-devel-2.2.14-12.el6_3.i686.rpm
##############################################################
12 vim /etc/security/limits.conf
13 vim /etc/pam.d/login
14 vim /etc/sysctl.conf
15 mkdir -p /usr/share/fonts/zh_CN/TrueType
16 cd /mnt/hgfs/BaiduYunDownload/linux_x86_32_oracle11R2/
17 ls
18 cp zysong.ttf /usr/share/fonts/zh_CN/TrueType/
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat numactl unixODBC unixODBC-devel | grep "not installed"
yum install compat-libstdc++-33 libaio-devel unixODBC unixODBC-devel
23 rpm -ivh /media/Packages/compat-libcap1-1.10-1.x86_64.rpm
24 rpm -ivh /media/Packages/compat-libcap1-1.10-1.i686.rpm
25 yum install compat-libcap1-1.10-1.i686*
26 groupadd oinstall
27 groupadd dba
28 useradd -g oinstall -G dba
29 useradd -g oinstall -G dba oracle
30 passwd oracle
31 vim /home/oracle/.bash_profile
32 cat /home/oracle/.bash_profile
33 mkdir -p /oracle/app/oracle
34 chown -R oracle:oinstall /oracle/
35 chmod -R 775 /oracle/
36 sysctl -p
########################################################################################
[root@rac2 ~]# cat /etc/security/limits.conf
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#
#
#Where:
#
# - an user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
#
#
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#
#
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open files
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit (KB)
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to values: [-20, 19]
# - rtprio - max realtime priority
#
#
#
#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
#ORACLE SETTING
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
# End of file
########################################################################################################################################################
[root@rac2 ~]# vim /etc/pam.d/login
#%PAM-1.0
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session required pam_selinux.so open
session required pam_namespace.so
session optional pam_keyinit.so force revoke
session include system-auth
-session optional pam_ck_connector.so
session required pam_limits.so
########################################################################################################################################################
[root@rac2 ~]# cat /etc/pam.d/login
#%PAM-1.0
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session required pam_selinux.so open
session required pam_namespace.so
session optional pam_keyinit.so force revoke
session include system-auth
-session optional pam_ck_connector.so
session required pam_limits.so
########################################################################################################################################################
[root@rac2 ~]# cat /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1
# Disable netfilter on bridges.
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536
# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536
# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
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