oracle11G静默安装
CentOS下安装Oracle11.2.0静默模式
CentOS1.操作系统及Oracle版本Linux版本:CentOS release 6.7 (Final)Oracle版本:Oracle Database 11g Release 2 (11.2.0.4.0) for Linux x86-64 (linux.p1*******_112040_Linux-x86-64_1of7.zip、linux.p1*******_112040_Linux-x86-64_of7.zip)2.硬件检测:物理内存不少于1G硬盘可以空间不少于5Gswap分区空间不少于2G支持256色以上显卡cpu主频不小于550mHZcat /etc/issueuname -r (版本)grep MemTotal /proc/meminfo (内存大小)grep SwapTotal /proc/meminfo (交换区大小)grep "model name" /proc/cpuinfo (CPU信息)free (可用内存)3.检查安装依赖系统包操作系统依赖的具体包,请参考官方安装文档。
检查依赖包rpm -q binutils compat-libstdc++-33 elfutils-libelfelfutils-libelf-devel gcc gcc-c++ glibc-2.5 glibc-common glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel如果包有显示is not installed(没安装),就用yum install 命令安装,如:yum install compat-libstdc++-334.创建所需的操作系统组和用户groupadd oinstalluseradd –m -g oinstall oracle设置oracle用户密码passwd oracle5.修改内核参数在/etc/sysctl.conf 文件中,使用文本编辑器或vi命令增加或修改以下参数kernel.shmmax = 4096000000kernel.shmall = 2097152kernel.shmmni = 4096kernel.sem = 250 32000 100 128fs.file-max = 6815744fs.aio-max-nr = 1048576net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 4194304net.ipv4.tcp_wmem = 262144 262144 262144net.ipv4.tcp_rmem = 4194304 4194304 4194304修改后,使设置生效sysctl -p6.创建安装目录(可根据情况,选择比较多空间的目录创建)mkdir -p /usr/oraclechown -R oracle:oinstall /usr/oraclechmod -R 775 /usr/oracle7.创建/etc/oraInst.loc文件,内容如下nventory_loc=/usr/oracle/oraInventoryinst_group=oinstall更改文件的权限chown oracle:oinstall /etc/oraInst.locchmod 664 /etc/oraInst.loc8.设置oracle环境变量su - oraclevi ~/.bash_profile在最后加上以下内容export ORACLE_BASE=/usr/oracleexport ORACLE_SID=orcl注意,除了ORACLE_BASE和ORACLE_SID,( /etc/profile和.bash_profile中)不设置任何oracle相关环境变量(ORACLE_HOME, PATH, LD_LIBRARY_PATH等)。
SUSE Linux Enterprise 11SP1静默安装Oracle 11gR2说明文档
SUSE Linux Enterprise 11SP1静默安装Oracle 11gR2说明文档1准备oracle安装文件Oracle11gR2包含两个文件linux_11gR2_database_1of2.zip和linux_11gR2_database_2of2.zip,下载地址分别是:/otn/linux/oracle11g/R2/linux_11gR2_database_1of2.zip/otn/linux/oracle11g/R2/linux_11gR2_database_2of2.zip下载完成后将这两个文件通过SSH上传到/usr/local/oracle中。
装程序的目录。
2准备oracle的安装目标目录安装目标目录是用户想将oracle安装到哪个位置的目录,本次我们将oracle安装到/opt/ora cle目录中,以下为目录创建命令。
3创建oracle相关用户和用户组oracle不能在root帐户下进行安装,所以需要为oracle的安装专门创建一个用户,同时需要创建dba和oinstall的用户组。
以下命令将创建dba和oinstall用户组:以下命令将创建oracle用户,并设置密码以下命令将oracle安装目录(/opt/oracle)赋予oracle用户oinstall用户组4检查安装ORACLE依赖的RPM软件包oracle的安装所依赖的软件包,有一部分linux是没有安装的。
这需要将这些尚未安装的软件包先安装后才能正常安装oracle。
这些未安装的软件包在linux安装光盘上可以取到,我们直接在linux的光盘上对这些软件包进行安装(也可将所需的软件包直接复制到linux本地磁盘中),首先我们需要挂载linux光盘,使用以下命令:安装所缺少的软件包,此处只安装本linux系统所缺少的软件包。
如oracle安装过程中,对软件包进行检查时,发现仍有所需软件包未安装时,可根据显示未安装软件包的名字,再次对所缺少的软件包进行安装。
Oracle 11.2.0.1 for RHEL5-6 x86和x64静默安装详解
过程中的所有操作无需使用图形界面,静默安装能减少安装出错的可能性,也能大大加快安装速度。
# 后跟命令表示以操作系统下root用户操作;$ 后跟命令表示以操作系统下Oracle用户操作;禁用selinux:1.setenforce 02.vi /etc/sysconfig/seliunx3.SELINUX=disabled关闭防火墙:service iptables stop禁用以下非必要的系统服务:1.chkconfig --level 2345 iptables off2.chkconfig --level 2345 rhnsd off3.chkconfig --level 2345 isdn off4.chkconfig --level 2345 avahi-daemon off5.chkconfig --level 2345 avahi-dnsconfd off6.chkconfig --level 2345 bluetooth off7.chkconfig --level 2345 cpuspeed off8.chkconfig --level 2345 hidd off9.chkconfig --level 2345 ip6tables off10.chkconfig --level 2345 mcstrans off11.chkconfig --level 2345 pcscd off12.chkconfig --level 2345 gpm off13.chkconfig --level 2345 xinetd off14.chkconfig --level 2345 portmap off15.chkconfig --level 2345 yum-updatesd off16.chkconfig --level 2345 restorecond off17.chkconfig --level 2345 setroubleshoot off18.chkconfig --level 2345 yum-updatesd off19.chkconfig --level 2345 libvirtd off20.chkconfig --level 2345 xendomains off21.chkconfig --level 2345 xend off22.chkconfig --level 2345 iptables off23.chkconfig --level 2345 sendmail off24.chkconfig --level 2345 cups off将/dev/shm的大小增加到总内存的100%(要大于给oracle分配的total mem:缺省值:40%),修改/etc/fstab的这行:默认的: none /dev/shm tmpfs defaults 0 0改成: none /dev/shm tmpfs defaults,size=16G 0 0,重新mount /dev/shm使之生效:# mount -o remount /dev/shm,马上可以用"df -h"命令检查变化。
oracle静默安装
安装相关的开发工具包yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++yum -y install libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel在linux下创建oracle用户,以及管理组以root用户登录linux,执行以下命令/usr/sbin/groupadd dba;/usr/sbin/groupadd oinstalluseradd oracle;/usr/sbin/usermod -g oinstall -G dba oracle;(dba为管理组)passwd oracle在/etc/sysctl.conf 中添加下列行fs.aio-max-nr = 1048576fs.file-max = 65536#kernel.shmall = 2097152#kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65000net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586(以上参数的值都是推荐值,如果你本机的值更大的话,就无需更改;其中 fs.filemax 取值为 512*PROCESSES)运行: sysctl -p (使以上定义的值生效)注意,此处可以不用修改,因为在oracle安装的时候它会自动检测系统环境,如果步否和要求的话它会生成一个脚本,你只需要执行那个脚本就可以修改为oracle 用户设定shell 限制:a. 在/etc/security/limits.conf 中添加下列行* soft noproc 65535* hard noproc 65535* soft nofile 65535* hard nofile 65535b. 在/etc/pam.d/systemauth 中确保有下列行(此处不用修改,默认即可)session required pam_limits.sosession required pam_unix.soc. 在/home/oralce/.bash_profile中添加如下,然后source使之生效ulimit -u 16384 -n 65536source /home/oracle/.bash_profile预先创建安装目录mkdir -p /app/oracle/product;mkdir -p /app/oracle/product/db0;mkdir -p /app/oracle/oraInventory;mkdir -p /app/oracle/oradata;设置目录的所有者所属组和权限chown -R oracle.dba /app/oracle;chmod -R 775 /app/oracle;设置用户oracle的环境变量#su – oracle$vim ~/.bash_profile在文件中添加如下:export PATH=$PATH:$HOME/bin;export ORACLE_BASE=/app/oracle;export ORACLE_SID=oracle11gDB0;export ORACLE_HOME=$ORACLE_BASE/product/11g/db0;export PATH=$PATH:$ORACLE_HOME/bin;export TMP=/tmp;export TMPDIR=$TMP;export ORACLE_TERM=xterm;exportLD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib; exportCLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORAC LE_HOME/rdbms/jlib;export PATH=/usr/sbin:$PATH;export PATH=$ORACLE_HOME/bin:$PATH;export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export PATH;注意:11g:ORA_NLS33=$ORACLE_HOME/nls/admin/data10g:ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data9i: ORA_NLS33=/oracle/app/ora92/ocommon/nls/admin/data保存退出执行以下命令让配置马上生效或以oracle用户登录使设置生效source $HOME/.bash_profile三.解压oracle包我下载的是.zip的包,执行以下命令unzip linux_11gR2_database_1of2.zipunzip linux_11gR2_database_2of2.zip注意解压好的目录用户oracle必须具有读写和执行的权限,可以将目录的用户和组改为oracle:chown -R oracle databasechgrp -R oinstall database四.安装oracle文本安装以oracle身份运行su - oracle./runInstaller -silent -responseFile /home/oracle/database/response/instll.rsp静默安装应答文件:oracle11g32.rsp oracle11g64.rsp/app/oracle/inventory/orainstRoot.sh/app/oracle/product/11g/db0/root.sh要执行配置脚本, 请执行以下操作:1. 打开一个终端窗口2. 以 "root" 身份登录3. 运行脚本修改密码:sqlplus /nolog查看用户SQL> select username,password from dba_users;USERNAME PASSWORD------------------------------------------------------------USER1 BBE7786A584F9103MGMT_VIEW 4F538DF5F344F348SYS 8A8F025737A9097ASYSTEM 970BAA5B81930A40DBSNMP FFF45BB2C0C327ECSYSMAN 2CA614501F09FCCCOUTLN 4A3BA55E08595C81MDSYS 72979A94BAD2AF80ORDSYS 7EFA02EC7EA6B86FEXFSYS 66F4EF5650C20355DMSYS BFBA5A553FD9E28A修改用户口令格式alter user 用户名identified by 新密码; SQL> alter user system identified by manager;图形安装b.弹出图形化安装界面,安装开始b1.去掉i wish to recive..前的对号,点nextb2.因为使安装单机版,选择install database software only,next b3.保持默认的安装单机版的软件,nextb4.选择语言,有简体中文,此处选择英文b5.选择安装方式,保持选择第一个,安装企业版的,Enterprise Editon b6.选择安装目录,上面设定过变量,所以此处直接显示/opt/oracle,如果不是的话,手动进行修改b7.确认目录为/opt/oraInventoryb8.保持默认b9.安装检测到内核信息和一些软件包的版本不符合安装要求,点击Fix & check again,运行弹出窗口中提示的脚本使用Oracle Universal Installer.(注意:执行“xhost +”命令,否则oracle 用户不能使用当前图形接口;或者注销后使用oracle 帐户登录)# xhost +access control disabled, clients can connect from any host# su - oracle$ cd /mnt/database/$ ./runInstalleren otOS6中文环境下安装Oracle 11g 运行./runInstaller,进入图形化界面后,出现中文乱码。
RHEL5下静默安装oracle 11G R2+weblogic(已验证)
RHEL5下静默安装oracl e 11G R2+webl ogic(已验证)准备工作:Rhel5安装介质oracle11GR2安装介质weblogic10.3安装介质jdk1.6.0_13安装介质静默安装oracle 11G R2Oracle:Ip:10.31.120.67Hostname:cnsh41278开放端口:1521、1158修改/etc/hosts文件(根据实际环境添加相应主机、IP的映射)[root@oracle ~]#vi /etc/hosts10.31.120.67 cnsh41278关闭防火墙[root@RHEL5 /]#chkconfig iptables off (重启后永久性生效)service iptables stop (即时生效,重启后失效)关闭selinuxvi /etc/selinux/configSELINUX =disabled【设置ipvi /etc/sysconfig/network-scripts/ifcfg-eth0】检查系统软件[root@RHCE~]# uname –a.[root@RHCE~]# cat /etc/redhat-release软件包检查(x86_64)(--ok)binutils-2.17.50.0.6compat-libstdc++-33-3.2.3elfutils-libelf-0.125elfutils-libelf-devel-0.125elfutils-libelf-devel-static-0.125gcc-4.1.2gcc-c++-4.1.2glibc-2.5-24glibc-common-2.5glibc-devel-2.5glibc-headers-2.5kernel-headers-2.6.18ksh-20060214libaio-0.3.106libaio-devel-0.3.106libgcc-4.1.2libgomp-4.1.2libstdc++-4.1.2libstdc++-devel-4.1.2make-3.81sysstat-7.0.2unixODBC-2.2.11unixODBC-devel-2.2.11查看软件包是否存在:[root@RHCE ~]# rpm –aq | grep使用rpm –q命令检查下系统是否已经安装了以上软件包rpm -q binutils okrpm -q compat-libstdc++ okrpm -q elfutils-libelf okrpm -q elfutils-libelf-devel okrpm -q elfutils-libelf-devel-static okrpm -q gcc okrpm -q gcc-c++ okrpm -q glibc okrpm -q glibc-common okrpm -q glibc-devel okrpm -q glibc-headers okrpm -q kernel-headers okrpm -q ksh okrpm -q libaio okrpm -q libaio-devel okrpm -q libgcc okrpm -q libgomp okrpm -q libstdc++ okrpm -q libstdc++-devel okrpm -q make okrpm -q sysstat okrpm -q unixODBC okrpm -q unixODBC-devel ok拷贝文件到linux安装包到/tmp目录安装依赖软件包[root@oracle ~]# rpm –vih修改Linux 内核参数检查参数是否满足要求:[root@RHCE ~]# sysctl -a | grep其值大于要求的值可以不做修改,修改需要修改的参数。
oracle11g 静默安装
Redhat6.5静默安装oracle数据库一、环境配置root用户操作1、关闭防火墙、修改selinux[root@db ~]#service iptables stop2、修改主机host,并添加ip3、修改用户的shell限制,在文件最后增加下面参数[root@db ~]# vim /etc/security/limits.conforacle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 655364、修改/etc/pam.d/login文件,增加下面内容[root@db ~]# vim /etc/pam.d/loginsession required /lib/security/pam_limits.sosession required pam_limits.so5、修改linux内核,增加下面内容[root@db ~]# vim /etc/sysctl.conffs.file-max = 6815744fs.aio-max-nr = 1048576kernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 4194304net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576立即生效该配置文件[root@db ~]# sysctl -p6、编辑系统环境变量文件,加入下面环境变量[root@db ~]# vim /etc/profileif [ $USER = "oracle" ]; thenif [ $SHELL = "/bin/ksh" ]; thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fifi使环境变量生效[root@db ~]# source /etc/profile7、创建相关用户和组[root@db ~]# groupadd oinstall[root@db ~]# groupadd dba[root@db ~]# useradd -g oinstall -G dba -m oracle[root@db ~]# passwd oracle然后会让你输入密码,密码任意输入2次,但必须保持一致,回车确认8、创建数据库软件目录和数据文件存放目录,目录的位置,根据自己的情况来[root@db ~]# mkdir -p /data/u01/app[root@db ~]# mkdir /data/u01/app/oracle[root@db ~]# mkdir /data/u01/app/oradata[root@db ~]# mkdir /data/u01/app/oracle/product更改目录属主为Oracle用户所有[root@db ~]# chown -R oracle:oinstall /data/u019、配置oracle环境变量,切换用户,增加下面内容oracle用户操作[root@db oradata]# su - oracle[oracle@db ~]$ vim .bash_profileumask 022export ORACLE_BASE=/data/u01/appexportORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1 export ORACLE_SID=orclexport PATH=$PATH:$HOME/bin:$ORACLE_HOME/binexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib10、切换为root用户,使用yum源安装下面依赖包yum install -y compat-libstdc++* elfutils-libelf-* glibc-* gcc-* kernel-headers-* libgcc-* libaio-* libstdc++-* unixODBC-* sysstat-* binutils-* make-* libXp-devel readline*11、上传oracle软件安装包并解压unzip p1*******_112040_Linux-x86-64_1of7.zipunzip p1*******_112040_Linux-x86-64_2of7.zip二、静默安装软件1、编辑解压之后里面的响应文件db_install.rsp[root@db software]# vim /home/database/response/db_install.rsp 修改下面内容:oracle.install.option=INSTALL_DB_SWONLY #选择安装类型:1.只装数据库软件 2.安装数据库软件并建库 3.升级数据库ORACLE_HOSTNAME=db #指定操作系统主机名,通过hostname命令获得UNIX_GROUP_NAME=oinstall #指定oracle inventory目录的所有者,通常会是oinstall或者dbaINVENTORY_LOCATION=/u01/oraInventory #指定产品清单oracle inventory目录的路径SELECTED_LANGUAGES=en,zh_CN #指定数据库语言,可以选择多个,用逗号隔开ORACLE_HOME=/data/u01/app/oracle/product/11.2.0/dbhome_1 #设置ORALCE_HOME的路径ORACLE_BASE=/data/u01/app # 设置ORALCE_BASE的路径oracle.install.db.InstallEdition=EE #选择Oracle安装数据库软件的版本oracle.install.db.isCustomInstall=falseoracle.install.db.DBA_GROUP=dba #指定拥有OSDBA、OSOPER权限的用户组,通常会是dba组oracle.install.db.OPER_GROUP=oinstalloracle.install.db.config.starterdb.type=GENERAL_PURPOSE #选择数据库的用途,一般用途/事物处理,数据仓库oracle.install.db.config.starterdb.globalDBName=orcl #指定GlobalName oracle.install.db.config.starterdb.SID=orcl #指定SIDoracle.install.db.config.starterdb.characterSet=ZHS16GBK #选择字符集。
ORACLE_11G静默安装
1) 检查系统软件包(check software package)binutils-2.15.92.0.2-13.EL4compat-db-4.1.25-9compat-libstdc++-296-2.96-132.7.2control-center-2.8.0-12gcc-3.4.3-22.1.EL4gcc-c++-3.4.3-22.1.EL44glibc-2.3.4-2.9glibc-common-2.3.4-2.9gnome-libs-1.4.1.2.90-44.1libstdc++-3.4.3-22.1libstdc++-devel-3.4.3-22.1make-3.80-5pdksh-5.2.14-30sysstat-5.0.5-1xscreensaver-4.18-5.rhel4.2libaio-0.3.103-3yum install compat-db compat-libstdc++ control-center gcc gcc-c++ glibc glibc-common gonme-libs libstdc++ libstdc++-devel make pdksh sysstat libai#rpm -qa gcc*#rpm -Uvh --force binutils-2.15.92.0.2-13.0.0.0.2.x86_64.rpm2) 配置核心参数(configure kernel parameter)edit /etc/sysctl.confkernel.shmall = 2097152kernel.shmmax = 268435456kernel.shmmni = 4096# semaphores: semmsl, semmns, semopm, semmnikernel.sem = 250 32000 100 128fs.file-max = 65536net.ipv4.ip_local_port_range = 1024 65000net.core.rmem_default=262144net.core.rmem_max=262144net.core.wmem_default=262144net.core.wmem_max=262144/sbin/sysctl -p3)vi /etc/security/limits.conforacle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536vi /etc/pam.d/loginsession required /lib/security/pam_limits.sosession required pam_limits.so4)# grep SwapTotal /proc/meminfo# grep MemTotal /proc/meminfotmp >=400m5)create directorymkdir -p /u01/app6)create group and user# /usr/sbin/groupadd oinstall# /usr/sbin/groupadd dba# /usr/sbin/useradd -g oinstall -G dba -d /u01/app/oracle oracle# passwd oracle# chmod -R 755 /u01/apporacle user7) edit .bash_profileexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1export ORACLE_SID=orclexport PATH=$PATH:$HOME/bin:$ORACLE_HOME/binexport NLS_LANG=AMERICAN_AMERICA.UTF8umask 022$ source .bash_profile8)$./runInstaller静默安装:$ vi $DISTRIB/db_swonly.rsp#--------------------------------------------------------------------#以下参数不要更改oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0 oracle.install.option=INSTALL_DB_SWONLYDECLINE_SECURITY_UPDATES=true#以下参数根据实际情况更改,一般也无需更改UNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/u01/app/oracle/oraInventorySELECTED_LANGUAGES=en,zh_CN,zh_TWORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1ORACLE_BASE=/u01/app/oracleoracle.install.db.InstallEdition=EEoracle.install.db.isCustomInstall=trueoracle.install.db.customComponents=oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1. 0,oracle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,oracle.rdb ms.rat:11.2.0.1.0oracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=oinstall#--------------------------------------------------------------------各参数含义如下:-silent 表示以静默方式安装,不会有任何提示-force 允许安装到一个非空目录-noconfig 表示不运行配置助手netca-responseFile 表示使用哪个响应文件,必需使用绝对路径oracle.install.responseFileVersion 响应文件模板的版本,该参数不要更改oracle.install.option 安装选项,本例只安装oracle软件,该参数不要更改DECLINE_SECURITY_UPDATES 是否需要在线安全更新,设置为false,该参数不要更改ORACLE_HOSTNAME 安装主机名UNIX_GROUP_NAME oracle用户用于安装软件的组名INVENTORY_LOCATION oracle产品清单目录SELECTED_LANGUAGES oracle运行语言环境,一般包括引文和简繁体中文ORACLE_HOME Oracle安装目录ORACLE_BASE oracle基础目录oracle.install.db.InstallEdition 安装版本类型,一般是企业版oracle.install.db.isCustomInstall 是否定制安装,默认Partitioning,OLAP,RAT都选上了oracle.install.db.customComponents 定制安装组件列表:除了以上默认的,可加上Label Security和Database Vaultoracle.install.db.DBA_GROUP oracle用户用于授予OSDBA权限的组名oracle.install.db.OPER_GROUP oracle用户用于授予OSOPER权限的组名也可使用有图形的机器,使用图形界面来生成responsfile:$ ./runInstaller &一步步设置到Summary页, 然后点击Save Response File按钮, 选择合适的存放路径并Finish 后, 回到Summary页, 点击Cancel退出OUI1) 通过response文件静默安装, 大概2-3分钟:$ ./runInstaller -silent -force -noconfig -responseFile /tmp/database/response/db_swonly.rsp控制台直到出现以下提示则表示安装完成:#-------------------------------------------------------------------[oracle@xen_200_102 database]$ The following configuration scripts need to be executed as the "root" user.#!/bin/sh#Root scripts to run/u01/app/oracle/oraInventory/orainstRoot.sh/u01/app/oracle/product/11.2.0/db_1/root.shTo execute the configuration scripts:1. Open a terminal window2. Log in as "root"3. Run the scripts4. Return to this window and hit "Enter" key to continueSuccessfully Setup Software.#-------------------------------------------------------------------2) 安装期间查看安装日志信息了解安装进度:$ cd $ORACLE_BASE/oraInventory/logs$ tail -100f installActions*.log3) 安装的软件信息会写入inventory.xml文件, 如果需重运行则把该文件的对应安装条目信息删除即可:$ vi $ORACLE_BASE/oraInventory/ContentsXML/inventory.xml若本机第一次安装oracle软件, 则执行orainstRoot.sh来建立oraInst.loc文件和修改权限: $ su -# /u01/app/oracle/oraInventory/orainstRoot.sh# more /etc/oraInst.loc执行$ORACLE_HOME下的root.sh来建立oratab,dbhome,oraenv,coraenv文件, 如果提示则一直回车:# /u01/app/oracle/product/11.2.0/db_1/root.sh# more /etc/oratab静默配置监听通过response文件运行netca, 生成sqlnet.ora和listener.ora文件, 位于$ORACLE_HOME/network/admin目录下:# su - oracle$ $ORACLE_HOME/bin/netca /silent /responsefile $DISTRIB/response/netca.rsp$ ll $ORACLE_HOME/network/admin/*.ora$ lsnrctl status执行完后, 监听就已经启动了, 默认端口是1521, 默认是动态监听, 只要实例启动了就会监听到.静默建库1) 生成响应文件模板:$ vi /tmp/database/response/db_create.rsp#--------------------------------------------------------------------#以下参数不要更改[GENERAL]RESPONSEFILE_VERSION = "11.2.0"OPERATION_TYPE = "createDatabase"#以下参数必须设置[CREATEDATABASE]GDBNAME = "orcl.LK"TEMPLATENAME = "General_Purpose.dbc"#以下参数不设置则使用默认值,建议设置CHARACTERSET = "AMERICAN_AMERICA.UTF8"TOTALMEMORY = "1024"#--------------------------------------------------------------------2) dbca静默建库, 大概3-4分钟:种子数据库和控制文件位于$ORACLE_HOME/assistants/dbca/templates/下, 即Seed_Database.dfb和Seed_Database.ctl文件, 实际上建库就是基于通过rman恢复种子数据库和控制文件来实现的.$ $ORACLE_HOME/bin/dbca -silent -responseFile /tmp/database/response/db_create.rspEnter SYS user password:<输入sys用户密码>Enter SYSTEM user password:<输入system用户密码>Copying database files...37% completeCreating and starting Oracle instance...62% completeCompleting Database Creation...100% completeLook at the log file "/u01/app/oracle/cfgtoollogs/dbca/ORCL/ORCL.log" for further details. 各参数含义如下:-silent 表示以静默方式安装-responseFile 表示使用哪个响应文件,必需使用绝对路径RESPONSEFILE_VERSION 响应文件模板的版本,该参数不要更改OPERATION_TYPE 安装类型,该参数不要更改GDBNAME 全局数据库名,点号前面默认是db_name,点号后面默认就是db_domain TEMPLATENAME 建库模板名,参考各模板定义:$ORACLE_HOME/assistants/dbca/templates/*.dbcCHARACTERSET 字符集,默认是WE8MSWIN1252TOTALMEMORY 实例内存,默认是服务器物理内存的40%3) 安装期间查看日志信息了解进度:$ tail -100f $ORACLE_BASE/cfgtoollogs/dbca/$ORACLE_SID/$ORACLE_SID.log4) 建库后实例检查$ ps -ef | grep ora_ | grep -v grep | wc -l21$ ps -ef | grep ora_ | grep -v greporacle 1855 1 0 10:07 ? 00:00:00 ora_pmon_ORCLoracle 1857 1 0 10:07 ? 00:00:00 ora_vktm_ORCLoracle 1861 1 0 10:07 ? 00:00:00 ora_gen0_ORCLoracle 1863 1 0 10:07 ? 00:00:00 ora_diag_ORCLoracle 1865 1 0 10:07 ? 00:00:00 ora_dbrm_ORCLoracle 1867 1 0 10:07 ? 00:00:00 ora_psp0_ORCLoracle 1869 1 0 10:07 ? 00:00:00 ora_dia0_ORCLoracle 1871 1 0 10:07 ? 00:00:00 ora_mman_ORCLoracle 1873 1 0 10:07 ? 00:00:00 ora_dbw0_ORCLoracle 1875 1 0 10:07 ? 00:00:00 ora_lgwr_ORCLoracle 1877 1 0 10:07 ? 00:00:00 ora_ckpt_ORCLoracle 1879 1 0 10:07 ? 00:00:00 ora_smon_ORCLoracle 1881 1 0 10:07 ? 00:00:00 ora_reco_ORCLoracle 1883 1 0 10:07 ? 00:00:00 ora_mmon_ORCLoracle 1885 1 0 10:07 ? 00:00:00 ora_mmnl_ORCLoracle 1887 1 0 10:07 ? 00:00:00 ora_d000_ORCLoracle 1889 1 0 10:07 ? 00:00:00 ora_s000_ORCLoracle 1969 1 0 10:07 ? 00:00:00 ora_qmnc_ORCLoracle 1985 1 0 10:07 ? 00:00:00 ora_cjq0_ORCLoracle 2003 1 0 10:08 ? 00:00:00 ora_q000_ORCLoracle 2005 1 0 10:08 ? 00:00:00 ora_q001_ORCL5) 建库后监听检查$ lsnrctl status...Services Summary...Service "ORCL.LK" has 1 instance(s).Instance "ORCL", status READY, has 1 handler(s) for this service...Service "ORCLXDB.LK" has 1 instance(s).Instance "ORCL", status READY, has 1 handler(s) for this service...The command completed successfully实例应该被动态注册到监听程序了. 如果未被动态注册到监听程序, 则可以手工注册: $ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 16 11:11:46 2009Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, Oracle Label Security, OLAP, Data Mining,Oracle Database Vault and Real Application Testing options$SQL> alter system register;6) 改为归档模式并重启$ sqlplus / as sysdbaSQL> shutdown immediate;SQL> startup mount;SQL> alter database archivelog;SQL> alter database flashback on; (如果要启用数据库闪回功能则执行)SQL> alter database open;SQL> execute utl_recomp.recomp_serial(); (重新编译所有可能失效对象)SQL> alter system archive log current; (手工归档测试)到此建库完毕!7) 默认安装的数据库用户:SQL> set lines 256 pages 500SQL> select USER_ID,USERNAME,ACCOUNT_STATUS,DEFAULT_TABLESPACE from dba_users order by 1;USER_ID USERNAME ACCOUNT_STATUSDEFAULT_TABLESPACE---------- ------------------------------ -------------------------------- ------------------------------0 SYS OPENSYSTEM5 SYSTEM OPENSYSTEM9 OUTLN EXPIRED & LOCKED SYSTEM14 DIP EXPIRED & LOCKED USERS21 ORACLE_OCM EX PIRED & LOCKED USERS30 DBSNMP EXPIRED & LOCKED SYSAUX31 APPQOSSYS EX PIRED & LOCKED SYSAUX32 WMSYS EX PIRED & LOCKED SYSAUX42 EXFSYS EXPIRED & LOCKED SYSAUX43 CTXSYS EX PIRED & LOCKED SYSAUX45 XDB EXPIRED & LOCKED SYSAUX46 ANONYMOUS EXPIRED & LOCKED SYSAUX53 ORDSYS EXPIRED & LOCKED SYSAUX54 ORDDATA EXPIRED & LOCKED SYSAUX55 ORDPLUGINS EXPIRED & LOCKED SYSAUX56 SI_INFORMTN_SCHEMA EXPIRED & LOCKED SYSAUX57 MDSYS EXPIRED & LOCKED SYSAUX61 OLAPSYS EXPIRED & LOCKED SYSAUX65 MDDATA EXPIRED & LOCKED USERS67 SPATIAL_WFS_ADMIN_USR EXPIRED & LOCKED USERS70 SPATIAL_CSW_ADMIN_USR EXPIRED & LOCKED USERS72 SYSMAN EX PIRED & LOCKED SYSAUX74 MGMT_VIEW EX PIRED & LOCKED SYSTEM75 FLOWS_FILES EXPIRED & LOCKED SYSAUX76 APEX_PUBLIC_USER EX PIRED & LOCKED USERS78 APEX_030200 EXPIRED & LOCKED SYSAUX79 OWBSYS EX PIRED & LOCKED SYSAUX83 OWBSYS_AUDIT EX PIRED & LOCKED SYSAUX84 SCOTT EXPIRED & LOCKED USERS2147483638 XS$NULL EXPIRED & LOCKED USERS30 rows selected.8) 默认安装的组件:SQL> col COMP_ID format a8col COMP_NAME format a35col VERSION format a12col schema format a12col OTHER_SCHEMAS format a45SQL> select comp_id,comp_name,version,schema,other_schemas from dba_registry order by 1; COMP_ID COMP_NAME VERSION SCHEMA OTHER_SCHEMAS-------- ----------------------------------- ------------ ------------ --------------------------------------------- AMD OLAP Catalog 11.2.0.1.0 OLAPSYSAPEX Oracle Application Express 3.2.1.00.10 APEX_030200FLOWS_FILESAPS OLAP Analytic Workspace 11.2.0.1.0 SYSCATALOG Oracle Database Catalog Views 11.2.0.1.0 SYSCATJAVA Oracle Database Java Packages 11.2.0.1.0 SYSCATPROC Oracle Database Packages and Types 11.2.0.1.0 SYSAPPQOSSYS,DBSNMP,DIP,ORACLE_OCM,OUTLN,SYSTEMCONTEXT Oracle Text 11.2.0.1.0 CTXSYSEM Oracle Enterprise Manager 11.2.0.1.0 SYSMANEXF Oracle Expression Filter 11.2.0.1.0 EXFSYSJAVAVM JServer JAVA Virtual Machine 11.2.0.1.0 SYSORDIM Oracle Multimedia 11.2.0.1.0 ORDSYSMDSYS,ORDDATA,ORDPLUGINS,SI_INFORMTN_SCHEMAOWB OWB 11.2.0.1.0 OWBSYSOWM Oracle Workspace Manager 11.2.0.1.0 WMSYSRUL Oracle Rules Manager 11.2.0.1.0 EXFSYSSDO Spatial 11.2.0.1.0 MDSYSXDB Oracle XML Database 11.2.0.1.0 XDB ANONYMOUS,XS$NULLXML Oracle XDK 11.2.0.1.0 SYSXOQ Oracle OLAP API 11.2.0.1.0 SYS18 rows selected.静默删库(可选)1) 生成响应文件模板:$ vi /tmp/database/response/db_delete.rsp#--------------------------------------------------------------------#以下参数不能更改[GENERAL]RESPONSEFILE_VERSION = "11.2.0"OPERATION_TYPE = "deleteDatabase"#以下参数根据实际情况更改[DELETEDATABASE]SOURCEDB = "ORCL"#--------------------------------------------------------------------2) dbca静默删库, 无需手工停库, 大概1分钟:$ $ORACLE_HOME/bin/dbca -silent -responseFile /tmp/database/response/db_delete.rsp Connecting to database...47% completeUpdating network configuration files...52% completeDeleting instance and datafiles...100% completeLook at the log file "/u01/app/oracle/cfgtoollogs/dbca/ORCL.log" for further details. 各参数含义如下:-silent 表示以静默方式删除-responseFile 表示使用哪个响应文件,必需使用绝对路径RESPONSEFILE_VERSION 响应文件模板的版本,该参数不要更改OPERATION_TYPE 安装类型,该参数不要更改SOURCEDB 数据库名,不是全局数据库名,即不包含db_domain3) 删除期间查看日志信息了解进度:$ tail -100f $ORACLE_BASE/cfgtoollogs/dbca/$ORACLE_SID/$ORACLE_SID.log。
Oracle11G静默安装软件和建库
Oracle11G静默安装软件和建库⼀、准备软件和补丁包p1*******_112040_Linux-x86-64_1of7.zipp1*******_112040_Linux-x86-64_2of7.zipp6880880_112000_Linux-x86-64.zipp2*******_112040_Linux-x86-64.zip⼆、静默安装数据库软件解压数据库软件包,在 /database/response 下⾯有⼀个 db_install.rsp主要做如下修改oracle.install.option=INSTALL_DB_SWONLYORACLE_HOSTNAME=pc #⽤hostname命令查看UNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/u01/app/oraInventorySELECTED_LANGUAGES=en,zh_CNORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db_1ORACLE_BASE=/u01/app/oracleoracle.install.db.InstallEdition=EEoracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=oinstalloracle.installer.autoupdates.option=SKIP_UPDATESDECLINE_SECURITY_UPDATES=true*注意等号后⾯没有空格--执⾏安装脚本/soft/database/runInstaller -silent -responsefile /database/response/db_install.rsp -ignoresysprereqs -showProgress --其中-silent 指的是静默安装, showProgress 显⽰进度, responseFile 是种⼦⽂件--执⾏命令后,在最后需要执⾏脚本的时候报错了Execute Root Scripts in progress.As a root user, execute the following script(s):1. /u01/app/oraInventory/orainstRoot.sh2. /u01/app/oracle/product/11.2.0.4/db_1/root.sh.................................................. 100% Done.Execute Root Scripts successful.Successfully Setup Software.--报错信息如下[root@pc ~]# cat /u01/app/oracle/product/11.2.0.4/db_1/install/root_pc_2020-04-22_16-09-36.logPerforming root user operation for Oracle 11gThe following environment variables are set as:ORACLE_OWNER= oracleORACLE_HOME= /u01/app/oracle/product/11.2.0.4/db_1Copying dbhome to /usr/local/bin ...Copying oraenv to /usr/local/bin ...Copying coraenv to /usr/local/bin ...Creating /etc/oratab file...Entries will be added to the /etc/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root script.Now product-specific root actions will be performed.Finished product-specific root actions./u01/app/oracle/product/11.2.0.4/db_1/root.sh: line 14: /u01/app/oracle/product/11.2.0.4/db_1/rdbms/install/rootadd_rdbms.sh: No such file or directory/u01/app/oracle/product/11.2.0.4/db_1/root.sh: line 16: /u01/app/oracle/product/11.2.0.4/db_1/rdbms/install/rootadd_filemap.sh: No such file or directory---最终找到原因竟然是软件包有问题;导致解压后/database 有问题;上⾯安装进度,产⽣的⽂件⼤⼩是 du -sh /u01/app 2.4G ;正确安装应该是4.2G或者4.3G--解压的软件包有问题,当时解压的⽂件⼤⼩是 1.4G;正常解压完/database 应该是2.5G;--安装完成后可以测试登陆数据库[oracle@pc ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Wed Apr 22 18:07:39 2020Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to an idle instance.SQL>SQL> exitDisconnected[oracle@pc ~]$---主库静默DBCA建库:/u01/app/oracle/product/11.2.0.4/db_1/bin/dbca -silent -createDatabase -templateName/u01/app/oracle/product/11.2.0.4/db_1/assistants/dbca/templates/General_Purpose.dbc -gdbName pcc -sid pc -sysPassword oracle -systemPassword oracle -emConfiguration LOCAL -dbsnmpPassword oracle -sysmanPassword oracle -characterSet ZHS16GBK--报错如下:[root@pc soft]# cat /u01/app/oracle/cfgtoollogs/dbca/pc/pc.logCopying database filesDBCA_PROGRESS : 1%DBCA_PROGRESS : 2%ORA-27102: out of memoryDBCA_PROGRESS : 4%DBCA_PROGRESS : 11%DBCA_PROGRESS : 12%ORA-01034: ORACLE not availableORA-01034: ORACLE not availableDBCA_PROGRESS : 100%vi /etc/sysctl.confshmall 是全部允许使⽤的共享内存⼤⼩,shmmax 是单个段允许使⽤的⼤⼩。
oracle11g静默安装
oracle11g静默安装ls /u01/soft/extra/oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64.rpm/u01/soft/extra/oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64.rpm[root@wlc Desktop]# yum install /u01/soft/extra/oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64.rpm [root@wlc Desktop]# echo oracle|passwd oracle --stdinChanging password for user oracle.passwd: all authentication tokens updated successfully.[root@wlc Desktop]# 下⾯⽂件被修改echo "kernel.sem = 250 32000 100 128">>/etc/sysctl.confecho "net.ipv4.ip_local_port_range = 9000 65500">>/etc/sysctl.confecho "net.core.rmem_max = 1048576">>/etc/sysctl.confecho "net.core.rmem_default = 1048576">>/etc/sysctl.confecho "net.core.wmem_max = 1048576">>/etc/sysctl.confecho "net.core.wmem_default = 1048576">>/etc/sysctl.conf[root@wlc Desktop]# ls /etc/sysctl.conf/etc/sysctl.conf[root@wlc Desktop]# ls /etc/security/limits.conf/etc/security/limits.conf[root@wlc Desktop]# useradd -g oinstall -G dba grid[root@wlc Desktop]# echo oracle|passwd grid --stdinChanging password for user grid.passwd: all authentication tokens updated successfully.[root@wlc Desktop]# mkdir -p /u01/app/grid[root@wlc Desktop]# chown -R grid:oinstall /u01/app/grid[root@wlc Desktop]# mkdir /u01/app/oraInventory[root@wlc Desktop]# chown -R grid:oinstall /u01/app/oraInventory[root@wlc Desktop]# su - grid[grid@wlc ~]$ which unzip/usr/bin/unzip[grid@wlc ~]$ unzip -q /u01/soft/p1*******_112030_Linux-x86-64_3of7.zip[grid@wlc ~]$ ls grid/doc readme.html rpm runInstaller stageinstall response runcluvfy.sh sshsetup welcome.html[grid@wlc ~]$[grid@wlc ~]$ ./runInstaller -ignorePrereq -ignoreInternalDriverError -ignoreSysPrereqs -ignoreSysPrereqs -silent -responseFile/home/grid/grid/response/grid_install.rsp INVENTORY_LOCATION=/u01/app/oraInventorySELECTED_LANGUAGES=en,zh_CN oracle.install.option=CRS_SWONLYORACLE_BASE=/u01/app/grid ORACLE_HOME=/u01/app/grid/11g oracle.install.asm.OSDBA=dbaoracle.install.asm.OSOPER=oinstall oracle.install.asm.OSASM=oinstalloracle.installer.autoupdates.option=SKIP_UPDATES......看到有You can find the log of this install session at:/u01/app/oraInventory/logs/installActions2015-05-05_03-20-43PM.log表⽰在安装否则需要tail -f /u01/app/oraInventory/logs/installActions2015-05-05_03-20-43PM.log找错误解决后继续 runInstaller看到 /u01/app/grid/11g 下有内容表⽰在正常安装如不⾏请检查主机名等⼀段时间看到如下内容The installation of Oracle Grid Infrastructure was successful.Please check '/u01/app/oraInventory/logs/silentInstall2015-05-05_03-20-43PM.log' for more details.As a root user, execute the following script(s):1. /u01/app/oraInventory/orainstRoot.sh2. /u01/app/grid/11g/root.shSuccessfully Setup Software.新打开root终端执⾏脚本[root@wlc Desktop]# /u01/app/oraInventory/orainstRoot.shChanging permissions of /u01/app/oraInventory.Adding read,write permissions for group.Removing read,write,execute permissions for world.Changing groupname of /u01/app/oraInventory to oinstall.The execution of the script is complete.[root@wlc Desktop]#[root@wlc Desktop]# /u01/app/grid/11g/root.shCheck /u01/app/grid/11g/install/root__2015-05-05_15-25-04.log for the output of root script[root@wlc Desktop]# cat /u01/app/grid/11g/install/root__2015-05-05_15-25-04.logPerforming root user operation for Oracle 11gThe following environment variables are set as:ORACLE_OWNER= gridORACLE_HOME= /u01/app/grid/11gCreating /etc/oratab file...Entries will be added to the /etc/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root script.Now product-specific root actions will be performed.To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:/u01/app/grid/11g/perl/bin/perl -I/u01/app/grid/11g/perl/lib -I/u01/app/grid/11g/crs/install/u01/app/grid/11g/crs/install/roothas.plTo configure Grid Infrastructure for a Cluster execute the following command:/u01/app/grid/11g/crs/config/config.shThis command launches the Grid Infrastructure Configuration Wizard. The wizard also supports silent operation, and the parameters can be passed through the responsefile that is available in the installation media.[root@wlc Desktop]# 看⽇志执⾏/u01/app/grid/11g/perl/bin/perl -I/u01/app/grid/11g/perl/lib -I/u01/app/grid/11g/crs/install /u01/app/grid/11g/crs/install/roothas.plUsing configuration parameter file: /u01/app/grid/11g/crs/install/crsconfig_paramsCreating trace directoryUser ignored Prerequisites during installationLOCAL ADD MODECreating OCR keys for user 'grid', privgrp 'oinstall'..Operation successful.LOCAL ONLY MODESuccessfully accumulated necessary OCR keys.Creating OCR keys for user 'root', privgrp 'root'..Operation successful.CRS-4664: Node wlc successfully pinned.Adding Clusterware entries to upstartwlc 2015/05/05 15:26:21 /u01/app/grid/11g/cdata/wlc/backup_20150505_152621.olrSuccessfully configured Oracle Grid Infrastructure for a Standalone Server[root@wlc Desktop]#[root@wlc Desktop]# tail -1 /etc/init/oracle-ohasd.confexec /etc/init.d/init.ohasd run >/dev/null 2>&1[root@wlc Desktop]#[root@wlc Desktop]# echo "`tail -1 /etc/init/oracle-ohasd.conf` &"exec /etc/init.d/init.ohasd run >/dev/null 2>&1[root@wlc Desktop]# echo "`tail -1 /etc/init/oracle-ohasd.conf` &" >>/etc/rc.local[root@wlc Desktop]#[root@wlc Desktop]# tail -1 /etc/rc.localexec /etc/init.d/init.ohasd run >/dev/null 2>&1[root@wlc Desktop]#[root@wlc Desktop]# su - grid[grid@wlc grid]$ sed -i '/PATH/i export ORACLE_BASE=/u01/app/grid' ~/.bash_profile[grid@wlc grid]$[grid@wlc grid]$ sed -i '/PATH/i export ORACLE_HOME=/u01/app/grid/11g' ~/.bash_profile[grid@wlc grid]$[grid@wlc grid]$ sed -i 's#PATH=#PATH=$ORACLE_HOME/bin:#' ~/.bash_profile[grid@wlc grid]$ . ~/.bash_profile[grid@wlc grid]$ which crs_stat/u01/app/grid/11g/bin/crs_stat[grid@wlc grid]$ crs_stat -tName Type Target State Host------------------------------------------------------------ora.cssd ora.cssd.type OFFLINE OFFLINEora.diskmon ora....on.type OFFLINE OFFLINEora.evmd ora.evm.type ONLINE ONLINE wlcora.ons ora.ons.type OFFLINE OFFLINE[grid@wlc grid]$[grid@wlc grid]$ srvctl add listener -p "TCP:1521/IPC:EXTPROC1521"[grid@wlc grid]$ srvctl start listener[grid@wlc grid]$ exit[root@wlc Desktop]# mkdir /u01/app/oracle[root@wlc Desktop]# chown -R oracle:oinstall /u01/app/oracle[root@wlc Desktop]# su - oracle[oracle@wlc ~]$ unzip -q /u01/soft/p1*******_112030_Linux-x86-64_1of7.zip[oracle@wlc ~]$ unzip -q /u01/soft/p1*******_112030_Linux-x86-64_2of7.zip[oracle@wlc ~]$ ls database/doc readme.html rpm sshsetup welcome.htmlinstall response runInstaller stage[oracle@wlc ~]$ cd database/[oracle@wlc database]$ ./runInstaller -ignorePrereq -ignoreSysPrereqs -ignoreSysPrereqs -silent -responseFile/home/oracle/database/response/db_install.rsporacle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/u01/app/oraInventory SELECTED_LANGUAGES=en,zh_CN ORACLE_BASE=/u01/app/oracle ORACLE_HOME=/u01/app/oracle/11g oracle.install.db.InstallEdition=EE oracle.install.db.EEOptionsSelection=true oracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=oinstall DECLINE_SECURITY_UPDATES=trueoracle.installer.autoupdates.option=SKIP_UPDATES/////////////////////////////////////////////////////////////////////////////Starting Oracle Universal Installer...Checking Temp space: must be greater than 120 MB. Actual 7759 MB PassedChecking swap space: must be greater than 150 MB. Actual 8186 MB PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2015-05-05_03-42-37PM. Please wait ...[oracle@wlc database]$ No protocol specified[WARNING] [INS-30060] Check for group existence failed.CAUSE: Unexpected error occurred while trying to check for group existence.ACTION: Refer to the logs or contact Oracle Support Services. Note for advanced users: Launch the installer by passing the following flag ''-ignoreInternalDriverError''.You can find the log of this install session at:/u01/app/oraInventory/logs/installActions2015-05-05_03-42-37PM.logThe installation of Oracle Database 11g was successful.Please check '/u01/app/oraInventory/logs/silentInstall2015-05-05_03-42-37PM.log' for more details.As a root user, execute the following script(s):1. /u01/app/oracle/11g/root.shSuccessfully Setup Software.[oracle@wlc database]$ exitlogout[root@wlc Desktop]# /u01/app/oracle/11g/root.shCheck /u01/app/oracle/11g/install/root__2015-05-05_15-47-58.log for the output of root script[root@wlc Desktop]#[root@wlc Desktop]# sed -i '/PATH=/i export ORACLE_BASE=/u01/app/oracle' ~oracle/.bash_profile[root@wlc Desktop]# sed -i '/PATH=/i export ORACLE_HOME=/u01/app/oracle/11g' ~oracle/.bash_profile[root@wlc Desktop]# sed -i 's#PATH=#PATH=$ORACLE_HOME/bin:#' ~oracle/.bash_profile[root@wlc Desktop]# su - oracle[oracle@wlc ~]$ which sqlplus/u01/app/oracle/11g/bin/sqlplusvim ~oracle/.bash_profile# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then. ~/.bashrcfi# User specific environment and startup programsexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=/u01/app/oracle/11gPATH=$ORACLE_HOME/bin:$PATH:$HOME/binexport PATH[oracle@wlc ~]$ which dbca/u01/app/oracle/11g/bin/dbca[oracle@wlc ~]$[oracle@wlc ~]$ dbca -silent -createDatabase -templateName$ORACLE_HOME/assistants/dbca/templates/General_Purpose.dbc -gdbname updb -sid updb -syspassword oracle -systempassword oracle -emconfiguration LOCAL -dbsnmppassword oracle -sysmanpassword oracle -characterset al32utf8 -sampleSchema true -totalMemory 1200///////////////////Copying database files1% complete3% complete10% complete17% complete24% complete35% completeCreating and starting Oracle instance37% complete42% complete47% complete52% complete53% complete56% complete58% completeRegistering database with Oracle Restart64% completeCompleting Database Creation68% complete71% complete75% complete85% complete96% complete100% completeLook at the log file "/u01/app/oracle/cfgtoollogs/dbca/updb/updb.log" for further details. [oracle@wlc ~]$ tail -1 /etc/oratabupdb:/u01/app/oracle/11g:N # line added by Agentcat /etc/oratab 查看实例名称[oracle@wlc ~]$[oracle@wlc ~]$ echo "export ORACLE_SID=updb">>~/.bash_profile[oracle@wlc ~]$ . ~/.bash_profile[oracle@wlc ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Tue May 5 16:08:53 2015Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, Oracle Label Security, OLAP, Data Mining,Oracle Database Vault and Real Application Testing optionsSQL> select open_mode from v$database;OPEN_MODE--------------------READ WRITESQL> exitDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Oracle Label Security, OLAP, Data Mining,Oracle Database Vault and Real Application Testing options[oracle@wlc ~]$ exitlogout[root@wlc Desktop]# su - grid[grid@wlc ~]$ crs_stat -tName Type Target State Host------------------------------------------------------------ora....ER.lsnr ora....er.type ONLINE ONLINE wlc ora.cssd ora.cssd.type OFFLINE OFFLINE ora.diskmon ora....on.type OFFLINE OFFLINE ora.evmd ora.evm.type ONLINE ONLINE wlc ora.ons ora.ons.type OFFLINE OFFLINE ora.updb.db ora....se.type ONLINE ONLINE wlc [grid@wlc ~]$ exit。
ORACLE LINUX系统 静默安装操作手册
ORACLE静默安装1.ORACLE的安装1.1. 安装准备1.1.1.Linux建立oracle用户添加用户组及用户groupadd dbagroupadd oinstalluseradd oracle -g oinstall -G dbapasswd oracle #设置用户oracle的登录密码,根据提示输入两次密码1.1.2.在home目录新建Oracle目录权限cd /homemkdir oracle1.1.3.赋执行权限chown -R oracle:dba /home/oraclechmod -R 755 /home/oracle1.1.4.解压oracle的安装文件unzip linux.x64_11gR2_database_1of2.zip -d /home/oracle/unzip linux.x64_11gR2_database_2of2.zip -d /home/oracle/1.1.5.设置环境变量关闭防火墙vi /home/oracle/.bash_profile #在最后添加以下代码export ORACLE_BASE=/home/oracle/app #oracle数据库安装目录export ORACLE_HOME=$ORACLE_BASE /product/11.2.0/db_1 export ORACLE_SID=orcl #oracle启动数据库实例名export ORACLE_TERM=xterm #xterm窗口模式安装export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH #添加系统环境变量export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib #添加系统环境变量:wq! #保存退出source /home/oracle/.bash_profile #使设置立刻生效完成后执行:$ env | grep ORA #查看环境变量是否完成oracle@oracledb ~]$ env | grep ORAORACLE_BASE=/home/oracle/appORACLE_HOME=/home/oracle/app/product/11.2.0/db_1#关闭防火墙service iptables stop1.1.6.安装依赖包yum -y install gcc gcc-c++ make binutilscompat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-commonglibc-devel libaio libaio-devel libgcclibstdc++ libstdc++-devel unixODBC unixODBC-devel安装完成之后运行:rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make numactl-devel sysstat如遇到is not installed 请先yum search ksh再执行yum install ksh.x86_64 安装,有两个文件,如:先装i686,再x86_641.2. 开始安装1.2.1.文件配置ORACLE ZIP文件解压后得到database目录,其中包含response目录,该目录中有三个rsp文件,用来作为静默安装时的应答文件的模板。
oracle静默安装
1、安装RPM包# yum install 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 \pdksh \sysstat \unixODBC \ unixODBC-devel备注:部分机器估计libaio的32和64包都需要,没有还不行。
2、固定IP地址,hostname,hosts记录[root@localhost ~]# vim /etc/sysconfig/networkhostname=[root@oracle11g ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0BOOTPROTO=noneHWADDR=00:0C:29:1E:68:68ONBOOT=yesIPADDR=192.168.1.16NETMASK=255.255.255.0GATEWAY=192.168.1.254[root@oracle11g ~]# ifconfig eth0 | head -n 2eth0 Link encap:Ethernet HWaddr 00:0C:29:9F:DF:4Ainet addr:192.168.1.16 Bcast:192.168.1.255 Mask:255.255.255.0[root@oracle11g ~]# grep -v '^#' /etc/hosts127.0.0.1 localhost.localdomainlocalhost192.168.1.16 3、设置系统的操作资源[root@oracle11g ~]#vim /etc/sysctl.conf 添加到文件底端kernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128fs.file-max = 65536net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default = 1048576net.core.rmem_max = 1048576net.core.wmem_default = 262144net.core.wmem_max = 262144[root@oracle11g ~]#sysctl -pshell限制[root@oracle11g ~]# grep -v '^#' /etc/security/limits.conf oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536[root@oracle11g ~]# grep 'limit' /etc/pam.d/system-auth session required pam_limits.so4、设置oracle用户建议指定GID和UID方式(尤其集群环境) [root@oracle11g ~]# groupadd -g 1000 oinstall[root@oracle11g ~]# groupadd -g 1001 dba[root@oracle11g ~]# useradd -u 1000 -g oinstall -G dba oracle[root@oracle11g ~]# passwd oracle建立oracle软件安装文件目录[root@oracle11g ~]# mkdir -p /u01/oracle[root@oracle11g ~]# chown -R oracle:oinstall /u01/设置oracle环境变量[root@oracle11g ~]vi ~oracle/.bash_profileumask 022export ORACLE_BASE=/u01/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0 export ORACLE_SID=oracle11gexport PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib加载配置oracle用户注销重新登录或##su - oracle#source .bash_profile5、解压安装文件#unzip linux.x64_11gR2_database_1of2.zip -d /mnt#unzip linux.x64_11gR2_database_2of2.zip -d /mnt6、修改配置文件[root@oracle11g ~]# grep -v '^#' /mnt/database/response/db_install.rsp (参考静默安装----配置文件说明)oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2 _0oracle.install.option=INSTALL_DB_SWONLYORACLE_HOSTNAME=UNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/u01/oracleSELECTED_LANGUAGES=en,zh_CN,zh_TW (选择要支持的语言)ORACLE_HOME=/u01/oracle/product/11.2.0ORACLE_BASE=/u01/oracleoracle.install.db.InstallEdition=EEoracle.install.db.isCustomInstall=trueoracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=oinstalloracle.install.db.config.starterdb.characterSet=AL32UTF8 (根据生产环境中的需要,进行修改字符集)oracle.install.db.config.starterdb.memoryOption=trueoracle.install.db.config.starterdb.installExampleSchemas=falseoracle.install.db.config.starterdb.enableSecuritySettings=trueoracle.install.db.config.starterdb.control=DB_CONTROLoracle.install.db.config.starterdb.automatedBackup.enable=falseDECLINE_SECURITY_UPDATES=true (要家上,要不然会报错【server】email address 错误)7、静默安装数据库[root@oracle11g ~]#cd /mnt/database/response[root@oracle11g response]$ chown -R oracle:oinstall/mnt/database/response/db_install.rsp[root@oracle11g response]$chmod 700 db_install.rsp#su - oracle#cd /mnt/database/$ ./runInstaller -silent -force -responseFile/mnt/database/response/db_install.rsp (注意要写绝对路径)如报ins-13014 错误不需要理会报ins-07001 配置文件中的有些文件找不到,对安装没有多大影响(日志文件看安装进度)#tail -100f /u01/oracle/logs/installActions2013-06-10_04-01-32PM.log带出现以下内容,说明安装成功#!/bin/sh#Root scripts to run/u01/oracle/orainstRoot.sh/u01/oracle/product/11.2.0/root.shTo execute the configuration scripts:1. Open a terminal window2. Log in as "root"3. Run the scripts4. Return to this window and hit "Enter" key to continueSuccessfully Setup Software.注意:必须用root用户跑一下脚本#/u01/oracle/orainstRoot.sh#/u01/oracle/product/11.2.0/root.sh[root@oracle11g 11.2.0]# su - oracle[oracle@oracle11g ~]$ ps aux |grepora_oracle 18649 0.0 0.0 61188 744 pts/2 S+ 16:31 0:00 grepora_ (说明没有数据库)只安装了实例[oracle@oracle11g ~]$ sqlsqlite3 sqlldr sqlldrO sqlplus[oracle@oracle11g ~]$ sqlplus / as sysdba (出现错误,但实例已安装完成)sqlplus: error while loading shared libraries:/u01/oracle/product/11.2.0/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied(关闭防火墙与sensetforce )[root@oracle11g ~]# iptables -LChain INPUT (policy ACCEPT)target prot opt source destinationChain FORWARD (policy ACCEPT)target prot opt source destinationChain OUTPUT (policy ACCEPT)target prot opt source destination[root@oracle11g ~]# getenforceEnforcing[root@oracle11g ~]# setenforce 0[root@oracle11g ~]# getenforcePermissive[oracle@oracle11g ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 10 16:40:29 2013 Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to an idle instance.SQL>。
Centos7静默安装oracle 11g
Centos7静默安装Oracle11g1、创建用户和组groupadd oinstallgroupadd dbauseradd -g oinstall -g dba -m oraclepasswd oracle2、创建Oracle数据库的安装目录(for静默安装)mkdir -p /opt/oraclemkdir -p /opt/oraInventorymkdir -p /opt/databasemkdir -p /opt/oracle/product/11.2.0mkdir -p /opt/oracle/oradatamkdir -p /opt/oracle/flash_recovery_areachown -R oracle:oinstall /opt/oraclechown -R oracle:oinstall /opt/oracle/oradatachown -R oracle:oinstall /opt/oraInventorychown -R oracle:oinstall /opt/databasechmod -R 775 /opt/oracle3、配置oracle环境su - oraclevim .bash_profile添加如下内容:# 注意:# 1. ORACLE_SID 必须与创建的数据库实例名称一致,否则数据库启动后无法访问# 2. ORACLE_HOME 根据实际情况填写,安装完毕以后,再检查一下,如果有误,需要调整,确保正确ORACLE_BASE=/opt/oracle#ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1ORACLE_HOME=$ORACLE_BASE/product/11.2.0ORACLE_SID=orclPATH=$PATH:$ORACLE_HOME/binexport ORACLE_BASE ORACLE_HOME ORACLE_SID PATH执行生效:source .bash_profile检查是否生效echo $ORACLE_HOME4、解压安装包cd /optunzip linux.x64_11gR2_database_1of2.zip -d /opt/databaseunzip linux.x64_11gR2_database_2of2.zip -d /opt/database5、用root账号创建/etc/oraInst.loc文件,否则安装时会报错:SEVERE: [FATAL] [INS-32038] The operating system group specified for central inventory (oraInventory) ownership is invalid.vim /etc/oraInst.locinventory_loc=/opt/oraInventoryinst_group=oinstall6、安装未安装的package验证命令26个包,如果没有安装,需要先安装Su - rootrpm -qa binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-develelfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers glibc-static kernel-headers pdksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel libstdc++-static make numactl-devel sysstat unixODBC unixODBC-develyum install -y binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-develelfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers glibc-static kernel-headers pdksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel libstdc++-static make numactl-devel sysstat unixODBC unixODBC-devel####redhat7.5 执行的安装命令;yum install -y compat-libstdc++-33 elfutils-libelf-devel gcc gcc-c++ glibc-develyum install -y ksh libaio-devel numactl-develyum install -y unixODBC unixODBC-devel oracleasm oracleasmlib oracleasm-support注意,安装完以后,可以再重新执行一次yum install确认一下,是否有未安装的包。
oracle11G静默安装@centos6.8演示教学
o r a c l e11G静默安装@c e n t o s6.8配置系统代理:root 用户加http和ftp代理:sed -i '$a export http_proxy="http://10.45.60.183:8080/"\n exporthttp_ftp="http://10.45.60.183:8080/"' /root/.bash_profileyum.conf增加代理sed -i '$a proxy=http://10.45.60.183:8080/' /etc/yum.confwgetrc增加代理:sed -i '$a https_proxy=http://10.45.60.183:8080/\nhttp_proxy=http://10.45.60.183:8080/\n ftp_proxy=http://10.45.60.183:8080/'/etc/wgetrcps: 运行yum.sh增加本地源和安装vncyum-6.8.sh.配置系统和安装所需软件包2.1 关闭selinuxsed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config2.6安装oracle所需的软件包yum install -y gcc gcc-c++ glibc glibc-devel glibc-headers pdksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel zlib-devel unzip compat-libcap1 compat-libstdc++-33重启以后再安装pdksh:wget /centos/5/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpmrpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm如果:pdksh 与 (已安裝) ksh-20120801-22.el7_1.3.x86_64 冲突需要先卸载ksh:rpm -e ksh-20120801-22.el7_1.3.x86_642.7 添加oracle用户和组groupadd oinstallgroupadd dbagroupadd opermkdir /oracleuseradd -d /oracle -g oinstall -G dba,oper -u 500 -r -p ztesoft oracle2.8 修改系统参数2.8.1 /etc/sysctl.conffs.file-max = 6815744kernel.sem = 250 32000 100 128kernel.shmmni = 4096kernel.shmall = 1073741824kernel.shmmax = 4398046511104net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576fs.aio-max-nr = 1048576net.ipv4.ip_local_port_range = 9000 65500命令行:sed -i '$a fs.file-max = 6815744\nkernel.sem = 250 32000 100 128\nkernel.shmmni = 4096\nkernel.shmall = 1073741824\nkernel.shmmax =4398046511104\nnet.core.rmem_default = 262144\nnet.core.rmem_max = 4194304\nnet.core.wmem_default = 262144\nnet.core.wmem_max =1048576\nfs.aio-max-nr = 1048576\nnet.ipv4.ip_local_port_range = 9000 65500\n' /etc/sysctl.conf2.8.2 应用核心参数sysctl -p2.8.3 /etc/security/limits.conforacle soft nofile 1024oracle hard nofile 65536oracle soft nproc 2047oracle hard nproc 16384oracle soft stack 10240oracle hard stack 32768命令行:sed -i '$a oracle soft nofile 1024\noracle hard nofile 65536\noracle soft nproc 2047\noracle hard nproc 16384\noracle soft stack 10240\noracle hard stack 32768\n' /etc/security/limits.conf2.9 创建安装文件夹mkdir /oracle/zscmkdir /oracle/oradatamkdir /oracle/oraInventorychown -R oracle:oinstall /oracle3.切换到oracle用户,配置oracle用户环境变量3.1 设置oracle用户密码并切换到oracle用户passwd oraclesu - oracle3.2 编辑oracle用户环境变量配置文件~/.bash_profileexport PS1="[\u@\h\w]$"export ORACLE_BASE=/oracle/zscexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export ORACLE_SID=zscPATH=/usr/sbin:$PATH:$ORACLE_HOME/bin:$HOME/bin:/$HOME/.local/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"alias cdob='cd $ORACLE_BASE'alias cdoh='cd $ORACLE_HOME'alias tns='cd $ORACLE_HOME/network/admin'alias envo='env | grep ORACLE'3.3 应用环境变量source .bash_profile4.获取安装包进行安装4.1 从/technetwork/database/enterprise-edition/downloads/index.html 下载oracle12c安装包4.2 解压安装包unzip linux.x64_11gR2_database_1of2.zipunzip linux.x64_11gR2_database_2of2.zip4.3 进入database文件夹复制一个应答文件cd databasecp response/db_install.rsp inst.rsp4.4 修改应答文件ps:需要手动修改:INVENTORY_LOCATION=/oracle/oraInventoryORACLE_HOME=/oracle/zsc/product/11.2.0/dbhome_1ORACLE_BASE=/oracle/zsc4.5 执行安装程序./runInstaller -ignoreSysPrereqs -force -silent -responseFile ~/database/inst.rsp4.6 查看是否有出错日志tail –f /oracle/oraInventory/logs/silentInstall2016-05-07_01-34-53PM.log如果没有安装pdksh会报如下错:INFO: Actual Value:缺失INFO: Error Message:PRVF-7532 : 节点 "localhost" 上缺少程序包 "pdksh" INFO: Cause: 指定的节点上未安装必需的程序包; 或者如果该程序包是内核模块, 则未加载该程序包。
Centos7静默安装ORACLE11G-R2
1.开启机器,本次实例分配的ip是:192.168.3.197(Xshell ssh连接)1.安装unzip 工具、vim编辑器(个人习惯,vi也可以)2.在/etc/hosts文件中添加本机IP跟主机名3.关闭selinux ,编辑/etc/selinux/config文件,设置SELINUX=enforcing 为SELINUX=disabled4.关闭防火墙(1)查看防火墙状态:systemctl status firewalld(2)停止防火墙:systemctl stop firewalld(3)关闭自启动防火墙服务:systemctl disable firewalld5.安装Oracle 11g依赖包yum -y install gcc make binutils gcc-c++ compat-libstdc++-33 elfutils-libelf-devel elfutils-libelf-devel-static elfutils-libelf-devel ksh libaio libaio-devel numactl-devel sysstat unixODBC unixODBC-devel pcre-develrpm –ivh *.rpmbinutils-2.20.51.0.2-5.48.el6.x86_64.rpmcloog-ppl-0.15.7-1.2.el6.x86_64.rpmcloog-ppl-devel-0.15.7-1.2.el6.x86_64.rpmcompat-libstdc++-33-3.2.3-69.el6.x86_64.rpmcpp-4.4.7-23.el6.x86_64.rpmelfutils-libelf-devel-0.164-2.el6.x86_64.rpmelfutils-libelf-devel-static-0.164-2.el6.x86_64.rpmgcc-4.4.7-23.el6.x86_64.rpmgcc-c++-4.4.7-23.el6.x86_64.rpmgmp-4.3.1-13.el6.x86_64.rpmgmp-devel-4.3.1-13.el6.x86_64.rpmksh-20120801-37.el6_9.x86_64.rpmlibaio-0.3.107-10.el6.x86_64.rpmlibaio-devel-0.3.107-10.el6.x86_64.rpmlibstdc++-devel-4.4.7-23.el6.x86_64.rpmmake-3.81-23.el6.x86_64.rpmmpfr-2.4.1-6.el6.x86_64.rpmnet-tools-1.60-114.el6.x86_64.rpmnumactl-devel-2.0.9-2.el6.x86_64.rpmpcre-devel-7.8-7.el6.x86_64.rpmppl-0.10.2-11.el6.x86_64.rpmppl-devel-0.10.2-11.el6.x86_64.rpmsysstat-9.0.4-33.el6_9.1.x86_64.rpmunixODBC-2.2.14-14.el6.x86_64.rpmunixODBC-devel-2.2.14-14.el6.x86_64.rpmvim-enhanced-7.4.629-5.el6_8.1.x86_64.rpm6.添加oinstall 、dba 组,新建oracle用户并加入oinstall、dba组中;设置oracle用户登录密码;查看Oracle用户信息groupadd oinstallgroupadd dbauseradd -g oinstall -G dba oraclepasswd oracle7.创建目录修改属组和权限创建目录:mkdir -p /u01/app/oracle/product/11.2.0/db_1mkdir -p /u01/app/oracle/oradatamkdir -p /u01/app/oracle/inventorymkdir -p /u01/app/oracle/fast_recovery_areachown -R oracle:oinstall /u01/app/oraclechmod -R 755 /u01/app/oracle语句的作用依次为:前面创建的目录主要作用为Oracle家目录、数据文件存放位置,安装日志存放位置,快速恢复区修改属组,修改权限8.解压oracle软件包:unzip linux.x64_11gR2_database_1of2.zip && unzip linux.x64_11gR2_database_2of2.zip9.修改内核参数:编辑vim /etc/sysctl.conf添加以下设置:io-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 1073741824kernel.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让参数生效:/sbin/sysctl -p10.修改用户的限制文件,编辑vim /etc/security/limits.conf 添加以下配置:oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle soft stack 1024011.修改/etc/profile文件:vim /etc/profile添加:if [ $USER = "oracle" ]; thenif [ $SHELL = "/bin/ksh" ]; thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fifi12.切换到oracle用户,设置oracle用户环境变量su - oraclevim .bash_profile添加:ORACLE_BASE=/u01/app/oracleORACLE_HOME=$ORACLE_BASE/product/11.2.0 ORACLE_SID=orclPATH=$PATH:$ORACLE_HOME/binexport ORACLE_BASE ORACLE_HOME ORACLE_SID PATH13.编辑静默安装响应文件(1)切换到root 用户进入oracle安装包解压后的目录/tmp/database/response/下备份db_install.rsp文件。
Oracle 11g 静默安装-db_install.rsp详解
Oracle 11g 静默安装-db_install.rsp详解前提安装正常的配置流程,配置完服务器后,将db_install.rsp、netca.rsp,dbca.rsp复制到/app/一份,然后参考后面静默配置文件修改好后安装静默安装命令:./runInstaller –silent –responseFile /app/db_install.rsp -showProgress –noconfig –ignoreSysPrereqs静默配置网络监听命令./netca –silent –responseFile /app/netca.rsp静默创建数据库命令./dbca –silent –responseFile /app/dbca.rspvi /etc/selinux/config# 设置SELINUX为disabledSELINUX=disabled[root@oracle ~]# service iptables stop###################################################################### Copyright(c) Oracle Corporation1998,2008. All rights reserved. #### Specify values for the variables listedbelow to customize your installation. #### Each variable is associated with acomment. The comment #### can help to populate the variables withthe appropriate values. #### IMPORTANT NOTE: This file contains plaintext passwords and #### should be secured to have readpermission only by oracle user #### or db administrator who owns thisinstallation. ####对整个文件的说明,该文件包含参数说明,静默文件中密码信息的保密######################################################################---------# Do not change the following system generatedvalue. 标注响应文件版本,这个版本必须和要#安装的数据库版本相同,安装检验无法通过,不能更改#------------------------------------------------------------------------------oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_re sponse_schema_v11_2_0#------------------------------------------------------------------------------# Specify the installation option.# It can be one of the following:# 1. INSTALL_DB_SWONLY# 2. INSTALL_DB_AND_CONFIG# 3. UPGRADE_DB#选择安装类型:1.只装数据库软件 2.安装数据库软件并建库 3.升级数据库#-------------------------------------------------------------------------------oracle.install.option=INSTALL_DB_SWONLY----------# Specify the hostname of the system as setduring the install. It can be used# to force the installation to use analternative hostname rather than using the# first hostname found on the system.(e.g., for systems with multiple hostnames# and network interfaces)指定操作系统主机名,通过hostname命令获得#-------------------------------------------------------------------------------ORACLE_HOSTNAME=dygisapp#-------------------------------------------------------------------------------# Specify the Unix group to be set for theinventory directory.#指定oracle inventory目录的所有者,通常会是oinstall或者dba#-------------------------------------------------------------------------------UNIX_GROUP_NAME=oinstall----------# Specify the location which holds theinventory files.#指定产品清单oracle inventory目录的路径,如果是Win平台下可以省略#-------------------------------------------------------------------------------INVENTORY_LOCATION=/app/oracle/oraInventory#-------------------------------------------------------------------------------# Specify the languages in which thecomponents will be installed.# en : English ja : Japanese# fr : French ko : Korean# ar : Arabic es : Latin American Spanish# bn : Bengali lv : Latvian# pt_BR: Brazilian Portuguese lt : Lithuanian# bg : Bulgarian ms : Malay# fr_CA: Canadian French es_MX: Mexican Spanish# ca : Catalan no : Norwegian# hr : Croatian pl : Polish# cs : Czech pt : Portuguese# da : Danish ro : Romanian# nl : Dutch ru : Russian# ar_EG: Egyptian zh_CN: Simplified Chinese # en_GB: English (Great Britain) sk :Slovak # et : Estonian sl : Slovenian# fi : Finnish es_ES: Spanish# de : German sv : Swedish# el : Greek th : Thai# iw : Hebrew zh_TW:Traditional Chinese# hu : Hungarian tr : Turkish# is : Icelandic uk : Ukrainian# in : Indonesian vi :Vietnamese# it : Italian# Example : SELECTED_LANGUAGES=en,fr,ja#指定数据库语言,可以选择多个,用逗号隔开。
Linux7静默安装Oracle11g教程
Linux7静默安装Oracle11g教程1.查看swap大小,若小于150M,需添加增加虚拟空间dd if=/dev/zero of=/swapadd bs=1024 count=2006424mkswap /swapaddswapon /swapadd重启系统虚拟空间会消失,除非打开/etc/fstab文件,加入/swap swap swap default 0 02.查看操作系统信息[root@docker ~]# uname -mx86_64[root@docker ~]# cat /etc/redhat-releaseCentOS Linux release 7.1.1503 (Core)3.安装前的准备a.修改主机名,linux7以上系统用:hostnamectl set-hostname hostname4.关闭selinux:vi /etc/selinux/config,设置如下,重启系统reboot;5.检查以下服务是否安装binutils-2.23.52.0.1-12.el7.x86_64compat-libcap1-1.10-3.el7.x86_64compat-libstdc++-33-3.2.3-71.el7.i686compat-libstdc++-33-3.2.3-71.el7.x86_64 gcc-4.8.2-3.el7.x86_64gcc-c++-4.8.2-3.el7.x86_64glibc-2.17-36.el7.i686glibc-2.17-36.el7.x86_64glibc-devel-2.17-36.el7.i686glibc-devel-2.17-36.el7.x86_64kshlibaio-0.3.109-9.el7.i686libaio-0.3.109-9.el7.x86_64libaio-devel-0.3.109-9.el7.i686libaio-devel-0.3.109-9.el7.x86_64libgcc-4.8.2-3.el7.i686libgcc-4.8.2-3.el7.x86_64libstdc++-4.8.2-3.el7.i686libstdc++-4.8.2-3.el7.x86_64libstdc++-devel-4.8.2-3.el7.i686libstdc++-devel-4.8.2-3.el7.x86_64libXi-1.7.2-1.el7.i686libXi-1.7.2-1.el7.x86_64libXtst-1.2.2-1.el7.i686libXtst-1.2.2-1.el7.x86_64make-3.82-19.el7.x86_64sysstat-10.1.5-1.el7.x86_64unixODBC-2.3.1-6.el7.x86_64 or laterunixODBC-2.3.1-6.el7.i686 or laterunixODBC-devel-2.3.1-6.el7.x86_64 or laterunixODBC-devel-2.3.1-6.el7.i686 or later若担心系统包比较旧可考虑先更新程序包:yum -y upgrade,(提示:等待时间比较长!)用yum进行安装所需服务:yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*i686 compat-libstdc++-33*.devel compat-libstdc++-33 compat-libstdc++-33*.devel gcc gcc-c++ glibc glibc*.i686 glibc-devel glibc-devel*.i686 ksh libaio libaio*.i686 libaio-devel libaio-devel*.devel libgcc libgcc*.i686 libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.devel libXi libXi*.i686 libXtst libXtst*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686检查31个包是否都有安装,版本号只能大于规定的版本,不能小于rpm -q binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel[root@docker ~]# rpm -q binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-develbinutils-2.23.52.0.1-55.el7.x86_64 compat-libcap1-1.10-7.el7.x86_64 compat-libstdc++-33-3.2.3-72.el7.x86_64 compat-libstdc++-33-3.2.3-72.el7.i686 gcc-4.8.5-4.el7.x86_64gcc-c++-4.8.5-4.el7.x86_64glibc-2.17-106.el7_2.8.x86_64glibc-2.17-106.el7_2.8.i686glibc-devel-2.17-106.el7_2.8.x86_64 glibc-devel-2.17-106.el7_2.8.i686ksh-20120801-22.el7_1.3.x86_64libaio-0.3.109-13.el7.x86_64libaio-0.3.109-13.el7.i686libaio-devel-0.3.109-13.el7.x86_64 libaio-devel-0.3.109-13.el7.i686libgcc-4.8.5-4.el7.x86_64libgcc-4.8.5-4.el7.i686libstdc++-4.8.5-4.el7.x86_64libstdc++-4.8.5-4.el7.i686libstdc++-devel-4.8.5-4.el7.x86_64 libstdc++-devel-4.8.5-4.el7.i686libXi-1.7.2-2.1.el7.x86_64libXi-1.7.4-2.el7.i686libXtst-1.2.2-2.1.el7.x86_64libXtst-1.2.2-2.1.el7.i686make-3.82-21.el7.x86_64sysstat-10.1.5-7.el7.x86_64unixODBC-2.3.1-11.el7.x86_64unixODBC-2.3.1-11.el7.i686unixODBC-devel-2.3.1-11.el7.x86_64unixODBC-devel-2.3.1-11.el7.i6866.创建oinstall和dba组/usr/sbin/groupadd oinstall/usr/sbin/groupadd dba7.创建Oracle用户:/usr/sbin/useradd -g oinstall -G dba oracle设置oracle密码passwd oracle验证创建及所属组是否正确:id oracle[root@docker ~]# id oracleuid=1001(oracle) gid=1001(oinstall) groups=1001(oinstall),1002(dba) 8.配置内核参数[root@docker ~]# vim /etc/sysctl.conf# System default settings live in /usr/lib/sysctl.d/00-system.conf.# To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file## For more information, see sysctl.conf(5) and sysctl.d(5).fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 7516192768 #7Gkernel.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参数的值不能小于上面的配置,因为这是oracle官方建议的最小值,所以生产环境建议调整为这些参数,以优化系统性能。
oracle11grac静默安装+racADG部署搭建
oracle11grac静默安装+racADG部署搭建说明以下说描述的的安装rac是安装⼀个rac备端,只需要安装grid软件和oracle软件即可。
⼀、硬件配置:cup:Linux db51 3.10.0-1062.el7.x86_64 #1 SMP Wed Aug 7 18:08:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux内存:250GOCR:3G*3DATA:480G*6⼆、软件环境:操作系统:CentOS Linux release 7.7.1908 (Core)数据库:oracle 11.2.0.4 R2 RAC三、业务系统:业务系统四、主机规划:五、数据库安装前准备1、配置DNS内容(可忽略):vi /etc/resolv.confnameserver 192.168.3.1nameserver 192.168.3.22、改hosts⽂件节点⼀db51和节点⼆db52:#pub192.168.3.51 db51192.168.3.52 db52#vip192.168.3.54 db51-vip10.10.10.52 db52-vip#priv10.10.10.51 db51-priv192.168.3.55 db52-priv#scan172.16.53.56 db-scan3、关闭防⽕墙systemctl status firewalldsystemctl stop firewalldsystemctl disable firewalld4、关闭selinuxSetenforce 0vi /etc/sysconfig/selinux将SELINUX值改为disabled6、关闭透明⼤页==查看:cat /sys/kernel/mm/transparent_hugepage/enabled[always] madvise never默认为always。
Oracle11g单实例静默安装实战记录(linux)
Oracle11g单实例静默安装实战记录(linux)oracle 11g 单实例静默安装AUTHOR:Oracle_Ran环境规划:OS Version : Red Hat Enterprise Linux Server release 6.7 (Santiago)Oracle Version: 11.2.0.4操作系统环境配置可参考Oracle 单实例安装⽂档1、上传Oracle安装介质,进⼊解压⽬录,复制响应⽂件模板cd /home/oracle/mkdir rspcp /db/soft/database/response/* /home/oracle/rsp/su - rootchmod 700 /home/oracle/rsp/*.rspchown -R oracle:oinstall /home/oracle/rsp/2、修改响应⽂件相关参数vi /home/oracle/rsp/db_install.rsporacle.install.option=INSTALL_DB_SWONLY //安装类型ORACLE_HOSTNAME=hostname //主机名称UNIX_GROUP_NAME=oinstall //安装组INVENTORY_LOCATION=/db/oraInventory //INVENTORY⽬录SELECTED_LANGUAGES=en,zh_CN,AL32UTF8 //选择语⾔ORACLE_HOME=/db/oracle/product/11.2.0/db_1 //oracle_homeORACLE_BASE=/db/oracle //oracle_baseoracle.install.db.InstallEdition=EE //oracle版本oracle.install.db.isCustomInstall=true //⾃定义安装oracle.install.db.DBA_GROUP=dba //dba⽤户组oracle.install.db.OPER_GROUP=oinstall //oper⽤户组oracle.install.db.config.starterdb.type=GENERAL_PURPOSE //数据库类型oracle.install.db.config.starterdb.globalDBName=oadb //globalDBNameoracle.install.db.config.starterdb.SID=orcl //SIDoracle.install.db.config.starterdb.characterSet=AL32UTF8 //字符集oracle.install.db.config.starterdb.memoryLimit=512 //⾃动管理内存的最⼩内存(M)oracle.install.db.config.starterdb.password.ALL=oracle //设定所有数据库⽤户使⽤同⼀个密码DECLINE_SECURITY_UPDATES=true //设置安全更新3、静默安装数据库软件[oracle@template database]$ ./runInstaller -silent -force -responseFile /home/oracle/res/db_install.rsp【注意】安装过程中如果出现Fail,说明安装中断。
CentOS7.6静默(无图形化界面)安装Oracle11g
CentOS7.6静默(⽆图形化界⾯)安装Oracle11g⼀、准备⼯作1.准备CentOS 7 系统环境由于是使⽤静默模式(silent)安装的,⽆需使⽤图形化界⾯,我选择了最⼩安装的服务器版的CentOS 7。
安装完成后,只有命令⾏界⾯。
2.下载 Oracle 11g特别注意:11.2.0.2.0 zlinux64版本的Oracle是安装在IBM服务器的,CentOS 7是⽆法安装的。
(2)下载完成后,有两个压缩⽂件linux.x64_11gR2_database_1of2.zip 和 linux.x64_11gR2_database_2of2.zip3.通过Xftp将压缩⽂件上传到 /db/4.安装依赖包,安装依赖包之前,个⼈建议将yum源修改为aliyun源,下载速度快些,执⾏如下命令即可:cd /etcmv yum.repos.d yum.repos.d.bakmkdir yum.repos.dwget -O /etc/yum.repos.d/CentOS-Base.repo /repo/Centos-7.repoyum clean allyum makecache若提⽰:正在解析主机 ()... 失败:未知的名称或服务。
则执⾏:echo 'nameserver 8.8.8.8'>>/etc/resolv.conf5.修改成功后,安装如下依赖包:yum -y install 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 \pdksh \sysstat \unixODBC \unixODBC-devel6.安装完成后显⽰如下界⾯7.使⽤如下命令检查依赖是否安装完整rpm -q \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 \pdksh \sysstat \unixODBC \unixODBC-devel | grep"not installed"8.发现 pdksh 没有安装9.执⾏ yum -y install pdksh,发现CentOS 7 没有相关安装包可⽤10.通过wget命令直接下载pdksh的rpm包,我下载到了/tmp/wget -O /tmp/pdksh-5.2.14-37.el5_8.1.x86_64.rpm /5.11/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm 下载完成后,进⼊ /tmp/cd /tmp/rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm11.再次检查依赖包是否安装完整rpm -q \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 \pdksh \sysstat \unixODBC \unixODBC-devel | grep"not installed"到此依赖包安装完整12.添加oracle⽤户组和⽤户groupadd oinstallgroupadd dbagroupadd asmadmingroupadd asmdbauseradd -g oinstall -G dba,asmdba oracle -d /home/oracle13.添加完成后,查看oracle⽤户id oracle14.初始化oracle⽤户的密码passwd oracle说明:密码需输⼊两次,提⽰密码强度若不⽤管,两次⼀致后会提⽰设置成功15.配置hostname(本机IP映射)vim /etc/hosts192.168.154.154 centos-oracle16.测试hostnameping -c 3 centos-oracle17.优化OS内核参数,kernel.shmmax 参数设置为物理内存的⼀半vim /etc/sysctl.conffs.aio-max-nr=1048576fs.file-max=6815744kernel.shmall=2097152kernel.shmmni=4096kernel.shmmax = 1073741824kernel.sem=25032000100128net.ipv4.ip_local_port_range=900065500net.core.rmem_default=262144net.core.rmem_max=4194304net.core.wmem_default=262144net.core.wmem_max=104858618.使参数⽣效sysctl -p19.限制oracle⽤户的shell权限vim /etc/security/limits.conforacle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536vim /etc/pam.d/loginsession required /lib64/security/pam_limits.sosession required pam_limits.sovim /etc/profileif [ $USER = "oracle" ]; thenif [ $SHELL = "/bin/ksh" ]; thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fifi20.创建oracle安装⽬录mkdir -p /db/app/oracle/product/11.2.0mkdir /db/app/oracle/oradatamkdir /db/app/oracle/inventorymkdir /db/app/oracle/fast_recovery_areachown -R oracle:oinstall /db/app/oraclechmod -R 775 /db/app/oracle21.配置oracle⽤户环境变量su - oraclevim .bash_profileumask 022export ORACLE_HOSTNAME=centos-oracleexport ORACLE_BASE=/db/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/export ORACLE_SID=ORCLexport PATH=.:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/jdk/bin:$PATH export LC_ALL="en_US"export LANG="en_US"export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK"export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"22.以上配置完成后,个⼈建议重启下系统reboot23.解压oracle压缩⽂件到 /dbcd /db/unzip linux.x64_11gR2_database_1of2.zip -d /dbunzip linux.x64_11gR2_database_2of2.zip -d /db24.解压完成后mkdir /db/etc/cp /db/database/response/* /db/etc/vim /db/etc/db_install.rsporacle.install.option=INSTALL_DB_SWONLYDECLINE_SECURITY_UPDATES=trueUNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/db/app/oracle/inventorySELECTED_LANGUAGES=en,zh_CNORACLE_HOSTNAME=centos-oracleORACLE_HOME=/db/app/oracle/product/11.2.0ORACLE_BASE=/db/app/oracleoracle.install.db.InstallEdition=EEoracle.install.db.isCustomInstall=trueoracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=dba⼆、开始安装1.切换到oracle⽤户su - oracle# 先cd到/db/database/⽬录然后执⾏./runInstaller -silent -ignorePrereq -responseFile /db/etc/db_install.rsp报错:centos 安装oracle 报Checking swap space: 0 MB available, 150 MB required. Failed <<<<【备注:若⽆此错误请忽略,我在华为云服务器挂载磁盘且安装位置设置为/mnt⽬录,此情景下安装oracle 11g时发送这样的错误,⼀般情况不会出现此错误】解决办法:(1)检查 Swap 空间在设置 Swap ⽂件之前,有必要先检查⼀下系统⾥有没有既存的 Swap ⽂件。
Linux下静默安装Oracle11gRAC
Linux下静默安装Oracle11gRACtitle: Linux下静默安装Oracle 11g RACcategories: 数据库tags:- RAC- Cluster- HA- Oracletimezone: Asia/Shanghaidate: 2019-01-06环境# Red Hat Enterprise Linux Server release 6.10.x86_64 (Santiago)# Oracle Linux 7.5 x86_64p1*******_112040_Linux-x86-64_1of7.zipp1*******_112040_Linux-x86-64_2of7.zipp1*******_112040_Linux-x86-64_3of7.zip注意事项1.主机名都用小写字母,长度不能超过15位,不要有特殊符号2.两个节点的Plublic和VIP所在网卡的网卡名要一样3.表决盘应该都是相同的大小。
不同的大小可能导致可用性降低。
第一步:规划IP地址和主机名1.IP地址规划节点hostname 类型IP地址接口备注1 rac1 Plublic IP 10.0.1.131 eth0 手动设置2 rac2 Plublic IP 10.0.1.132 eth0 手动设置1 rac1-vip Virtaual IP 10.0.1.133 eth0 集群自动设置2 rac2-vip Virtaual IP 10.0.1.134 eth0 集群自动设置Cluster rac-scan SCAN IP 10.0.1.135 eth0 集群自动设置1 rac1-priv Private IP 11.11.11.131 eth1 手动设置2 rac2-priv Private IP 11.11.11.132 eth1 手动设置2.在两个节点分别将Plublic IP和Private IP写入(by all)只需要手动在两个节点上设置静态IP地址即可。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/JRE/lib
修改后,使设置生效
/sbin/sysctl -p
6.修改用户限制
在/etc/etc/limits.conf 文件中,使用文本编辑器或vi命令增加或修改以下参数
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
su - oracle
vi ~/.bash_profile
在最后加上以下内容
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin
UNIX_GROUP_NAME=oinstall //42 行 安装组
INVENTORY_LOCATION=/home/u01/app/oracle/oraInventory //47 行 INVENTORY目录
SELECTED_LANGUAGES=en,zh_CN,zh_TW //78 行 选择语言
8.创建/etc/oraInst.loc文件,内容如下
nventory_loc=/home/u01/app/oracle/oraInventory
inst_group=oinstall
更改文件的权限
chown oracle:oinstall /etc/oraInst.loc
chmod 664 /etc/oraInst.loc
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
GDBNAME="orcl.java-linux-test" //78 行 全局数据库的名字=SID+主机域名
SID="orcl" //149行 SID
CHARACTERSET="AL32UTF8" //415行 编码(GBK填ZHS16GBK)
NATIONALCHARACTERSET="UTF8" //425行 编码(GBK填ZHS16GBK)
ORACLE_HOME=/home/u01/app/oracle/product/11.2.0/db_1 //83 行 oracle_home
ORACLE_BASE=/home/u01/app/oracle //88 行 oracle_base
oracle.install.db.InstallEdition=EE //99 行 oracle版本
oracle.install.db.isCustomInstall=true //108行 自定义安装
oracle.install.db.DBA_GROUP=dba //142行 dba用户组
oracle.install.db.OPER_GROUP=oinstall //147行 oper用户组
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
4. Return to this window and hit "Enter" key to continue
Successfully Setup Software.
使设置生效
source /home/oracle/.bash_profile
检查环境变量:
env
10.解压oracle安装文件
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
oracle hard nofile 65536
oracle soft stack 10240
在/etc/pam.d/login 文件中,使用文本编辑器或vi命令增加或修改以下内容
session required /lib/security/pam_limits.so
session required pam_limits.so
fi
fi
使设置生效
source /etc/profile
7.创建安装目录(可根据情况,选择比较多空间的目录创建)
mkdir -p /home/u01/app/
chown -R oracle:oinstall /home/u01/app/
chmod -R 775 /home/u01/app/
在/etc/profile 文件中,使用文本编辑器或vi命令增加或修改以下内容
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE //160行 数据库类型
oracle.install.db.config.starterdb.globalDBName=orcl //165行 globalDBName
oracle.install.db.config.starterdb.SID=orcl //170行 SID
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
使设置生效
source /home/oracle/.bash_profile
13.静默配置网络
$ORACLE_HOME/bin/netca /silent /responseFile /home/oracle/etc/netca.rsp
14.静默安装数据库
修改仅安装数据库的响应文件/home/oracle/etc/dbca.rsp
#-------------------------------------------------------------------
使用root用户执行root.sh
su root
/home/u01/app/oracle/product/11.2.0/db_1/root.sh
增加oracle环境变量
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
DECLINE_SECURITY_UPDATES=true //385行 设置安全更新(不设置为true安装时会卡在邮箱那里)
进行静默安装Oracle软件
cd database
./runInstaller -silent -force -responseFile /home/oracle/etc/db_install.rsp
su - oracle
修改安装Oracle软件的响应文件/home/oracle/etc/db_install.rsp
oracle.install.option=INSTALL_DB_SWONLY //29 行 安装类型
ORACLE_HOSTNAME=java-linux-test //37 行 主机名称
export LIBPATH=${CLASSPATH}:$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib
export ORACLE_OWNER=oracle
export SPFILE_PATH=$ORACLE_HOME/dbs
export ORA_NLS10=$ORACLE_HOME/nls/data
4.创建所需的操作系统组和用户
groupadd oinstall
groupadd dba
useradd -g stall -G dba oracle
设置oracle用户密码
passwd oracle
5.修改内核参数
在/sbin/sysctl.conf 文件中,使用文本编辑器或vi命令增加或修改以下参数
oracle.install.db.config.starterdb.memoryLimit=512 //200行 自动管理内存的最小内存(M)