#!/bin/bash #安装oracle pageDir="/opt/tools/oracle" bdFile="/tmp/bdFile.txt" opassword="oracle" check_ok(){ if [ $? != 0 ] then echo "Error, Check the error log." exit 1 fi } myum(){ if ! rpm -qa|grep -q "^$1" then yum install -y $1 check_ok else echo $1 already installed. fi } check_server(){ if ! grep -q "$1" "$bdFile" then "$1" fi } install_oracleinit(){ for i in binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make sysstat unixODBC unixODBC-devel #centos7
#for i in binutils compat-libstdc++-33* elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++* make sysstat unixODBC unixODBC-devel
do myum $i done if ! grep -q oinstall /etc/group then /usr/sbin/groupadd oinstall check_ok fi if ! grep -q dba /etc/group then /usr/sbin/groupadd dba check_ok fi if ! grep -q oracle /etc/passwd then /usr/sbin/useradd -g oinstall -G dba oracle check_ok fi if ! grep -q oracle /etc/sudoers then echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers fi echo $opassword | passwd --stdin oracle cat << EOF > /etc/sysctl.conf kernel.sem = 250 32000 100 128 fs.file-max = net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = net.core.rmem_max = net.core.wmem_default = net.core.wmem_max = fs.aio-max-nr = EOF /sbin/sysctl -p check_ok #su oracle #check_ok if ! grep -q oracle /etc/security/limits.conf then echo "oracle soft nofile 1024" >> /etc/security/limits.conf echo "oracle hard nofile 65536" >> /etc/security/limits.conf echo "oracle soft nproc 2047" >> /etc/security/limits.conf echo "oracle hard nproc 16384" >> /etc/security/limits.conf fi if ! grep -q "pam_limits.so" /etc/pam.d/login then echo "session required /lib64/security/pam_limits.so" >> /etc/pam.d/login echo "session required pam_limits.so" >> /etc/pam.d/login fi if ! grep -q "oracle" /etc/profile/env.sh then echo "if [ $USER == "oracle" ]; then" >> /etc/profile/env.sh echo " if [ $SHELL == "/bin/ksh" ]; then" >> /etc/profile/env.sh echo " ulimit -p 16384" >> /etc/profile/env.sh echo " ulimit -n 65536" >> /etc/profile/env.sh echo " else" >> /etc/profile/env.sh echo " ulimit -u 16384 -n 65536" >> /etc/profile/env.sh echo " fi" >> /etc/profile/env.sh echo "fi" >> /etc/profile/env.sh fi #close selinux #sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config #selinux_s=`getenforce` #if [ $selinux_s == "Enforcing" -o $selinux_s == "enforcing" ] #then # setenforce 0 #fi # [ -f /etc/oraInst.loc ] || touch /etc/oraInst.loc cat << EOF > /etc/oraInst.loc inventory_loc=/opt/oracle/oraInventory inst_group=oinstall EOF chown oracle:oinstall /etc/oraInst.loc chmod 664 /etc/oraInst.loc echo "install_oracleinit ok" echo "install_oracleinit" >> $bdFile } install_oracle11g(){ #u=`whoami` #[ "$u" == "root" ] || su root #check_ok [ -d /opt/oracle ] || mkdir -p /opt/oracle chown -R oracle:oinstall /opt/oracle/ chmod -R 775 /opt/oracle/ #u=`whoami` #[ "$u" == "oracle" ] || su oracle if ! grep -q "ORACLE_BASE" /home/oracle/.bash_profile then echo "umask 022" >> /home/oracle/.bash_profile echo "export ORACLE_BASE=/opt/oracle" >> /home/oracle/.bash_profile echo "export ORACLE_SID=orcl" >> /home/oracle/.bash_profile echo "export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1" >> /home/oracle/.bash_profile echo "export TNS_ADMIN=$ORACLE_HOME/network/admin" >> /home/oracle/.bash_profile echo "export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin" >> /home/oracle/.bash_profile echo "export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin" >> /home/oracle/.bash_profile echo "export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/lib" >> /home/oracle/.bash_profile echo "export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib" >> /home/oracle/.bash_profile echo "export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib" >> /home/oracle/.bash_profile echo "export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/JRE" >> /home/oracle/.bash_profile echo "export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/JRE/lib" >> /home/oracle/.bash_profile echo "export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib" >> /home/oracle/.bash_profile echo "export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib" >> /home/oracle/.bash_profile echo "export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib" >> /home/oracle/.bash_profile echo "export LIBPATH=${CLASSPATH}:$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib" >> /home/oracle/.bash_profile echo "export ORACLE_OWNER=oracle" >> /home/oracle/.bash_profile echo "export SPFILE_PATH=$ORACLE_HOME/dbs" >> /home/oracle/.bash_profile echo "export ORA_NLS10=$ORACLE_HOME/nls/data" >> /home/oracle/.bash_profile fi source /home/oracle/.bash_profile check_ok [ -d /home/oracle/etc ] || mkdir -p /home/oracle/etc [ -f /home/oracle/etc/db_install.rsp ] || touch /home/oracle/etc/db_install.rsp cat << EOF > /home/oracle/etc/db_install.rsp oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0 oracle.install.option=INSTALL_DB_SWONLY ORACLE_HOSTNAME=`hostname` UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/opt/oracle/oraInventory SELECTED_LANGUAGES=en,zh_CN,zh_TW ORACLE_HOME=/opt/oracle/product/11.2.0/db_1 ORACLE_BASE=/opt/oracle oracle.install.db.InstallEdition=EE oracle.install.db.EEOptionsSelection=false oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.3.0,oracle.oraolap:11.2.0.3.0,oracle.rdbms.dm:11.2.0.3.0,oracle.rdbms.dv:11.2.0.3.0,oracle.rdbms.lbac:11.2.0.3.0,oracle.rdbms.rat:11.2.0.3.0 oracle.install.db.DBA_GROUP=dba oracle.install.db.OPER_GROUP=oinstall oracle.install.db.CLUSTER_NODES= oracle.install.db.isRACOneInstall= oracle.install.db.racOneServiceName= oracle.install.db.config.starterdb.type=GENERAL_PURPOSE oracle.install.db.config.starterdb.globalDBName=orcl oracle.install.db.config.starterdb.SID=orcl oracle.install.db.config.starterdb.characterSet=AL32UTF8 oracle.install.db.config.starterdb.memoryOption=true oracle.install.db.config.starterdb.memoryLimit=512 oracle.install.db.config.starterdb.installExampleSchemas=false oracle.install.db.config.starterdb.enableSecuritySettings=true oracle.install.db.config.starterdb.password.ALL=oracle oracle.install.db.config.starterdb.password.SYS=oracle oracle.install.db.config.starterdb.password.SYSTEM=oracle oracle.install.db.config.starterdb.password.SYSMAN= oracle.install.db.config.starterdb.password.DBSNMP= oracle.install.db.config.starterdb.control=DB_CONTROL oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL= oracle.install.db.config.starterdb.automatedBackup.enable=false oracle.install.db.config.starterdb.automatedBackup.osuid= oracle.install.db.config.starterdb.automatedBackup.ospwd= oracle.install.db.config.starterdb.storageType= oracle.install.db.config.starterdb.fileSystemStorage.dataLocation= oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation= oracle.install.db.config.asm.diskGroup= oracle.install.db.config.asm.ASMSNMPPassword= MYORACLESUPPORT_USERNAME= MYORACLESUPPORT_PASSWORD= SECURITY_UPDATES_VIA_MYORACLESUPPORT=false DECLINE_SECURITY_UPDATES=true PROXY_HOST= PROXY_PORT= PROXY_USER= PROXY_PWD= PROXY_REALM= COLLECTOR_SUPPORTHUB_URL= oracle.installer.autoupdates.option= oracle.installer.autoupdates.downloadUpdatesLoc= AUTOUPDATES_MYORACLESUPPORT_USERNAME= AUTOUPDATES_MYORACLESUPPORT_PASSWORD= EOF chown -R oracle:oinstall /home/oracle chmod 700 /home/oracle/etc/*.rsp cd $pageDir #[ -f linux.x64_11gR2_database_1of2.zip ] || (echo "not linux.x64_11gR2_database_1of2.zip file..";exit 1) #[ -f linux.x64_11gR2_database_2of2.zip ] || (echo "not linux.x64_11gR2_database_2of2.zip file..";exit 1) [ -f p__Linux-x86-64_1of7.zip ] || (echo "not p__Linux-x86-64_1of7.zip file..";exit 1) [ -f p__Linux-x86-64_2of7.zip ] || (echo "not p__Linux-x86-64_2of7.zip file..";exit 1) if [ ! -d database ] then unzip p__Linux-x86-64_1of7.zip check_ok unzip p__Linux-x86-64_2of7.zip check_ok fi cd database su -l -c "$pageDir/database/runInstaller -silent -force -responseFile /home/oracle/etc/db_install.rsp" oracle
#忽悠检查
#su -l -c “$pageDir/database/runInstaller -ignoreSysPrereqs -ignorePrereq -silent -force -responseFile /home/oracle/etc/db_install.rsp” oracle
sleep 600 check_ok /opt/oracle/product/11.2.0/db_1/root.sh check_ok echo "install_oracle11g" >> "$bdFile" echo "install_oracle11g install ok" } install_oracle11g_db(){ [ -f /home/oracle/etc/dbca.rsp ] || touch /home/oracle/etc/dbca.rsp cat << EOF > /home/oracle/etc/dbca.rsp [GENERAL] RESPONSEFILE_VERSION = "11.2.0" OPERATION_TYPE = "createDatabase" [CREATEDATABASE] GDBNAME = "orcl" SID = "orcl" TEMPLATENAME = "General_Purpose.dbc" SYSPASSWORD = "oracle" SYSTEMPASSWORD = "oracle" DATAFILEDESTINATION = "/opt/oracle/oradata" RECOVERYAREADESTINATION = "/opt/oracle/flash_recovery_area" CHARACTERSET = "AL32UTF8" NATIONALCHARACTERSET= "UTF8" EOF chown -R oracle:oinstall /home/oracle chmod 700 /home/oracle/etc/*.rsp su -l -c " /opt/oracle/product/11.2.0/db_1/bin/dbca -silent -responseFile /home/oracle/etc/dbca.rsp" oracle check_ok echo "install_oracle11g_db" >> "$bdFile" echo "install_oracle11g_db install ok" } check_server install_oracleinit check_server install_oracleNavicat Premium 11.2.17激活11g check_server install_oracle11g_db
今天的文章
Navicat Premium 11.2.17激活(oracle11g笔记)分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/109646.html