亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

醬油DBA奉獻 Oracle 11gR2 RAC on linux 集成腳本化安裝(三)

發布時間:2020-08-11 06:28:00 來源:ITPUB博客 閱讀:198 作者:dshrg 欄目:關系型數據庫
醬油DBA奉獻 Oracle 11gR2 RAC on linux 集成腳本化安裝(三)


作為一個甲方醬油DBA,怎么可能不會搭建RAC?下面講講甲方醬油DBA是怎么腳本化安裝RAC的?(本人已有10+套RAC搭建經驗,AIX,HP-UNIX,LINUX,如有問題歡迎咨詢)
本文用途:Linux平臺下RAC集成腳本化安裝。
     網上也有形形色色的腳本化安裝,有一些是問題的。本文把有問題的部分已經去除,現已安全使用。(僅限我的生產環境,其余朋友的生產環境慎用,如出現問題概不負責任)。
本文精華:“腳本化”三字概括,希望對醬油的DBA們有用


醬油DBA奉獻ORACLE數據庫監控健康腳本(一)
http://www.itpub.net/thread-1841912-1-1.html


醬油DBA奉獻expdp,impdp多用戶遷移數據(二)
http://www.itpub.net/thread-1868059-1-1.html


醬油DBA奉獻 Oracle 11gR2 RAC on linux 集成腳本化安裝(三)
http://www.itpub.net/thread-1900973-1-1.html


環境:
 操作系統:redhat 6.2 64bit
 數據庫:rac 11.2.0.4.0
 存儲:EMC VNX5700




11gR2 RAC on linux 集成腳本化安裝




1.基本環境腳本安裝


cat dou.sh  =>為了收集dou.1sh腳本日志
sh dou1.sh >dou.log


cat dou1.sh =>腳本如下:
echo "###Information Collection###"
##############################################
#Information Collection             #
##############################################
echo "###redhat version###"
cat /etc/redhat-release
echo "###os memory###"
cat /proc/meminfo  | grep  MemTotal
echo "###os swap###"
cat /proc/meminfo | grep SwapTotal
echo "###os filesystem###"
df -h
echo "###os cpu numbers###"
cat /proc/cpuinfo |grep "processor"|wc -l 
echo "###os cpu cores###"
cat /proc/cpuinfo |grep "cores"|uniq 


echo "###create group and user###"
##############################################
#create group and user     #
##############################################
/usr/sbin/groupadd -g 1000 oinstall
/usr/sbin/groupadd -g 1020 asmadmin
/usr/sbin/groupadd -g 1021 asmdba
/usr/sbin/groupadd -g 1022 asmoper
/usr/sbin/groupadd -g 1031 dba
/usr/sbin/groupadd -g 1032 oper


useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,dba grid
useradd -u 1101 -g oinstall -G dba,oper,asmdba oracle




echo "###create /etc/oraInst.loc###"
##############################################
#create /etc/oraInst.loc                     #
##############################################
echo "inventory_loc=/oracle/app/oracle/oraInventory" >>/etc/oraInst.loc
echo "inst_group=oinstall" >>/etc/oraInst.loc


echo "###create directory and Privilege###"
##############################################
#create directory and Privilege              #
##############################################
mkdir -p /oracle/app/11.2.0/grid
mkdir -p /oracle/app/grid
mkdir -p /oracle/app/oracle/oraInventory
chown grid:oinstall /oracle/app/11.2.0/grid
chown grid:oinstall /oracle/app/grid
chmod -R 775 /oracle/
chown -R grid:oinstall /oracle
chown oracle:oinstall /oracle/app/oracle


echo "###LINUX optimize parameters####"


##############################################
#modify  sysctl.conf  | memory=64G           #
##############################################
cat >> /etc/sysctl.conf <<done
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6553600
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 = 1048576
fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmmax = 34359738368
kernel.shmall = 16777216
done
sleep 1
sysctl -p
sleep 1


