无人值守安装Oracle 11GR2单机,只需要10分钟?没错,通过脚本静默安装,真的只需要10分钟,包括安装补丁,建库。
脚本下载链接:SHELL脚本进行oracle数据库一键安装,实现真正的无人值守安装
一、主机准备
主机版本主机内存主机磁盘空间主机网卡主机IP
redhat 7.98G50Geth010.211.55.100
注意:
1.主机内存不得低于2G
2.磁盘空间不得低于50G
二、安装前准备
1.挂载ISO镜像源
##1.通过cdrom挂载mount /dev/cdrom /mnt##2.通过安装镜像源挂载mount -o loop /soft/rhel-server-7.9-x86_64-dvd.iso /mnt
2.创建目录并上传安装介质
##1.创建安装介质上传目录mkdir /soft[root@localhost ~]# cd /soft/##2.上传安装介质[root@localhost soft]# du -sh *##linux7系统缺少补丁包192Kcompat-libstdc++-33-3.2.3-72.el7.x86_64.rpm##无人值守shell脚本140KOracleShellInstall.sh##oracle 11GR2官方安装包1.3Gp13390677_112040_Linux-x86-64_1of7.zip1.1Gp13390677_112040_Linux-x86-64_2of7.zip##oracle 11GR2 PSU 最终版补丁包+6880880 OPatch补丁包374Mp31537677_112040_Linux-x86-64.zip118Mp6880880_112000_Linux-x86-64.zip##上下文切换软件(可选)276Krlwrap-0.42.tar.gz##3.授权脚本执行权限chmod +x OracleShellInstall.sh
三、安装
注意:可通过./OracleShellInstall.sh --help查看命令帮助
安装命令如下:
cd /soft./OracleShellInstall.sh -i 10.211.55.100 `#Public ip`-n s11g `# hostname`-o s11g `# oraclesid`-op oracle `# oracle user password`-b /oracle/app `# install basedir`-s AL32UTF8 `# characterset`-opa 31537677 `# oracle psu number`
敲下回车将开始无人值守安装......
开始时间:22:15
执行过程太多.....略
安装日志记录在/soft目录下:oracleAllSilent_*.log,在文末展示安装日志。
安装结束后,将自动创建好一个上述指定实例名为s11g的数据库实例,并安装上传补丁31537677。
等待安装结束.......
结束时间:22:25
安装结束。
总耗时:10分钟。
安装日志如下:
[root@s11g soft]# cat oracleAllSilent_20210506025105.log ##################################################################################### Installation Logging######################################################################################################################################################################### OS Version####################################################################################OS Version :linux7##################################################################################### DB Version####################################################################################DB Version :11.2.0.4##################################################################################### HOSTNAME####################################################################################HOSTNAME :s11g##################################################################################### RPM Check####################################################################################RPM Check :bc-1.06.95-13.el7.x86_64binutils-2.27-44.base.el7.x86_64compat-libcap1-1.10-7.el7.x86_64compat-libstdc++-33-3.2.3-72.el7.x86_64gcc-4.8.5-44.el7.x86_64gcc-c++-4.8.5-44.el7.x86_64elfutils-libelf-0.176-5.el7.x86_64elfutils-libelf-devel-0.176-5.el7.x86_64glibc-2.17-317.el7.x86_64glibc-devel-2.17-317.el7.x86_64ksh-20120801-142.el7.x86_64libaio-0.3.109-13.el7.x86_64libaio-devel-0.3.109-13.el7.x86_64libgcc-4.8.5-44.el7.x86_64libstdc++-4.8.5-44.el7.x86_64libstdc++-devel-4.8.5-44.el7.x86_64libxcb-1.13-1.el7.x86_64libX11-1.6.7-2.el7.x86_64libXau-1.0.8-2.1.el7.x86_64libXi-1.7.9-1.el7.x86_64libXtst-1.2.3-1.el7.x86_64libXrender-0.9.10-1.el7.x86_64libXrender-devel-0.9.10-1.el7.x86_64make-3.82-24.el7.x86_64net-tools-2.0-0.25.20131004git.el7.x86_64nfs-utils-1.3.0-0.68.el7.x86_64smartmontools-7.0-2.el7.x86_64sysstat-10.1.5-19.el7.x86_64e2fsprogs-1.42.9-19.el7.x86_64e2fsprogs-libs-1.42.9-19.el7.x86_64fontconfig-devel-2.13.0-4.3.el7.x86_64expect-5.45-14.el7_1.x86_64unzip-6.0-21.el7.x86_64openssh-clients-7.4p1-21.el7.x86_64readline-6.2-11.el7.x86_64##################################################################################### /etc/hosts####################################################################################/etc/hosts :127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6#Public IP10.211.55.100s11g##################################################################################### Create user and groups(oracle)####################################################################################Create user and groups(oracle) :uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)##################################################################################### chronyd####################################################################################chronyd :● chronyd.service - NTP client/server Loaded: loaded (/usr/lib/systemd/system/chronyd.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:chronyd(8) man:chrony.conf(5)May 06 14:23:54 localhost.localdomain systemd[1]: Starting NTP client/server...May 06 14:23:54 localhost.localdomain chronyd[731]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG)May 06 14:23:54 localhost.localdomain systemd[1]: Started NTP client/server.May 06 14:51:58 s11g chronyd[731]: chronyd exitingMay 06 14:51:58 s11g systemd[1]: Stopping NTP client/server...May 06 14:51:58 s11g systemd[1]: Stopped NTP client/server.##################################################################################### Time dependent####################################################################################Time dependent :Thu May 6 14:51:58 CST 2021##################################################################################### avahi-daemon####################################################################################avahi-daemon :##################################################################################### Firewalld####################################################################################Firewalld :● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1)May 06 14:23:54 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...May 06 14:23:55 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.May 06 14:23:55 localhost.localdomain firewalld[750]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider disabling it now.May 06 14:51:58 s11g systemd[1]: Stopping firewalld - dynamic firewall daemon...May 06 14:51:59 s11g systemd[1]: Stopped firewalld - dynamic firewall daemon.##################################################################################### SELINUX####################################################################################SELINUX :Permissive##################################################################################### /etc/default/grub####################################################################################/etc/default/grub :GRUB_TIMEOUT=5GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"GRUB_DEFAULT=savedGRUB_DISABLE_SUBMENU=trueGRUB_TERMINAL_OUTPUT="console"GRUB_CMDLINE_LINUX="spectre_v2=retpoline rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet transparent_hugepage=never numa=off"GRUB_DISABLE_RECOVERY="true"##################################################################################### Transparent_hugepages####################################################################################Transparent_hugepages :[always] madvise never##################################################################################### NUMA####################################################################################NUMA :BOOT_IMAGE=/vmlinuz-3.10.0-1160.el7.x86_64 root=/dev/mapper/rhel-root ro spectre_v2=retpoline rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet LANG=en_US.UTF-8##################################################################################### NetworkManager####################################################################################NetworkManager :● NetworkManager.service - Network Manager Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled; vendor preset: enabled) Active: inactive (dead) since Thu 2021-05-06 14:52:01 CST; 149ms ago Docs: man:NetworkManager(8) Main PID: 771 (code=exited, status=0/SUCCESS)May 06 14:43:52 localhost.localdomain NetworkManager[771]: <info> [1620283432.5700] device (eth1): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')May 06 14:43:52 localhost.localdomain NetworkManager[771]: <info> [1620283432.5703] device (eth1): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')May 06 14:43:52 localhost.localdomain NetworkManager[771]: <info> [1620283432.5722] device (eth1): Activation: successful, device activated.May 06 14:51:53 s11g NetworkManager[771]: <info> [1620283913.2720] hostname: hostname changed from "localhost.localdomain" to "s11g"May 06 14:51:53 s11g NetworkManager[771]: <info> [1620283913.2726] policy: set-hostname: set hostname to 's11g' (from system configuration)May 06 14:52:01 s11g NetworkManager[771]: <info> [1620283921.7011] caught SIGTERM, shutting down normally.May 06 14:52:01 s11g systemd[1]: Stopping Network Manager...May 06 14:52:01 s11g NetworkManager[771]: <info> [1620283921.7057] manager: NetworkManager state is now CONNECTED_SITEMay 06 14:52:01 s11g NetworkManager[771]: <info> [1620283921.7080] exiting (success)May 06 14:52:01 s11g systemd[1]: Stopped Network Manager.##################################################################################### rlwrap####################################################################################rlwrap :rlwrap 0.42##################################################################################### /etc/sysctl.conf####################################################################################/etc/sysctl.conf :fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 8365367295kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576##################################################################################### NOZEROCONF####################################################################################NOZEROCONF :# Created by anaconda#OracleBeginNOZEROCONF=yes#OracleEnd##################################################################################### /etc/security/limits.d/20-nproc.conf####################################################################################/etc/security/limits.d/20-nproc.conf :# Default limit for number of user's processes to prevent# accidental fork bombs.# See rhbz #432903 for reasoning.* - nproc 16384root soft nproc unlimited##################################################################################### /etc/security/limits.conf####################################################################################/etc/security/limits.conf :# /etc/security/limits.conf##This file sets the resource limits for the users logged in via PAM.#It does not affect resource limits of the system services.##Also note that configuration files in /etc/security/limits.d directory,#which are read in alphabetical order, override the settings in this#file in case the domain is the same or more specific.#That means for example that setting a limit for wildcard domain here#can be overriden with a wildcard setting in a config file in the#subdirectory, but a user specific setting here can be overriden only#with a user specific setting in the subdirectory.##Each line describes a limit for a user in the form:##<domain> <type> <item> <value>##Where:#<domain> can be:# - a 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##<type> can have the two values:# - "soft" for enforcing the soft limits# - "hard" for enforcing hard limits##<item> can be one of the following:# - 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 file descriptors# - 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##<domain> <type> <item> <value>##* 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# End of file#OracleBeginoracle soft nofile 1024oracle hard nofile 65536oracle soft stack 10240oracle hard stack 32768oracle soft nproc 2047oracle hard nproc 16384oracle hard memlock 134217728oracle soft memlock 134217728#OracleEnd##################################################################################### /etc/pam.d/login####################################################################################/etc/pam.d/login :#%PAM-1.0auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.soauth substack system-authauth include postloginaccount required pam_nologin.soaccount include system-authpassword include system-auth# pam_selinux.so close should be the first session rulesession required pam_selinux.so closesession required pam_loginuid.sosession optional pam_console.so# pam_selinux.so open should only be followed by sessions to be executed in the user contextsession required pam_selinux.so opensession required pam_namespace.sosession optional pam_keyinit.so force revokesession include system-authsession include postlogin-session optional pam_ck_connector.so#OracleBeginsession required pam_limits.so session required /lib64/security/pam_limits.so#OracleEnd##################################################################################### /dev/shm####################################################################################/dev/shm :## /etc/fstab# Created by anaconda on Thu May 6 02:11:47 2021## Accessible filesystems, by reference, are maintained under '/dev/disk'# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info#/dev/mapper/rhel-root / xfs defaults 0 0UUID=32cd2453-e3e4-4e58-a3c5-d7eb092d7469 /boot xfs defaults 0 0/dev/mapper/rhel-home /home xfs defaults 0 0/dev/mapper/rhel-swap swap swap defaults 0 0/swapfile swap swap defaults 0 0tmpfs /dev/shm tmpfs size=8169304k 0 0##################################################################################### df -hP####################################################################################df -hP :Filesystem Size Used Avail Use% Mounted ondevtmpfs 3.9G 0 3.9G 0% /devtmpfs 7.8G 0 7.8G 0% /dev/shmtmpfs 3.9G 9.1M 3.9G 1% /runtmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup/dev/mapper/rhel-root 39G 6.5G 32G 17% //dev/sda1 1014M 137M 878M 14% /boot/dev/mapper/rhel-home 19G 33M 19G 1% /hometmpfs 798M 0 798M 0% /run/user/0/dev/sr0 4.3G 4.3G 0 100% /mnt##################################################################################### Oracle Profile####################################################################################Oracle Profile :# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then. ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/.local/bin:$HOME/binexport PATH################OracleBegin#########################umask 022export TMP=/tmpexport TMPDIR=$TMPexport NLS_LANG=AMERICAN_AMERICA.AL32UTF8 #AL32UTF8,ZHS16GBKexport ORACLE_BASE=/oracle/app/oracleexport ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbexport ORACLE_HOSTNAME=s11gexport ORACLE_TERM=xtermexport TNS_ADMIN=$ORACLE_HOME/network/adminexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/libexport ORACLE_SID=s11gexport PATH=/usr/sbin:$PATHexport PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATHalias sas='sqlplus / as sysdba'alias alert='tail -500f $ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace/alert_$ORACLE_SID.log|more'export PS1="[`whoami`@`hostname`:"'$PWD]$ 'alias sqlplus='rlwrap sqlplus'alias rman='rlwrap rman'alias lsnrctl='rlwrap lsnrctl'alias asmcmd='rlwrap asmcmd'alias adrci='rlwrap adrci'alias ggsci='rlwrap ggsci'alias dgmgrl='rlwrap dgmgrl'################OracleEnd################################################################################################################ /soft/db.rsp####################################################################################/soft/db.rsp :oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0oracle.install.option=INSTALL_DB_SWONLYORACLE_HOSTNAME=s11gUNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/oracle/app/oraInventorySELECTED_LANGUAGES=en,zh_CNORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbORACLE_BASE=/oracle/app/oracleoracle.install.db.InstallEdition=EEoracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=operDECLINE_SECURITY_UPDATES=trueoracle.installer.autoupdates.option=SKIP_UPDATES##################################################################################### /soft/netca.rsp####################################################################################/soft/netca.rsp :[GENERAL]RESPONSEFILE_VERSION="11.2"CREATE_TYPE="CUSTOM"[oracle.net.ca]INSTALLED_COMPONENTS={"server","net8","javavm"}INSTALL_TYPE=""typical""LISTENER_NUMBER=1LISTENER_NAMES={"LISTENER"}LISTENER_PROTOCOLS={"TCP;1521"}LISTENER_START=""LISTENER""NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}NSN_NUMBER=1NSN_NAMES={"EXTPROC_CONNECTION_DATA"}NSN_SERVICE={"PLSExtProc"}NSN_PROTOCOLS={"TCP;HOSTNAME;1521"}##################################################################################### Oracle RDBMS####################################################################################Oracle RDBMS :SQL*Plus: Release 11.2.0.4.0 Production##################################################################################### Oracle OPatch Version####################################################################################Oracle OPatch Version :OPatch Version: 11.2.0.3.28OPatch succeeded.##################################################################################### OPatch lspatches####################################################################################OPatch lspatches :31537677;Database Patch Set Update : 11.2.0.4.201020 (31537677)OPatch succeeded.##################################################################################### ORACLE Instance####################################################################################ORACLE Instance :LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 06-MAY-2021 15:00:40Copyright (c) 1991, 2013, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 11.2.0.4.0 - ProductionStart Date 06-MAY-2021 14:55:04Uptime 0 days 0 hr. 5 min. 36 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /oracle/app/oracle/product/11.2.0/db/network/admin/listener.oraListener Log File /oracle/app/oracle/diag/tnslsnr/s11g/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=s11g)(PORT=1521)))Services Summary...Service "s11g" has 1 instance(s). Instance "s11g", status READY, has 1 handler(s) for this service...The command completed successfully##################################################################################### Oracle Implied parameters####################################################################################Oracle Implied parameters :SQL*Plus: Release 11.2.0.4.0 Production on Thu May 6 15:00:41 2021Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsNAME TYPE VALUE------------------------------------ ----------- ------------------------------audit_trail string DBNAME TYPE VALUE------------------------------------ ----------- ------------------------------deferred_segment_creation boolean FALSENAME TYPE VALUE------------------------------------ ----------- ------------------------------result_cache_max_size big integer 0NAME VALUE DESCRIB---------------------------------------- ---------- ------------------------------------------------------------_use_adaptive_log_file_sync TRUE Adaptively switch between post/wait and polling_optimizer_cartesian_enabled FALSE optimizer cartesian join enabledDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。