1 Star 3 Fork 29

indiff/oracle_silent

forked from jack2zhang/oracle_silent 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
install-oracle11g-centos8.sh 4.31 KB
一键复制 编辑 原始数据 按行查看 历史
indiff 提交于 2022-09-27 15:44 . fix centos8
#!/bin/bash
# install preinstall
wget -O /etc/yum.repos.d/oracle-ol7.repo http://public-yum.oracle.com/public-yum-ol7.repo
yum install oracle-rdbms-server-11gR2-preinstall -y
yum -y install xz wget gcc-c++ ncurses ncurses-devel \
cmake make perl openssl openssl-devel gcc* libxml2 \
libxml2-devel curl-devel libjpeg* libpng* freetype* \
make gcc-c++ cmake bison perl perl-devel perl perl-devel \
glibc-devel.i686 glibc-devel libaio readline-devel \
zlib.x86_64 zlib-devel.x86_64 libcurl-* net-tool* \
sysstat lrzsz dos2unix telnet.x86_64 iotop unzip \
ftp.x86_64 xfs* expect vim psmisc openssh-client* \
libaio bzip2 epel-release automake binutils bzip2 \
elfutils expat gawk gcc ksh less make openssh-server \
rpm sysstat unzip unzip cifs-utils libXext.x86_64 \
glibc.i686 binutils compat-libstdc++-33 \
elfutils-libelf elfutils-libelf-devel \
expat gcc gcc-c++ glibc glibc-common \
glibc-devel glibc-headers libaio \
libaio-devel libgcc libstdc++ libstdc++-devel \
make sysstat unixODBC unixODBC-devel libnsl
yum install -y gcc make binutils setarch compat-db compat-gcc-34 compat-gcc-34-c++ compat-libstdc++-33 unixODBC unixODBC-devel libaio-devel sysstat compat-gcc-34 compat-gcc-34-c++ unzip libXext
#set /etc/hosts
#passwd oracle
mkdir -p /u01/oracle
mkdir -p /u01/oraInventory
groupdel oinstall
groupdel dba
groupadd -g 10000 oinstall
groupadd -g 10001 dba
useradd -u 10000 -g oinstall -G dba oracle
chown -R oracle:oinstall /u01/
chmod -R 755 /u01/
mkdir -p /u01/oracle
mkdir -p /u01/oracle/product/11.2.0/dbhome_1
mkdir -p /u01/oraInventory
mkdir -p /home/oracle/oraInventory
chown -R oracle:oinstall /home/oracle/oraInventory
chown -R oracle:oinstall /u01/oraInventory/
chown -R oracle:oinstall /u01/oracle
chown -R oracle:oinstall /tmp
#cat > /home/oracle/.bash_profile << EOF
#export ORACLE_BASE=/u01/oracle
#export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
#export ORACLE_SID=orcl
#export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/bin
#export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
#export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH
#export NLS_LANG=AMERICAN
#export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
#EOF
echo 'export ORACLE_BASE=/u01/oracle' > /home/oracle/.bashrc
echo 'export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1' >> /home/oracle/.bashrc
echo 'export ORACLE_SID=orcl' >> /home/oracle/.bashrc
echo 'export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/bin' >> /home/oracle/.bashrc
echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib' >> /home/oracle/.bashrc
echo 'export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH' >> /home/oracle/.bashrc
#echo 'export NLS_LANG=AMERICAN' >> /home/oracle/.bashrc
echo 'export NLS_LANG="SIMPLIFIED CHINESE_CHINA.UTF8"' >> /home/oracle/.bashrc
echo "export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'" >> /home/oracle/.bashrc
echo "export PATH" >> /home/oracle/.bashrc
source /home/oracle/.bashrc
dd if=/dev/zero of=/home/swapfile bs=1M count=512
/home/swapfile swap swap defaults 0 0
mkswap /home/swapfile
swapon /home/swapfile
echo "/home/swapfile swap swap defaults 0 0" >> /etc/fstab
cat > /etc/security/limits.conf << EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240
EOF
cat > /etc/sysctl.conf << EOF
kernel.shmall = 2097152
#kernel.shmmax最低:536870912,最大值:比物理内存小1个字节的值,建议超过物理内存的一半
kernel.shmmax = 2147483648
fs.file-max = 6815744
fs.aio-max-nr = 1048576
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 = 1048576
EOF
sysctl -p
cat > /etc/oraInst.loc << EOF
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/oraInventory
EOF
#unzip linux.x64_11gR2_database_1of2.zip -d /u01/oracle/
#unzip linux.x64_11gR2_database_2of2.zip -d /u01/oracle/
chown -R oracle:dba /u01/oracle
sed -i '/CV_ASSUME_DISTID/s/4/6/g' /u01/oracle/database/stage/cvu/cv/admin/cvu_config
#su - oracle
#cd /u01/oracle/database
#./runInstaller -silent -force -responseFile /home/oracle/db_install.rsp
#dbca -silent -responseFile /home/oracle/dbca.rsp
#netca -silent -responsefile /u01/oracle/database/response/netca.rsp
#cp oracle.init.d /etc/init.d/oracle
#chkconfig oracle on
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/qwop/oracle_silent.git
git@gitee.com:qwop/oracle_silent.git
qwop
oracle_silent
oracle_silent
oracle/11.2.0.4.0

搜索帮助