###############################################
#modify  /etc/security/limits.conf            #
###############################################
cat >> /etc/security/limits.conf << done
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
done
sleep 1


################################################
#modify /etc/profile                           #
################################################
cat >> /etc/profile <<done
if [ \$USER = "oracle" ] || [ \$USER = "grid" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
done
sleep 1






################################################
#modify /etc/pam.d/login                       #
################################################
echo "session    required     pam_limits.so">>/etc/pam.d/login
sleep 1




echo "###oracle  environment variable ###"
################################################
# setting user oracle env                      #
################################################
cat >> /home/oracle/.bash_profile <<done
ORACLE_SID=doudoudb1; export ORACLE_SID
ORACLE_UNQNAME=doudoudb; export ORACLE_UNQNAME
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_PATH=/oracle/app/common/oracle/sql; export ORACLE_PATH
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=american_america.ZHS16GBK ; export NLS_LANG
TNS_ADMIN=\$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=\$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:\${JAVA_HOME}/bin:\${PATH}:\$HOME/bin:\$ORACLE_HOME/bin
PATH=\${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=\${PATH}:/oracle/app/common/oracle/bin
export PATH
LD_LIBRARY_PATH=\$ORACLE_HOME/lib
LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:\$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=\$ORACLE_HOME/JRE
CLASSPATH=\${CLASSPATH}:\$ORACLE_HOME/jlib
CLASSPATH=\${CLASSPATH}:\$ORACLE_HOME/rdbms/jlib
CLASSPATH=\${CLASSPATH}:\$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
umask 022
done
done
sleep 1




echo "###grid  environment variable ###"
###############################################
#setting user grid env                        #
###############################################
cat >> /home/grid/.bash_profile <<done
ORACLE_SID=+ASM1; export ORACLE_SID  
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/oracle/app/grid; export ORACLE_BASE
ORACLE_HOME=/oracle/app/11.2.0/grid; export ORACLE_HOME
ORACLE_PATH=/oracle/app/oracle/common/oracle/sql; export ORACLE_PATH
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=american_america.ZHS16GBK ; export NLS_LANG
TNS_ADMIN=\$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=\$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:\${JAVA_HOME}/bin:\${PATH}:\$HOME/bin:\$ORACLE_HOME/bin
PATH=\${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=\${PATH}:/oracle/app/common/oracle/bin
export PATH
LD_LIBRARY_PATH=\$ORACLE_HOME/lib
LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:\$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=\$ORACLE_HOME/JRE
CLASSPATH=\${CLASSPATH}:\$ORACLE_HOME/jlib
CLASSPATH=\${CLASSPATH}:\$ORACLE_HOME/rdbms/jlib
CLASSPATH=\${CLASSPATH}:\$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
umask 022
done
sleep 1
#####以上為腳本內容########






2.腳本化后需要手工處理的一部分工作


###############################################
#System package collection and installation   #
###############################################
檢查所需系統包
for i in binutils compat-libcap1 compat-libstdc++-33 \
 gcc  gcc-c++ glibc glibc-devel ksh  libgcc libstdc++ \
libstdc++-devel libaio libaio-devel make sysstat unixODBC-devel unixODBC
do
 rpm -q $i &>/dev/null || F="$F $i"
done ;echo $F;unset F


YUM安裝所需包
yum install binutils compat-libcap1 compat-libstdc++-33 gcc  gcc-c++ glibc glibc-devel ksh  libgcc libstdc++ libstdc++-devel libaio libaio-devel make sysstat unixODBC-devel unixODBC


###############################################
#modity oracle and grid password              #
###############################################
passwd oracle
passwd grid


###############################################
#udev綁定LUN                                  #
###############################################
醬油DBA奉獻 Oracle 11gR2 RAC on linux 集成腳本化安裝(三)


作為一個甲方醬油DBA,怎么可能不會搭建RAC?下面講講甲方醬油DBA是怎么腳本化安裝RAC的?(本人已有10+套RAC搭建經驗,AIX,HP-UNIX,LINUX,如有問題歡迎咨詢)
本文用途:Linux平臺下RAC集成腳本化安裝。
     網上也有形形色色的腳本化安裝,有一些是問題的。本文把有問題的部分已經去除,現已安全使用。(僅限我的生產環境,其余朋友的生產環境慎用,如出現問題概不負責任)。
本文精華:“腳本化”三字概括,希望對醬油的DBA們有用


醬油DBA奉獻ORACLE數據庫監控健康腳本(一)
http://www.itpub.net/thread-1841912-1-1.html


醬油DBA奉獻expdp,impdp多用戶遷移數據(二)
http://www.itpub.net/thread-1868059-1-1.html


環境:
 操作系統:redhat 6.2 64bit
 數據庫:rac 11.2.0.4.0
 存儲:EMC VNX5700




11gR2 RAC on linux 集成腳本化安裝




1.基本環境腳本安裝


cat dou.sh  =>為了收集dou.1sh腳本日志
sh dou1.sh >dou.log


cat dou1.sh =>腳本如下:
echo "###Information Collection###"
##############################################
#Information Collection             #
##############################################
echo "###redhat version###"
cat /etc/redhat-release
echo "###os memory###"
cat /proc/meminfo  | grep  MemTotal
echo "###os swap###"
cat /proc/meminfo | grep SwapTotal
echo "###os filesystem###"
df -h
echo "###os cpu numbers###"
cat /proc/cpuinfo |grep "processor"|wc -l 
echo "###os cpu cores###"
cat /proc/cpuinfo |grep "cores"|uniq 


echo "###create group and user###"
##############################################
#create group and user     #
##############################################
/usr/sbin/groupadd -g 1000 oinstall
/usr/sbin/groupadd -g 1020 asmadmin
/usr/sbin/groupadd -g 1021 asmdba
/usr/sbin/groupadd -g 1022 asmoper
/usr/sbin/groupadd -g 1031 dba
/usr/sbin/groupadd -g 1032 oper


useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,dba grid
useradd -u 1101 -g oinstall -G dba,oper,asmdba oracle




echo "###create /etc/oraInst.loc###"
##############################################
#create /etc/oraInst.loc                     #
##############################################
echo "inventory_loc=/oracle/app/oracle/oraInventory" >>/etc/oraInst.loc
echo "inst_group=oinstall" >>/etc/oraInst.loc


echo "###create directory and Privilege###"
##############################################
#create directory and Privilege              #
##############################################
mkdir -p /oracle/app/11.2.0/grid
mkdir -p /oracle/app/grid
mkdir -p /oracle/app/oracle/oraInventory
chown grid:oinstall /oracle/app/11.2.0/grid
chown grid:oinstall /oracle/app/grid
chmod -R 775 /oracle/
chown -R grid:oinstall /oracle
chown oracle:oinstall /oracle/app/oracle


echo "###LINUX optimize parameters####"


##############################################
#modify  sysctl.conf  | memory=64G           #
##############################################
cat >> /etc/sysctl.conf <<done
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6553600
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 = 1048576
fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmmax = 34359738368
kernel.shmall = 16777216
done
sleep 1
sysctl -p
sleep 1


###############################################
#modify  /etc/security/limits.conf            #
###############################################
cat >> /etc/security/limits.conf << done
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
done
sleep 1


################################################
#modify /etc/profile                           #
################################################
cat >> /etc/profile <<done
if [ \$USER = "oracle" ] || [ \$USER = "grid" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
done
sleep 1






################################################
#modify /etc/pam.d/login                       #
################################################
echo "session    required     pam_limits.so">>/etc/pam.d/login
sleep 1




echo "###oracle  environment variable ###"
################################################
# setting user oracle env                      #
################################################
cat >> /home/oracle/.bash_profile <<done
ORACLE_SID=doudoudb1; export ORACLE_SID
ORACLE_UNQNAME=doudoudb; export ORACLE_UNQNAME
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=\$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_PATH=/oracle/app/common/oracle/sql; export ORACLE_PATH
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=american_america.ZHS16GBK ; export NLS_LANG
TNS_ADMIN=\$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=\$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:\${JAVA_HOME}/bin:\${PATH}:\$HOME/bin:\$ORACLE_HOME/bin
PATH=\${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=\${PATH}:/oracle/app/common/oracle/bin
export PATH
LD_LIBRARY_PATH=\$ORACLE_HOME/lib
LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:\$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=\$ORACLE_HOME/JRE
CLASSPATH=\${CLASSPATH}:\$ORACLE_HOME/jlib
CLASSPATH=\${CLASSPATH}:\$ORACLE_HOME/rdbms/jlib
CLASSPATH=\${CLASSPATH}:\$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
umask 022
done
done
sleep 1




echo "###grid  environment variable ###"
###############################################
#setting user grid env                        #
###############################################
cat >> /home/grid/.bash_profile <<done
ORACLE_SID=+ASM1; export ORACLE_SID  
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/oracle/app/grid; export ORACLE_BASE
ORACLE_HOME=/oracle/app/11.2.0/grid; export ORACLE_HOME
ORACLE_PATH=/oracle/app/oracle/common/oracle/sql; export ORACLE_PATH
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=american_america.ZHS16GBK ; export NLS_LANG
TNS_ADMIN=\$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=\$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:\${JAVA_HOME}/bin:\${PATH}:\$HOME/bin:\$ORACLE_HOME/bin
PATH=\${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=\${PATH}:/oracle/app/common/oracle/bin
export PATH
LD_LIBRARY_PATH=\$ORACLE_HOME/lib
LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:\$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=\$ORACLE_HOME/JRE
CLASSPATH=\${CLASSPATH}:\$ORACLE_HOME/jlib
CLASSPATH=\${CLASSPATH}:\$ORACLE_HOME/rdbms/jlib
CLASSPATH=\${CLASSPATH}:\$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
umask 022
done
sleep 1
#####以上為腳本內容########






2.腳本化后需要手工處理的一部分工作


###############################################
#System package collection and installation   #
###############################################
檢查所需系統包
for i in binutils compat-libcap1 compat-libstdc++-33 \
 gcc  gcc-c++ glibc glibc-devel ksh  libgcc libstdc++ \
libstdc++-devel libaio libaio-devel make sysstat unixODBC-devel unixODBC
do
 rpm -q $i &>/dev/null || F="$F $i"
done ;echo $F;unset F


YUM安裝所需包
yum install binutils compat-libcap1 compat-libstdc++-33 gcc  gcc-c++ glibc glibc-devel ksh  libgcc libstdc++ libstdc++-devel libaio libaio-devel make sysstat unixODBC-devel unixODBC


###############################################
#modity oracle and grid password              #
###############################################
passwd oracle
passwd grid


###############################################
#udev綁定LUN                                  #
###############################################
for i in emcpowera emcpowerb emcpowerc emcpowerd emcpowere emcpowerf ;
 do
  echo "KERNEL==\"emcpower*\", SUBSYSTEM==\"block\", PROGRAM==\"/sbin/scsi_id -g -u -d --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id -g -u -d --whitelisted --replace-whitespace --device=/dev/$i`\", NAME=\"asm-$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""      
 done








向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

都匀市| 鹤庆县| 扬州市| 浪卡子县| 木兰县| 大邑县| 县级市| 新宁县| 宁安市| 耿马| 西畴县| 蚌埠市| 新竹市| 沅陵县| 阿拉善盟| 乌鲁木齐市| 兴安盟| 安丘市| 任丘市| 海阳市| 武鸣县| 阳江市| 威信县| 桃园县| 隆林| 霍州市| 五原县| 宿松县| 巴林左旗| 龙井市| 乌兰浩特市| 屏南县| 大同县| 东乡族自治县| 徐水县| 静海县| 类乌齐县| 威海市| 临夏市| 岱山县| 阿图什市|