Oracle系列-01oracle11g数据库安装
echo "192.168.126.51 webdb">> /etc/hosts
cat /etc/hosts
echo "export LANG=en_US" >> ~/.bash_profile
cat ~/.bash_profile
source ~/.bash_profile
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba -d /home/oracle oracle
echo oracle|passwd --stdin oracle
mkdir -p /oracle/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /oracle
mkdir -p /oracle/app/oracle/oradata/
chown -R oracle:oinstall /oracle/app/oracle/oradata/
mkdir -p /oracle/app/oracle/archive
chown -R oracle:oinstall /oracle/app/oracle/archive
mount /dev/cdrom /mnt
cd /etc/yum.repos.d
mkdir bk
mv *.repo bk/
echo "[EL]" >> /etc/yum.repos.d/itpux.repo
echo "name =Linux 6.x DVD" >> /etc/yum.repos.d/itpux.repo
echo "baseurl=file:///mnt" >> /etc/yum.repos.d/itpux.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/itpux.repo
echo "enabled=1" >> /etc/yum.repos.d/itpux.repo
cat /etc/yum.repos.d/itpux.repo
# From Public Yum or ULN
yum install binutils -y
yum install compat-libcap1 -y
yum install compat-libstdc++-33 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc-devel -y
yum install ksh -y
yum install libgcc -y
yum install libstdc++ -y
yum install libstdc++-devel -y
yum install libaio -y
yum install libaio-devel -y
yum install libXext -y
yum install libXtst -y
yum install libX11 -y
yum install libXau -y
yum install libxcb -y
yum install libXi -y
yum install make -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
yum install unzip -y
yum install lrzsz -y
yum install -y tigervnc-*
vi /etc/security/limits.conf
#ORACLE SETTING
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 16384
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 8000000
oracle soft memlock 8000000
vi /etc/security/limits.d/90-nproc.conf
* soft nproc 16384
echo "session required pam_limits.so" >> /etc/pam.d/login
cat /etc/pam.d/login
vi /etc/sysctl.conf
#ORACLE SETTING
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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
kernel.panic_on_oops = 1
kernel.shmmax = 5033164800
kernel.shmall = 1228800
kernel.shmmni = 4096
vm.nr_hugepages = 2500
sysctl -p
cat /proc/meminfo
cat /sys/kernel/mm/transparent_hugepage/defrag
[always] madvise never
cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
vi /etc/rc.d/rc.local
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
chmod +x /etc/rc.d/rc.local
yum install numactl -y
numactl --hardware
vi /etc/default/grub linux7
numa=off
grub2-mkconfig -o /etc/grub2.c
or
vi /etc/grub.conf linux6
numa=off
重启即可
pvcreate /dev/sdc /dev/sdd /dev/sde /dev/sdf
vgcreate backvg /dev/sdc /dev/sdd /dev/sde /dev/sdf
lvcreate -n backuplv -L 6000000M backvg
pvs
vgs
lvs
mkfs.ext4 /dev/backvg/backuplv
vi /etc/selinux/config
SELINUX=disabled
setenforce 0
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service
or
service iptables stop
chkconfig iptables off
service iptables status
su - oracle
vi ~/.bash_profile
PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_UNQNAME=webdb
ORACLE_SID=webdb; export ORACLE_SID
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
PATH=.:$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_BASE/product/11.2.0/db_1/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
umask=022
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -u 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
$ source ~/.bash_profile