静默安装ORACLE及实例
教你如何静默安装ORACLE
教你如何静默安装ORACLE由于本次的实验我是将上次的虚拟机直接拷贝过来,然后将⾥⾯图形化界⾯安装好了的oracle给删除,再次重新安装,所以这⾥要修改⼀些配置。
⾸先修改的是我们的IP地址# system-config-network完成后我们修改⼀下hosts⽂件,将⾥⾯的ip地址给修改⼀下# vi /etc/hosts接着我们删除上次安装过的ORACLE⽂件# cd $ORACLE_BASE# ls# rm -rf *进⼊root:rm -rf /etc/ora*还是在安装前进⾏配置。
接下来进⾏静默安装。
⾸先我们先要创建⼀个相应⽂件,这个⽂件⾥记录了我们oracle安装的所有过程[oracle@oracle ~]$ cd /u01/database/response$ cp enterprise.rsp /u01$ vi /u01/enterprise.rsp修改⼀下内容:35 UNIX_GROUP_NAME=\"oinstall\"62 ORACLE_HOME=\"/u01/app/oracle/10.2.0/db_1\"70 ORACLE_HOME_NAME=\"OraDbHome1\"351 COMPONENT_LANGUAGES={\"en,zh_CN\"}384 s_nameForDBAGrp=\"dba\"392 s_nameForOPERGrp=\"oper\"422 n_configurationOption=3开始安装:[oracle@oracle ~]$ cd /u01/database$ ./runInstaller -silent -responseFile /u01/enterprise.rsp安装完成后执⾏以下脚本$ORACLE_BASE/oraInventory/orainstRoot.sh$ORACLE_HOME/root.sh执⾏完脚本以后使⽤:sqlplus / as sysdba即可知道oracle的版本为:10.2.0.1.0静默升级数据库$ cp /u01/Disk1/response/patchset.rsp /u01vi /u01/patchset.rsp编辑如下⾏:45 UNIX_GROUP_NAME=\"oinstall\"87 ORACLE_HOME=\"/u01/app/oracle/10.2.0/db_1\"99 ORACLE_HOME_NAME=\"OraDbHome1\"533 MYORACLESUPPORT_USERNAME=\"zhaoming@\"542 MYORACLESUPPORT_PASSWORD=\"b\"603 DECLINE_SECURITY_UPDATES=true进⾏安装升级的补丁$ ./runInstaller -silent -responseFile /u01/patchset.rsp升级成功$ sqlplus / as sysdba;Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options接下来进⾏⼿⼯建库$ vi $ORACLE_HOME/dbs/initorcl.ora写⼊以下内容:compatible=10.2.0.5instance_name=orcldb_name=orclsga_target=500Msga_max_size=500Mjob_queue_processes=10undo_management=autoundo_tablespace=undotbsaudit_file_dest=$ORACLE_BASE/admin/orcl/adumpbackground_dump_dest=$ORACLE_BASE/admin/orcl/bdumpcore_dump_dest=$ORACLE_BASE/admin/orcl/cdumpuser_dump_dest=$ORACLE_BASE/admin/orcl/udumpcontrol_files=\'/u01/app/oracle/oradata/orcl/control01.ctl\',\'/u01/app/oracle/oradata/orcl/control02.ctl\'保存退出创建跟踪⽬录:mkdir -p $ORACLE_BASE/admin/orcl/{a,b,c,u}dump创建控制⽂件的位置mkdir -p /u01/app/oracle/oradata/orcl/启动到实例:sqlplus / as sysdbacreate spfile from pfile;startup nomount接下来进⾏创建数据库vi createdb.sql写⼊如下内容:CREATE DATABASE orclUSER SYS IDENTIFIED BY a ---这⾥需要修改你的密码USER SYSTEM IDENTIFIED BY aLOGFILE GROUP 1 (\'/u01/app/oracle/oradata/orcl/redo01.log\') SIZE 50M,GROUP 2 (\'/u01/app/oracle/oradata/orcl/redo02.log\') SIZE 50M,GROUP 3 (\'/u01/app/oracle/oradata/orcl/redo03.log\') SIZE 50MMAXLOGFILES 5MAXLOGMEMBERS 5MAXLOGHISTORY 1MAXDATAFILES 100MAXINSTANCES 1CHARACTER SET utf8NATIONAL CHARACTER SET utf8DATAFILE \'/u01/app/oracle/oradata/orcl/system01.dbf\' SIZE 325M REUSEEXTENT MANAGEMENT LOCALSYSAUX DATAFILE \'/u01/app/oracle/oradata/orcl/sysaux01.dbf\' SIZE 325M REUSEDEFAULT TABLESPACE users datafile \'/u01/app/oracle/oradata/orcl/users01.dbf\' size 200MDEFAULT TEMPORARY TABLESPACE tempTEMPFILE \'/u01/app/oracle/oradata/orcl/temp01.dbf\'SIZE 20M REUSEUNDO TABLESPACE undotbsDATAFILE \'/u01/app/oracle/oradata/orcl/undotbs01.dbf\'SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED/然后在sql中引⽤到这些脚本sql> get /u01/create.sql ---解释⼀下get的作⽤:就是引⽤操作系统⽬录下的任意⼀个⽂件引⼊到sql中来。
静默安装ORACLE及实例
(DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = GS-NMS-WEB01)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)) )
export PATH=${PATH}:$ORACLE_HOME/bin
start() {
daemon --user $ORACLE $ORACLE_HOME/bin/dbstart daemon --user $ORACLE "$ORACLE_HOME_LISTNER/bin/lsnrctl start" }
PS:问题同上,不知道影响在哪里。
4、安装数据库实例。
编辑 Oracle 安装目录里 response 子目录下的应答文件 dbca.rsp,修改以下项 目。 GDBNAME 数据库全局名称 SID 数据库的 SID SYSPASSWORD SYS 用户的初始密码 SYSTEMPASSWORD SYSTEM 用户的初始密码 CHARACTERSET 数据库字符集(中文为 ZHS16GBK) NATIONALCHARACTERSET 数据库国家字符集
2、安装网络监听器。没有网络监听器,客户端就无法通过网络连接 Oralce 服务 器。要在命令行安装网络监听器,也只能使用静默模式。 编辑 Oracle 安装目录里 response 子目录下的应答文件 netca.rsp,修改以下项 目。
Hale Waihona Puke INSTALL_TYPE=""custom"" 安装的类型 LISTENER_NUMBER=1 监听器数量 LISTENER_NAMES={"LISTENER"} 监听器的名称列表 LISTENER_PROTOCOLS={"TCP;1521"} 监听器使用的通讯协议列表 LISTENER_START=""LISTENER"" 监听器启动的名称 然后运行 $ORACLE_HOME/bin/netca /silent /responseFile <应答文件的绝对路径>
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其值大于要求的值可以不做修改,修改需要修改的参数。
无图形界面情况下静默安装oracle
无图形界面情况下静默安装oracle如果Server段没有安装X界面,如何来安装Oracle呢?我们可以使用Oracle提供的静默安装来实现提示符下的Oracle安装。
安装前的系统环境变量及内核参数的设置这里就不重复了,可以查看安装光盘中的安装文档。
假设Oracle安装文件已经解压至/u02 。
su - oraclemkdir -p /u01/app/oracle/1. 建立静默安装的配置文件cd /u02/database/responsevi enterprise01.rspRESPONSEFILE_VERSION=2.2.1.0.0FROM_LOCATION="../stage/products.xml"ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_1/"ORACLE_HOME_NAME="OraDb10g_home1"TOPLEVEL_COMPONENT={"racle.server","10.2.0.1.0"}DEINSTALL_LIST={"racle.server","10.2.0.1.0"}SHOW_SPLASH_SCREEN=falseSHOW_WELCOME_PAGE=falseSHOW_COMPONENT_LOCATIONS_PAGE=falseSHOW_CUSTOM_TREE_PAGE=falseSHOW_SUMMARY_PAGE=falseSHOW_INSTALL_PROGRESS_PAGE=falseSHOW_REQUIRED_CONFIG_TOOL_PAGE=falseSHOW_CONFIG_TOOL_PAGE=falseSHOW_RELEASE_NOTES=falseSHOW_ROOTSH_CONFIRMATION=falseSHOW_END_SESSION_PAGE=falseSHOW_EXIT_CONFIRMATION=falseNEXT_SESSION=falseNEXT_SESSION_ON_FAIL=falseSHOW_DEINSTALL_CONFIRMATION=falseSHOW_DEINSTALL_PROGRESS=falseACCEPT_LICENSE_AGREEMENT=trueCOMPONENT_LANGUAGES={"en"}CLUSTER_NODES=INSTALL_TYPE="EE"s_nameForDBAGrp=dbas_nameForOPERGrp=dbab_oneClick=falseSHOW_DATABASE_CONFIGURATION_PAGE=falseb_createStarterDB=false相关属性的值的意义,请参考Oracle提供的enterprise.rsp文档中的说明。
oracle静默安装(sucess)
在很多企业级安装数据库时,常常有大规模的安装任务,这时使用响应文件来批量安装可以提高工作效率,下面介绍数据库软件的静默安装方式。
一、数据库服务器端安装1. 生成安装响应文件$./runInstaller -record -destinationFile /tmp/install_database_10g.rsp这时会启动图形界面来录制我们需要的响应文件。
注意:当安装界面到达最后一步时选择cancel得到这个响应文件我们就可以静默安装oracle了install_database.rsp文件是由很多参数组成的,并且有详细的说明:一般我们需要注意的参数有:2 .修改响应文件的相关参数UNIX_GROUP_NAME="oinstall" ----安装用户组FROM_LOCATION="/software/db/10g/Disk1/stage/products.xml" –-安装源文件地址ORACLE_HOME="/u01/oracle/product/db10gr2" ---ORACLE_HOMEORACLE_HOME_NAME="db10gr2" ---- ORACLE_HOME_NAMESELECTED_LANGUAGES={"en","zh_CN","zh_TW"} ----语言COMPONENT_LANGUAGES={"en","zh_CN","zh_TW"} ----语言INSTALL_TYPE="Enterprise Edition" --企业版3.静默安装数据库软件$./runInstaller -silent -responseFile /tmp/install_database_10g.rsp4. 静默升级解压oracle升级包,在response目录下有patchset.rsp相应文件,修改相应的参数:UNIX_GROUP_NAME="oinstall" ----安装用户组FROM_LOCATION="/software/db/10g/patch/Disk1/stage/products.xml" –-升级源文件地址ORACLE_HOME="/u01/oracle/product/db10gr2" ---ORACLE_HOMEORACLE_HOME_NAME="db10gr2" ---- ORACLE_HOME_NAMECOMPONENT_LANGUAGES={"en","zh_CN","zh_TW"} ----语言然后再执行./runInstaller -silent -responseFile ./patchset.rsp二、数据库客户端安装软件1.生成响应文件$./runInstaller -record -destinationFile /tmp/install_database10g_clt.rsp这时会启动图形界面来录制我们需要的响应文件。
静默方式(silent)安装Oracle软件的实际操作
静默方式(silent)安装Oracle软件的实际操作如果你在静默方式(silent)安装Oracle软件的实际操作中,你对静默方式(silent)安装Oracle软件有不解之处时,你可以通过以下的文章对其的实际应用与功能有所了解,以下是文章的具体介绍,望你浏览完以下的内容会有所收获。
有的时候不方便登陆Linux/Unix的图形界面安装数据库,且GUI 方式安装让我们无法知道具体是做了什么操作,我们完全可以采用命令模式安装和删除Oracle软件(代替OUI)、建立和删除数库库(代替dbca)。
平台:RHEL4.5,Oracle10.2.0.11、上传并解压Oracle软件,假如放在/home目录下1.$ cd /home2.$ unzip 10201_database_linux32.zip2、设置安装Oracle软件必须的操作系统信息,如组、用户、系统内核参数、目录、用户初始化参数等增加组和用户1.# groupadd oinstall2.# groupadd dba3.# useradd -g oinstall -G dba Oracle4.# passwd Oracle修改系统内核参数1.# vi /etc/sysctl.conf2.kernel.shmall = 20971523.kernel.shmmax = 21474836484.kernel.shmmni = 40965.kernel.sem = 250 32000 100 1286.fs.file-max = 65536/doc/fa16745303.html,.ipv4.ip_local_p ort_range = 1024 65000/doc/fa16745303.html,.core.rmem_de fault = 1048576/doc/fa16745303.html,.core.rmem_ma x = 1048576/doc/fa16745303.html,.core.wmem_d efault = 262144/doc/fa16745303.html,.core.wmem_m ax = 262144/sbin/sysctl -p (修改以后让参数生效)为了提升性能增加Oracle用户的shell限制1.# vi /etc/security/limits.conf2.Oracle soft nproc 20473.Oracle hard nproc 163844.Oracle soft nofile 10245.Oracle hard nofile 655366.# vi /etc/pam.d/login7.session required /lib/security/pam_limits.so8.session required pam_limits.so9.# vi /etc/profile10.if [ $USER = "Oracle" ]; then11.if [ $SHELL = "/bin/bash" ]; then12.ulimit -p 1638413.ulimit -n 6553614.else15.ulimit -u 16384 -n 6553616.fi17.fi18.# vi /etc/selinux/config (使安全linux标志失效)19.SELINUX=disabled建立Oracle_BASE目录1.# mkdir -p /opt/Oracle2.# chown -R Oracle:oinstall /opt/Oracle3.# chmod -R 775 /opt/OracleOracle用户的.bash_profile文件设置1.# su - Oracle2.$ vi ~/.bash_profile3.umask 0224.export Oracle_BASE=/opt/Oracle5.export Oracle_HOME=/opt/Oracle/product/10.2.0/db_16.export Oracle_SID=WENDING7.export PATH=$Oracle_HOME/bin:$PATH8.$ . ~/.bash_profile3、建立oraInst.loc文件1.$ su -2.# vi /etc/oraInst.loc (加入或修改以下内容,其中/opt/Oracle 是Oracle_BASE)3.inventory_loc=/opt/Oracle/oraInventory4.inst_group=oinstall5.# chmod 664 /etc/oraInst.loc4、建立response文件(在解压后Oracle软件的response目录里有各种响应文件的模版)1.# su - Oracle2.$ cd /home/database/response3.$ cp enterprise.rsp enterprise_temp.rsp4.$ vi enterprise_temp.rsp (以下参数必需设置)5.UNIX_GROUP_NAME="oinstall"6.Oracle_HOME="/opt/Oracle/product/10.2.0/db_1"7.Oracle_HOME_NAME="OraDb10g_home1"8.s_nameForDBAGrp="dba"9.s_nameForDBAGrp="dba"10.n_configurationOption=35、通过response文件运行OUI(-noconfig表示不运行配置助手只装软件)1.$ cd /home/database2.$ ./runInstaller -silent -noconfig -responseFile /home/database/response/enterprise_temp.rsp安装结束后,以root用户执行$Oracle_HOME下的root.sh:1.$ su -2.# /opt/Oracle/product/10.2.0/db_1/root.sh3.# exit6、通过response文件运行NetCA1.$ cd /home/database/response2.$ cp netca.rsp netca_temp.rsp3.$ vi netca_temp.rsp (如果要修改监听名或端口在此编辑,一般什么都不用修改)4.$ $Oracle_HOME/bin/netca /silent /responsefile/home/database/response/netca_temp.rsp执行完后,监听就已经启动了。
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。
Linux下Oracle的静默安装
在某些特殊的情况下,如因为网络或者X配置的关系无法连接到X server或者主机上没有X,就可以使用静默安装的方式安装数据库,同样如果需要大规模部署,则静默安装将会大大减轻DBA的重复劳动力,而且静默安装不需要X,从安装效率及资源占用上都比图形化OUI的方式有优势。
1、静默安装Oracle软件Oracle的静默安装需要用到一个response文件,这个文件可以通过事先使用OUI录制:执行以下命令,然后在OUI中根据提示执行安装数据库软件的操作1.$./runInstaller –record –destinationFile /tmp/install_database.rsp注意:(1)录制过程中选择只安装数据库软件不创建数据库(2)当安装界面到达最后一步时选择cancel录制成功后,就可以使用产生的响应文件回放整个安装过程了:(1)执行以下命令静默安装Oracle数据库软件1.$./runInstaller –silent –responseFile /tmp/install_database.rsp(2)安装完成后执行以下脚本1.#. $ORACLE_BASE/oraInventory/orainstRoot.sh2.#. $ORACLE_HOME/root.sh注意:如果OUI在静默安装时产生错误(类似OUI-10037等错误),则静默安装会中止,出现这种情况请检查相关目录权限及用户、组是否已经创建;如果PrereqChecks阶段有些要求没有满足,OUI默认会忽略而继续安装(没有配置内核参数和物理内存不足,缺包情况没有实验),所以建议在静默安装之前先做检查以免安装出现失败。
2、DBCA静默安装数据库用DBCA创建一个种子数据库:(1) 创建初始数据库的时候选择Custom Database模板(2) 建议使用File System存储机制(3) 数据文件的存放地点建议选择e Oracle-Managed Files2.Database Area: {ORACLE_BASE}/oradata(4) 内存建议选择Custom,指定SGA和PGA大小(5) 字符集根据实际需要设定(6) 数据库创建选项里面选择Create Database(7) 创建应用程序需要的表空间和用户,导入初始数据用DBCA根据种子数据库创建一个模板:(1) 启动DBCA,选择Manage Templates(2) 按照提示创建一个模板,创建后的模板文件:$ORACLE_HOME/assistants/dbca/templates/{模板名.dbc}将Oracle DB安装盘里面response目录下的dbca.rsp拷贝到本机上修改dbca.rsp文件,将模板名和DB名添加进去GDBNAME=orcl1SID=orcl1TEMPLATENAME=orcl.dbc{为了方便,将模板文件拷贝到dbca.rsp相同目录下}如果需要使用Oracle Enterprise Manager,则还需要修改以下参数如下:1.EMCONFIGURATION=”LOCAL”2.SYSMANPASSWORD=”password”3.DBSNMPPASSWORD=”password”执行以下命令使用DBCA根据模板创建新数据库$./dbca –silent –createdatabase –responseFile /home/oracle/dbca.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>。
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: 指定的节点上未安装必需的程序包; 或者如果该程序包是内核模块, 则未加载该程序包。
linux 下oracle静默安装教程(实践总结可用)
修改操作系统核心参数在Root用户下执行以下步骤:1)修改用户的SHELL的限制,修改/etc/security/limits.conf文件输入命令:vi /etc/security/limits.conf,按i键进入编辑模式,将下列内容加入该文件。
oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536编辑完成后按Esc键,输入“:wq”存盘退出2)修改/etc/pam.d/login 文件,输入命令:vi /etc/pam.d/login,按i键进入编辑模式,将下列内容加入该文件session required /lib/security/pam_limits.sosession required pam_limits.so编辑完成后按Esc键,输入“:wq”存盘退出3)修改linux内核,修改/etc/sysctl.conf文件,输入命令: vi /etc/sysctl.conf,按i键进入编辑模式,将下列内容加入该文件fs.file-max = 6815744fs.aio-max-nr = 1048576kernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 4194304net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576编辑完成后按Esc键,输入“:wq”存盘退出4)要使/etc/sysctl.conf 更改立即生效,执行以下命令。
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,说明安装中断。
Oracle19c(19.3)单机数据库静默安装
Oracle19c(19.3)单机数据库静默安装⼀、环境介绍操作系统Red Hat Enterprise Linux Serverrelease 7.7 (Maipo)数据库版本Oracle database 19.3主机名adg19cIP地址192.168.84.99安装⽬录/DBSoft/oracle/product/19.3/dbhome_1数据库名称woo字符集AL32UTF8⼆、环境准备2.1. 关闭防⽕墙1 2 3 4[root@adg19c ~]# systemctl stop firewalld[root@adg19c ~]# systemctl disable firewalldRemoved symlink/etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.2.2. 禁⽤NetworkManager服务1 2[root@adg19c ~]# systemctl stop NetworkManager [root@adg19c ~]# systemctl disable NetworkManager2.3. 禁⽤SELINUX1 2 3[root@adg19c ~]# setenforce 0setenforce: SELinux is disabled[root@adg19c ~]# sed -i "/^SELINUX=/s#enforcing#disabled#" /etc/selinux/config2.4. 配置HOSTS解析1 2 3 4[root@adg19c ~]# cat >> /etc/hosts <<EOF 192.168.84.99 adg19cEOF2.5. 修改主机名1 2[root@adg19c ~]#sed -i 's#^HOSTNAME=.*$#HOSTNAME=db01#' /etc/sysconfig/network[root@adg19c ~]# sed -i 's#^NETWORKING_IPV6=.*$#NETWORKING_IPV6=no#' /etc/sysconfig/network2.6. 配置NOZEROCONFIG1 2 3[root@adg19c ~]# cat >> /etc/sysconfig/network <<EOF NOZEROCONF=yesEOF2.7. 创建组和⽤户12 3 4 5 6 7 8 9 10 11 12 13 14 15# 创建dba和onstall两个⽤户组[root@adg19c ~]# groupadd -g 501 dba[root@adg19c ~]# groupadd -g 502 oinstall[root@adg19c ~]# groupadd -g 503 backupdba[root@adg19c ~]# groupadd -g 504 dgdba[root@adg19c ~]# groupadd -g 505 kmdba[root@adg19c ~]# groupadd -g 506 racdba# 创建oracle⽤户[root@adg19c ~]# useradd -u 503 -g oinstall -G dba,backupdba,dgdba,kmdba,racdba oracle # 配置oracle⽤户密码[root@adg19c ~]# echo "oracle"|passwd --stdin oracleChanging password for user oracle.passwd: all authentication tokens updated successfully.2.8. 创建安装⽬录并赋权1 2 3 4 5 6 7# 创建⽬录[root@adg19c ~]# mkdir -p /DBSoft/oraInventory[root@adg19c ~]# mkdir -p /DBSoft/oracle/product/19.3/dbhome_1 # 赋权[root@adg19c ~]# chown -R oracle:oinstall /DBSoft[root@adg19c ~]# chmod -R 775 /DBSoft2.9. 配置⽤户环境变量1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20[root@adg19c ~]# cat >> /home/oracle/.bash_profile <<EOFexport TMP=/tmpexport TMPDIR=\$TMPexport EDIT=vialias vi=vimexport ORACLE_HOSTNAME=$HOST_NAMEexport ORACLE_UNQNAME=wooexport ORACLE_BASE=/DBSoft/oracleexport ORACLE_HOME=\$ORACLE_BASE/product/19.3/dbhome_1export ORACLE_SID=wooexport ORACLE_TERM=xtermexport PATH=/usr/sbin:\$PATHexport PATH=\$ORACLE_HOME/bin:\$PATHexport LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/libexport CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib export NLS_LANG=AMERICAN_AMERICA AL32UTF16umask022EOF[root@adg19c ~]# source /home/oracle/.bash_profile2.10. 配置系统环境变量1 2 3 4 5 6 7 8 9 10 11 12[root@adg19c ~]#cat >> /etc/profile <<EOF if[ \$USER = "oracle"]; thenif[ \$SHELL = "/bin/ksh"]; thenulimit-p 16384ulimit-n 65536elseulimit-u 16384 -n 65536fifiEOF[root@adg19c ~]# source /etc/profile2.11. 修改系统内核参数1 2 3 45 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46[root@adg19c ~]# cat >> /etc/sysctl.conf <<EOFkernel.shmall = 4294967296kernel.sem = 5130 65280 510 256kernel.shmmni = 4096kernel.shmmax = 549755813888 #support max TotalMemory 512GB net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 1048576net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576fs.file-max = 6815744fs.aio-max-nr = 1048576vm.swappiness = 10vm.dirty_background_ratio = 20vm.dirty_ratio = 80vm.dirty_expire_centisecs = 500vm.dirty_writeback_centisecs = 100net.ipv4.tcp_sack = 0net.ipv4.tcp_timestamps = 0net.ipv4.conf.default.rp_filter = 0net.ipv4.tcp_wmem = 262144net.ipv4.tcp_rmem = 4194304EOF[root@adg19c ~]# /sbin/sysctl -pkernel.shmall = 4294967296kernel.sem = 5130 65280 510 256kernel.shmmni = 4096kernel.shmmax = 549755813888 #support max TotalMemory 512GB net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 1048576net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576fs.file-max = 6815744fs.aio-max-nr = 1048576vm.swappiness = 10vm.dirty_background_ratio = 20vm.dirty_ratio = 80vm.dirty_expire_centisecs = 500vm.dirty_writeback_centisecs = 100net.ipv4.tcp_sack = 0net.ipv4.tcp_timestamps = 0net.ipv4.conf.default.rp_filter = 0net.ipv4.tcp_wmem = 262144net.ipv4.tcp_rmem = 41943042.12. 配置LIMITS限制参数1 2 3 4 5 6 7 8 9[root@adg19c ~]# cat >> /etc/security/limits.conf <<EOF oracle soft nproc 16384oracle hard nproc 16384oracle soft nofile 65536oracle hard nofile 65536oracle soft memlock 3145728oracle hard memlock 3145728EOF2.13. 配置PAM验证1 2 3[root@adg19c ~]# cat >> /etc/pam.d/login <<EOF session required /lib64/security/pam_limits.so EOF2.14. 安装依赖包2.13.1 挂载系统介质1 2[root@adg19c ~]# mount /dev/sr0 /mnt/mount: /dev/sr0is write-protected, mounting read-only2.13.2 配置yum包123 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24[root@adg19c ~]# cat > /etc/yum.repos.d/local.repo <<EOF[base]name=basebaseurl=file:///mntenabled=1gpgcheck=0multilib_policy=allEOF[root@adg19c ~]# yum clean allLoaded plugins: product-id, search-disabled-repos, subscription-managerThis system is not registered with an entitlement server. You can use subscription-manager to register. Cleaning repos: base[root@adg19c ~]# yum makecacheLoaded plugins: product-id, search-disabled-repos, subscription-managerThis system is not registered with an entitlement server. You can use subscription-manager to register. base | 2.8 kB 00:00:00(1/4): base/group_gz| 103 kB 00:00:00 (2/4): base/primary| 2.0 MB 00:00:00 (3/4): base/filelists| 3.1 MB 00:00:00 (4/4): base/other| 1.1 MB 00:00:00 base 5229/5229base 5229/5229base 5229/5229 Metadata Cache Created2.13.3 安装依赖包123456789101112131415161718 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39[root@adg19c ~]# yum install -y bc binutils compat-libcap1 compat-libstdc++ elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc++ libstdc++-devel libxcb make net-tools nfs-utils python python-configshell python-rtslib python-six targetcli smartmontools sysstat unzip vimLoaded plugins: product-id, search-disabled-repos, subscription-managerThis system is not registered with an entitlement server. You can use subscription-manager to register.base | 2.8 kB 00:00:00(1/2): base/group_gz| 103 kB 00:00:00(2/2): base/primary| 2.0 MB 00:00:00base 5229/5229Package binutils-2.27-41.base.el7.x86_64 already installed and latest versionNo package compat-libstdc++ available.Package elfutils-libelf-0.176-2.el7.x86_64 already installed and latest versionPackage glibc-2.17-292.el7.x86_64 already installed and latest versionPackage libaio-0.3.109-13.el7.x86_64 already installed and latest versionPackage libgcc-4.8.5-39.el7.x86_64 already installed and latest versionPackage libstdc++-4.8.5-39.el7.x86_64 already installed and latest versionPackage 1:make-3.82-24.el7.x86_64 already installed and latest versionPackage python-2.7.5-86.el7.x86_64 already installed and latest versionPackage python-six-1.9.0-2.el7.noarch already installed and latest versionResolving Dependencies--> Running transaction check---> Package bc.x86_64 0:1.06.95-13.el7 will be installed---> Package compat-libcap1.x86_64 0:1.10-7.el7 will be installed---> Package elfutils-libelf-devel.x86_64 0:0.176-2.el7 will be installed--> Processing Dependency: pkgconfig(zlib) for package: elfutils-libelf-devel-0.176-2.el7.x86_64---> Package fontconfig-devel.x86_64 0:2.13.0-4.3.el7 will be installed40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115--> Processing Dependency: fontconfig(x86-64) = 2.13.0-4.3.el7 for package: fontconfig-devel-2.13.0-4.3.el7.x86_64 --> Processing Dependency: pkgconfig(freetype2) >= 20.0.14 for package: fontconfig-devel-2.13.0-4.3.el7.x86_64 --> Processing Dependency: freetype-devel >= 2.8-7 for package: fontconfig-devel-2.13.0-4.3.el7.x86_64--> Processing Dependency: pkgconfig(uuid) for package: fontconfig-devel-2.13.0-4.3.el7.x86_64--> Processing Dependency: pkgconfig(expat) for package: fontconfig-devel-2.13.0-4.3.el7.x86_64--> Processing Dependency: libfontconfig.so.1()(64bit) for package: fontconfig-devel-2.13.0-4.3.el7.x86_64---> Package glibc-devel.x86_64 0:2.17-292.el7 will be installed--> Processing Dependency: glibc-headers = 2.17-292.el7 for package: glibc-devel-2.17-292.el7.x86_64--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-292.el7.x86_64---> Package ksh.x86_64 0:20120801-139.el7 will be installed---> Package libX11.x86_64 0:1.6.7-2.el7 will be installed--> Processing Dependency: libX11-common >= 1.6.7-2.el7 for package: libX11-1.6.7-2.el7.x86_64---> Package libXau.x86_64 0:1.0.8-2.1.el7 will be installed---> Package libXi.x86_64 0:1.7.9-1.el7 will be installed--> Processing Dependency: libXext.so.6()(64bit) for package: libXi-1.7.9-1.el7.x86_64---> Package libXrender.x86_64 0:0.9.10-1.el7 will be installed---> Package libXrender-devel.x86_64 0:0.9.10-1.el7 will be installed--> Processing Dependency: pkgconfig(renderproto) >= 0.9 for package: libXrender-devel-0.9.10-1.el7.x86_64--> Processing Dependency: pkgconfig(xproto) for package: libXrender-devel-0.9.10-1.el7.x86_64--> Processing Dependency: pkgconfig(x11) for package: libXrender-devel-0.9.10-1.el7.x86_64---> Package libXtst.x86_64 0:1.2.3-1.el7 will be installed---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed---> Package libstdc++-devel.x86_64 0:4.8.5-39.el7 will be installed---> Package libxcb.x86_64 0:1.13-1.el7 will be installed---> Package net-tools.x86_64 0:2.0-0.25.20131004git.el7 will be installed---> Package nfs-utils.x86_64 1:1.3.0-0.65.el7 will be installed--> Processing Dependency: libtirpc >= 0.2.4-0.7 for package: 1:nfs-utils-1.3.0-0.65.el7.x86_64--> Processing Dependency: gssproxy >= 0.7.0-3 for package: 1:nfs-utils-1.3.0-0.65.el7.x86_64--> Processing Dependency: rpcbind for package: 1:nfs-utils-1.3.0-0.65.el7.x86_64--> Processing Dependency: quota for package: 1:nfs-utils-1.3.0-0.65.el7.x86_64--> Processing Dependency: libnfsidmap for package: 1:nfs-utils-1.3.0-0.65.el7.x86_64--> Processing Dependency: libevent for package: 1:nfs-utils-1.3.0-0.65.el7.x86_64--> Processing Dependency: keyutils for package: 1:nfs-utils-1.3.0-0.65.el7.x86_64--> Processing Dependency: libtirpc.so.1()(64bit) for package: 1:nfs-utils-1.3.0-0.65.el7.x86_64--> Processing Dependency: libnfsidmap.so.0()(64bit) for package: 1:nfs-utils-1.3.0-0.65.el7.x86_64--> Processing Dependency: libevent-2.0.so.5()(64bit) for package: 1:nfs-utils-1.3.0-0.65.el7.x86_64---> Package python-configshell.noarch 1:1.1.fb25-1.el7 will be installed--> Processing Dependency: python-urwid for package: 1:python-configshell-1.1.fb25-1.el7.noarch--> Processing Dependency: pyparsing for package: 1:python-configshell-1.1.fb25-1.el7.noarch---> Package python-rtslib.noarch 0:2.1.fb69-3.el7 will be installed--> Processing Dependency: python-kmod for package: python-rtslib-2.1.fb69-3.el7.noarch---> Package smartmontools.x86_64 1:7.0-1.el7 will be installed--> Processing Dependency: mailx for package: 1:smartmontools-7.0-1.el7.x86_64---> Package sysstat.x86_64 0:10.1.5-18.el7 will be installed--> Processing Dependency: libsensors.so.4()(64bit) for package: sysstat-10.1.5-18.el7.x86_64---> Package targetcli.noarch 0:2.1.fb49-1.el7 will be installed---> Package unzip.x86_64 0:6.0-20.el7 will be installed---> Package vim-enhanced.x86_64 2:7.4.629-6.el7 will be installed--> Running transaction check---> Package expat-devel.x86_64 0:2.1.0-10.el7_3 will be installed---> Package fontconfig.x86_64 0:2.13.0-4.3.el7 will be installed--> Processing Dependency: fontpackages-filesystem for package: fontconfig-2.13.0-4.3.el7.x86_64--> Processing Dependency: dejavu-sans-fonts for package: fontconfig-2.13.0-4.3.el7.x86_64---> Package freetype-devel.x86_64 0:2.8-14.el7 will be installed--> Processing Dependency: pkgconfig(libpng) for package: freetype-devel-2.8-14.el7.x86_64---> Package glibc-headers.x86_64 0:2.17-292.el7 will be installed--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-292.el7.x86_64--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-292.el7.x86_64---> Package gssproxy.x86_64 0:0.7.0-26.el7 will be installed--> Processing Dependency: libini_config >= 1.3.1-31 for package: gssproxy-0.7.0-26.el7.x86_64--> Processing Dependency: libverto-module-base for package: gssproxy-0.7.0-26.el7.x86_64--> Processing Dependency: libref_array.so.1(REF_ARRAY_0.1.1)(64bit) for package: gssproxy-0.7.0-26.el7.x86_64 --> Processing Dependency: libini_config.so.3(INI_CONFIG_1.2.0)(64bit) for package: gssproxy-0.7.0-26.el7.x86_64 --> Processing Dependency: libini_config.so.3(INI_CONFIG_1.1.0)(64bit) for package: gssproxy-0.7.0-26.el7.x86_64 --> Processing Dependency: libref_array.so.1()(64bit) for package: gssproxy-0.7.0-26.el7.x86_64--> Processing Dependency: libini_config.so.3()(64bit) for package: gssproxy-0.7.0-26.el7.x86_64--> Processing Dependency: libcollection.so.2()(64bit) for package: gssproxy-0.7.0-26.el7.x86_64--> Processing Dependency: libbasicobjects.so.0()(64bit) for package: gssproxy-0.7.0-26.el7.x86_64---> Package keyutils.x86_64 0:1.5.8-3.el7 will be installed---> Package libX11-common.noarch 0:1.6.7-2.el7 will be installed---> Package libX11-devel.x86_64 0:1.6.7-2.el7 will be installed--> Processing Dependency: pkgconfig(xcb) >= 1.11.1 for package: libX11-devel-1.6.7-2.el7.x86_64--> Processing Dependency: pkgconfig(xcb) for package: libX11-devel-1.6.7-2.el7.x86_64---> Package libXext.x86_64 0:1.3.3-3.el7 will be installed---> Package libevent.x86_64 0:2.0.21-4.el7 will be installed---> Package libnfsidmap.x86_64 0:0.25-19.el7 will be installed---> Package libtirpc.x86_64 0:0.2.4-0.16.el7 will be installed---> Package libuuid-devel.x86_64 0:2.23.2-61.el7 will be installed---> Package lm_sensors-libs.x86_64 0:3.4.0-8.20160601gitf9185e5.el7 will be installed---> Package mailx.x86_64 0:12.5-19.el7 will be installed---> Package pyparsing.noarch 0:1.5.6-9.el7 will be installed---> Package python-kmod.x86_64 0:0.9-4.el7 will be installed---> Package python-urwid.x86_64 0:1.1.1-3.el7 will be installed---> Package quota.x86_64 1:4.01-19.el7 will be installed116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191--> Processing Dependency: quota-nls = 1:4.01-19.el7 for package: 1:quota-4.01-19.el7.x86_64--> Processing Dependency: tcp_wrappers for package: 1:quota-4.01-19.el7.x86_64---> Package rpcbind.x86_64 0:0.2.0-48.el7 will be installed---> Package xorg-x11-proto-devel.noarch 0:2018.4-1.el7 will be installed---> Package zlib-devel.x86_64 0:1.2.7-18.el7 will be installed--> Running transaction check---> Package dejavu-sans-fonts.noarch 0:2.33-6.el7 will be installed--> Processing Dependency: dejavu-fonts-common = 2.33-6.el7 for package: dejavu-sans-fonts-2.33-6.el7.noarch---> Package fontpackages-filesystem.noarch 0:1.44-8.el7 will be installed---> Package kernel-headers.x86_64 0:3.10.0-1062.el7 will be installed---> Package libbasicobjects.x86_64 0:0.1.1-32.el7 will be installed---> Package libcollection.x86_64 0:0.7.0-32.el7 will be installed---> Package libini_config.x86_64 0:1.3.1-32.el7 will be installed--> Processing Dependency: libpath_utils.so.1(PATH_UTILS_0.2.1)(64bit) for package: libini_config-1.3.1-32.el7.x86_64--> Processing Dependency: libpath_utils.so.1()(64bit) for package: libini_config-1.3.1-32.el7.x86_64---> Package libpng-devel.x86_64 2:1.5.13-7.el7_2 will be installed---> Package libref_array.x86_64 0:0.1.5-32.el7 will be installed---> Package libverto-libevent.x86_64 0:0.2.5-4.el7 will be installed---> Package libxcb-devel.x86_64 0:1.13-1.el7 will be installed--> Processing Dependency: pkgconfig(xau) >= 0.99.2 for package: libxcb-devel-1.13-1.el7.x86_64---> Package quota-nls.noarch 1:4.01-19.el7 will be installed---> Package tcp_wrappers.x86_64 0:7.6-77.el7 will be installed--> Running transaction check---> Package dejavu-fonts-common.noarch 0:2.33-6.el7 will be installed---> Package libXau-devel.x86_64 0:1.0.8-2.1.el7 will be installed---> Package libpath_utils.x86_64 0:0.2.1-32.el7 will be installed--> Finished Dependency ResolutionDependencies Resolved====================================================================================================================================== Package Arch Version Repository Size====================================================================================================================================== Installing:bc x86_64 1.06.95-13.el7 base 115 kcompat-libcap1 x86_64 1.10-7.el7 base 19 kelfutils-libelf-devel x86_64 0.176-2.el7 base 39 kfontconfig-devel x86_64 2.13.0-4.3.el7 base 138 kglibc-devel x86_64 2.17-292.el7 base 1.1 Mksh x86_64 20120801-139.el7 base 885 klibX11 x86_64 1.6.7-2.el7 base 607 klibXau x86_64 1.0.8-2.1.el7 base 29 klibXi x86_64 1.7.9-1.el7 base 40 klibXrender x86_64 0.9.10-1.el7 base 26 klibXrender-devel x86_64 0.9.10-1.el7 base 17 klibXtst x86_64 1.2.3-1.el7 base 20 klibaio-devel x86_64 0.3.109-13.el7 base 13 klibstdc++-devel x86_64 4.8.5-39.el7 base 1.5 Mlibxcb x86_64 1.13-1.el7 base 214 knet-tools x86_64 2.0-0.25.20131004git.el7 base 306 knfs-utils x86_64 1:1.3.0-0.65.el7 base 412 kpython-configshell noarch 1:1.1.fb25-1.el7 base 68 kpython-rtslib noarch 2.1.fb69-3.el7 base 102 ksmartmontools x86_64 1:7.0-1.el7 base 546 ksysstat x86_64 10.1.5-18.el7 base 316 ktargetcli noarch 2.1.fb49-1.el7 base 68 kunzip x86_64 6.0-20.el7 base 170 kvim-enhanced x86_64 2:7.4.629-6.el7 base 1.1 MInstalling for dependencies:dejavu-fonts-common noarch 2.33-6.el7 base 64 kdejavu-sans-fonts noarch 2.33-6.el7 base 1.4 Mexpat-devel x86_64 2.1.0-10.el7_3 base 57 kfontconfig x86_64 2.13.0-4.3.el7 base 254 kfontpackages-filesystem noarch 1.44-8.el7 base 9.9 kfreetype-devel x86_64 2.8-14.el7 base 447 kglibc-headers x86_64 2.17-292.el7 base 687 kgssproxy x86_64 0.7.0-26.el7 base 110 kkernel-headers x86_64 3.10.0-1062.el7 base 8.7 Mkeyutils x86_64 1.5.8-3.el7 base 54 klibX11-common noarch 1.6.7-2.el7 base 164 klibX11-devel x86_64 1.6.7-2.el7 base 981 klibXau-devel x86_64 1.0.8-2.1.el7 base 14 klibXext x86_64 1.3.3-3.el7 base 39 klibbasicobjects x86_64 0.1.1-32.el7 base 26 klibcollection x86_64 0.7.0-32.el7 base 42 klibevent x86_64 2.0.21-4.el7 base 214 klibini_config x86_64 1.3.1-32.el7 base 64 klibnfsidmap x86_64 0.25-19.el7 base 50 klibpath_utils x86_64 0.2.1-32.el7 base 28 klibpng-devel x86_64 2:1.5.13-7.el7_2 base 122 klibref_array x86_64 0.1.5-32.el7 base 27 klibtirpc x86_64 0.2.4-0.16.el7 base 89 klibuuid-devel x86_64 2.23.2-61.el7 base 92 klibverto-libevent x86_64 0.2.5-4.el7 base 8.9 klibxcb-devel x86_64 1.13-1.el7 base 1.1 Mlm_sensors-libs x86_64 3.4.0-8.20160601gitf9185e5.el7 base 42 kmailx x86_64 12.5-19.el7 base 245 kpyparsing noarch 1.5.6-9.el7 base 94 kpython-kmod x86_64 0.9-4.el7 base 57 kpython-urwid x86_64 1.1.1-3.el7 base 654 kquota x86_64 1:4.01-19.el7 base 179 k192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 quota-nls noarch 1:4.01-19.el7 base 90 krpcbind x86_64 0.2.0-48.el7 base 60 ktcp_wrappers x86_64 7.6-77.el7 base 79 kxorg-x11-proto-devel noarch 2018.4-1.el7 base 279 kzlib-devel x86_64 1.2.7-18.el7 base 50 kTransaction Summary====================================================================================================================================== Install 24 Packages (+37 Dependent packages)Total download size: 24 MInstalled size: 53 MDownloading packages:--------------------------------------------------------------------------------------------------------------------------------------Total 108 MB/s| 24 MB 00:00:00Running transaction checkRunning transaction testTransaction test succeededRunning transactionInstalling : xorg-x11-proto-devel-2018.4-1.el7.noarch 1/61Installing : zlib-devel-1.2.7-18.el7.x86_64 2/61Installing : libcollection-0.7.0-32.el7.x86_64 3/61Installing : libXau-1.0.8-2.1.el7.x86_64 4/61Installing : libxcb-1.13-1.el7.x86_64 5/61Installing : libref_array-0.1.5-32.el7.x86_64 6/61Installing : libevent-2.0.21-4.el7.x86_64 7/61Installing : fontpackages-filesystem-1.44-8.el7.noarch 8/61Installing : libbasicobjects-0.1.1-32.el7.x86_64 9/61Installing : libtirpc-0.2.4-0.16.el7.x86_64 10/61Installing : rpcbind-0.2.0-48.el7.x86_64 11/61Installing : dejavu-fonts-common-2.33-6.el7.noarch 12/61Installing : dejavu-sans-fonts-2.33-6.el7.noarch 13/61Installing : fontconfig-2.13.0-4.3.el7.x86_64 14/61Installing : libverto-libevent-0.2.5-4.el7.x86_64 15/61Installing : libXau-devel-1.0.8-2.1.el7.x86_64 16/61Installing : libxcb-devel-1.13-1.el7.x86_64 17/61Installing : 2:libpng-devel-1.5.13-7.el7_2.x86_64 18/61Installing : freetype-devel-2.8-14.el7.x86_64 19/61Installing : expat-devel-2.1.0-10.el7_3.x86_64 20/61Installing : mailx-12.5-19.el7.x86_64 21/61Installing : 1:quota-nls-4.01-19.el7.noarch 22/61Installing : libnfsidmap-0.25-19.el7.x86_64 23/61Installing : keyutils-1.5.8-3.el7.x86_64 24/61Installing : libpath_utils-0.2.1-32.el7.x86_64 25/61Installing : libini_config-1.3.1-32.el7.x86_64 26/61Installing : gssproxy-0.7.0-26.el7.x86_64 27/61Installing : python-kmod-0.9-4.el7.x86_64 28/61Installing : python-rtslib-2.1.fb69-3.el7.noarch 29/61Installing : python-urwid-1.1.1-3.el7.x86_64 30/61Installing : libX11-common-1.6.7-2.el7.noarch 31/61Installing : libX11-1.6.7-2.el7.x86_64 32/61Installing : libXext-1.3.3-3.el7.x86_64 33/61Installing : libXi-1.7.9-1.el7.x86_64 34/61Installing : libX11-devel-1.6.7-2.el7.x86_64 35/61Installing : libXrender-0.9.10-1.el7.x86_64 36/61Installing : lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_64 37/61Installing : tcp_wrappers-7.6-77.el7.x86_64 38/61Installing : 1:quota-4.01-19.el7.x86_64 39/61Installing : pyparsing-1.5.6-9.el7.noarch 40/61Installing : 1:python-configshell-1.1.fb25-1.el7.noarch 41/61Installing : kernel-headers-3.10.0-1062.el7.x86_64 42/61Installing : glibc-headers-2.17-292.el7.x86_64 43/61Installing : libuuid-devel-2.23.2-61.el7.x86_64 44/61Installing : fontconfig-devel-2.13.0-4.3.el7.x86_64 45/61Installing : glibc-devel-2.17-292.el7.x86_64 46/61Installing : targetcli-2.1.fb49-1.el7.noarch 47/61Installing : 1:nfs-utils-1.3.0-0.65.el7.x86_64 48/61Installing : sysstat-10.1.5-18.el7.x86_64 49/61Installing : libXrender-devel-0.9.10-1.el7.x86_64 50/61Installing : libXtst-1.2.3-1.el7.x86_64 51/61Installing : 1:smartmontools-7.0-1.el7.x86_64 52/61Installing : elfutils-libelf-devel-0.176-2.el7.x86_64 53/61Installing : libaio-devel-0.3.109-13.el7.x86_64 54/61Installing : compat-libcap1-1.10-7.el7.x86_64 55/61Installing : ksh-20120801-139.el7.x86_64 56/61Installing : 2:vim-enhanced-7.4.629-6.el7.x86_64 57/61Installing : libstdc++-devel-4.8.5-39.el7.x86_64 58/61Installing : net-tools-2.0-0.25.20131004git.el7.x86_64 59/61Installing : bc-1.06.95-13.el7.x86_64 60/61268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 Installing : unzip-6.0-20.el7.x86_64 61/61Verifying : libXext-1.3.3-3.el7.x86_64 1/61Verifying : libtirpc-0.2.4-0.16.el7.x86_64 2/61Verifying : libXi-1.7.9-1.el7.x86_64 3/61Verifying : libX11-devel-1.6.7-2.el7.x86_64 4/61Verifying : fontconfig-2.13.0-4.3.el7.x86_64 5/61Verifying : 2:libpng-devel-1.5.13-7.el7_2.x86_64 6/61Verifying : libXrender-0.9.10-1.el7.x86_64 7/61Verifying : libuuid-devel-2.23.2-61.el7.x86_64 8/61Verifying : 1:nfs-utils-1.3.0-0.65.el7.x86_64 9/61Verifying : kernel-headers-3.10.0-1062.el7.x86_64 10/61Verifying : libbasicobjects-0.1.1-32.el7.x86_64 11/61Verifying : unzip-6.0-20.el7.x86_64 12/61Verifying : pyparsing-1.5.6-9.el7.noarch 13/61Verifying : fontpackages-filesystem-1.44-8.el7.noarch 14/61Verifying : bc-1.06.95-13.el7.x86_64 15/61Verifying : fontconfig-devel-2.13.0-4.3.el7.x86_64 16/61Verifying : tcp_wrappers-7.6-77.el7.x86_64 17/61Verifying : zlib-devel-1.2.7-18.el7.x86_64 18/61Verifying : xorg-x11-proto-devel-2018.4-1.el7.noarch 19/61Verifying : dejavu-fonts-common-2.33-6.el7.noarch 20/61Verifying : net-tools-2.0-0.25.20131004git.el7.x86_64 21/61Verifying : libXtst-1.2.3-1.el7.x86_64 22/61Verifying : libX11-1.6.7-2.el7.x86_64 23/61Verifying : targetcli-2.1.fb49-1.el7.noarch 24/61Verifying : libxcb-1.13-1.el7.x86_64 25/61Verifying : freetype-devel-2.8-14.el7.x86_64 26/61Verifying : lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_64 27/61Verifying : libstdc++-devel-4.8.5-39.el7.x86_64 28/61Verifying : libini_config-1.3.1-32.el7.x86_64 29/61Verifying : libX11-common-1.6.7-2.el7.noarch 30/61Verifying : libXrender-devel-0.9.10-1.el7.x86_64 31/61Verifying : 2:vim-enhanced-7.4.629-6.el7.x86_64 32/61Verifying : python-urwid-1.1.1-3.el7.x86_64 33/61Verifying : sysstat-10.1.5-18.el7.x86_64 34/61Verifying : ksh-20120801-139.el7.x86_64 35/61Verifying : libevent-2.0.21-4.el7.x86_64 36/61Verifying : elfutils-libelf-devel-0.176-2.el7.x86_64 37/61Verifying : libverto-libevent-0.2.5-4.el7.x86_64 38/61Verifying : dejavu-sans-fonts-2.33-6.el7.noarch 39/61Verifying : compat-libcap1-1.10-7.el7.x86_64 40/61Verifying : libaio-devel-0.3.109-13.el7.x86_64 41/61Verifying : 1:python-configshell-1.1.fb25-1.el7.noarch 42/61Verifying : libref_array-0.1.5-32.el7.x86_64 43/61Verifying : rpcbind-0.2.0-48.el7.x86_64 44/61Verifying : python-kmod-0.9-4.el7.x86_64 45/61Verifying : glibc-devel-2.17-292.el7.x86_64 46/61Verifying : libpath_utils-0.2.1-32.el7.x86_64 47/61Verifying : 1:quota-4.01-19.el7.x86_64 48/61Verifying : libxcb-devel-1.13-1.el7.x86_64 49/61Verifying : gssproxy-0.7.0-26.el7.x86_64 50/61Verifying : libXau-1.0.8-2.1.el7.x86_64 51/61Verifying : 1:smartmontools-7.0-1.el7.x86_64 52/61Verifying : libcollection-0.7.0-32.el7.x86_64 53/61Verifying : keyutils-1.5.8-3.el7.x86_64 54/61Verifying : libnfsidmap-0.25-19.el7.x86_64 55/61Verifying : 1:quota-nls-4.01-19.el7.noarch 56/61Verifying : python-rtslib-2.1.fb69-3.el7.noarch 57/61Verifying : mailx-12.5-19.el7.x86_64 58/61Verifying : expat-devel-2.1.0-10.el7_3.x86_64 59/61Verifying : glibc-headers-2.17-292.el7.x86_64 60/61Verifying : libXau-devel-1.0.8-2.1.el7.x86_64 61/61Installed:bc.x86_64 0:1.06.95-13.el7 compat-libcap1.x86_64 0:1.10-7.el7 elfutils-libelf-devel.x86_64 0:0.176-2.el7fontconfig-devel.x86_64 0:2.13.0-4.3.el7 glibc-devel.x86_64 0:2.17-292.el7 ksh.x86_64 0:20120801-139.el7 libX11.x86_64 0:1.6.7-2.el7 libXau.x86_64 0:1.0.8-2.1.el7 libXi.x86_64 0:1.7.9-1.el7libXrender.x86_64 0:0.9.10-1.el7 libXrender-devel.x86_64 0:0.9.10-1.el7 libXtst.x86_64 0:1.2.3-1.el7libaio-devel.x86_64 0:0.3.109-13.el7 libstdc++-devel.x86_64 0:4.8.5-39.el7 libxcb.x86_64 0:1.13-1.el7net-tools.x86_64 0:2.0-0.25.20131004git.el7 nfs-utils.x86_64 1:1.3.0-0.65.el7 python-configshell.noarch 1:1.1.fb25-1.el7 python-rtslib.noarch 0:2.1.fb69-3.el7 smartmontools.x86_64 1:7.0-1.el7 sysstat.x86_64 0:10.1.5-18.el7targetcli.noarch 0:2.1.fb49-1.el7 unzip.x86_64 0:6.0-20.el7 vim-enhanced.x86_64 2:7.4.629-6.el7 Dependency Installed:dejavu-fonts-common.noarch 0:2.33-6.el7 dejavu-sans-fonts.noarch 0:2.33-6.el7expat-devel.x86_64 0:2.1.0-10.el7_3 fontconfig.x86_64 0:2.13.0-4.3.el7fontpackages-filesystem.noarch 0:1.44-8.el7 freetype-devel.x86_64 0:2.8-14.el7glibc-headers.x86_64 0:2.17-292.el7 gssproxy.x86_64 0:0.7.0-26.el7kernel-headers.x86_64 0:3.10.0-1062.el7 keyutils.x86_64 0:1.5.8-3.el7。
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 ⽂件。
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文件。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
然后编辑 /etc/oratab 将 <Oracle 的 SID>:<Oracle 的主目录>:N 修改为 <Oracle 的 SID>:<Oracle 的主目录>:Y 使数据库实例能够自动启动。 5、让 oracle 运行为服务
export PATH=${PATH}:$ORACLE_HOME/bin
start() {
daemon --user $ORACLE $ORACLE_HOME/bin/dbstart daemon --user $ORACLE "$ORACLE_HOME_LISTNER/bin/lsnrctl start" }
ignoreSysPrereqs 让 Oracle 忽略系统检查,因为 Oracle 官方声明只支持 Linux 服务器产品,所以要在非服务器产品的 Linux 上安装就必须指定此参数。 silent 让安装程序以静默模式运行。 responseFile 指定一个应答文件。
三、安装后的工作
1、别忘记用 root 执行两个脚本,/oracle/product/10.2.0/root.sh 和 /oracle/oraInventory/orainstRoot.sh。
静默安装 oracle 及实例
安装前的各种准备就不说了,跟图形界面安装一样,只从静默安装开始。
一、编译安装需要的应答文件
静默模式(Silent)安装必须指定一个应答文件来完成安装过程所须的各类参数。 在 Oracle 安装目录的 response 子目录里有 enterprise.rsp、standard.rsp 和 custom.rsp 三个应答文件,分别对应企业版、标准版和定制的安装。 以 enterprise.rsp 为例,用任意的文本编辑器打它,修改以下这些项目录位置,必须是绝对路径。 (ORACLE_HOME=/oracle/product/10.2.0) ORACLE_HOME_NAME Oracle 服务器的名称,必须以字母开头。 (ORACLE_HOME_NAME=dbss)
stop() {
daemon --user $ORACLE "$ORACLE_HOME_LISTNER/bin/lsnrctl stop" daemon --user $ORACLE $ORACLE_HOME/bin/dbshut }
case $1 in 'start')
start RETVAL=$? ;; 'stop') stop RETVAL=$? ;; 'restart') stop start RETVAL=$? ;; *) echo "usage: $0 {start|stop|restart}" exit ;; esac # exit
) 2、在 listener.ora 中修改为 IP LISTENER =
(DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = GS-NMS-WEB01)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)) )
PS:问题同上,不知道影响在哪里。
4、安装数据库实例。
编辑 Oracle 安装目录里 response 子目录下的应答文件 dbca.rsp,修改以下项 目。 GDBNAME 数据库全局名称 SID 数据库的 SID SYSPASSWORD SYS 用户的初始密码 SYSTEMPASSWORD SYSTEM 用户的初始密码 CHARACTERSET 数据库字符集(中文为 ZHS16GBK) NATIONALCHARACTERSET 数据库国家字符集
注:如果 Oracle 从光盘安装,必须先将应答文件复制到硬盘上,才能修改。
二、开始安装
用 oracle 用户登录,然后在介质目录下执行./runInstaller -ignoreSysPrereqs -silent -responseFile /oracle/database/response/enterprise.rsp
PS:这个我没有安装成功,但是好像对之后的安装并没有影响,问题先记下!
3、修改 dbstart。用任意的文本编辑器打开 $ORACLE_HOME/bin/dbstart,将 ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle 改为 ORACLE_HOME_LISTNER=$ORACLE_HOME 否则网络监听器可能无法自动启动。
PS:有的命令是被注释掉的,需要去掉注释。
然后运行 $ORACLE_HOME/bin/dbca -silent -responseFile <路径/文件> -cloneTemplate 数据库创建成功后须要注册一些信息,运行 $ORACLE_BASE/oraInventory/orainstRoot.sh
Oracle 服务器支持的语言,默认只有英语,可以添加多个语言。 (COMPONENT_LANGUAGES={"en","zh_CN"}) s_nameForDBAGrp 用于 Oracle 系统管理的 linux 用户组名,该组的用户拥有 管理 Oracle 服务器的权限,在本例中设置为 oinstall。 s_nameForOPERGrp 用于 Oracle 数据库常规操作的 linux 用户组名,该组的用 户拥有常规操作 Oracle 数据库的权限,在本例中设置为 oinstall。 n_configurationOption 安装类型(1 为在安装后创建数据库,2 为安装后创建一 个自动存储管理实例,3 为只安装服务器软件),在本例中选择 3。 其它项目用默认值即可,也可以根据自己的须要进行修改。
创建文件 /etc/init.d/oracle,输入下列内容
#!/bin/sh # export ORACLE_HOME=<Oracle 服务器主目录的绝对路径> export ORACLE_HOME_LISTNER=$ORACLE_HOME export ORACLE=oracle
. /etc/init.d/functions
2、安装网络监听器。没有网络监听器,客户端就无法通过网络连接 Oralce 服务 器。要在命令行安装网络监听器,也只能使用静默模式。 编辑 Oracle 安装目录里 response 子目录下的应答文件 netca.rsp,修改以下项 目。
INSTALL_TYPE=""custom"" 安装的类型 LISTENER_NUMBER=1 监听器数量 LISTENER_NAMES={"LISTENER"} 监听器的名称列表 LISTENER_PROTOCOLS={"TCP;1521"} 监听器使用的通讯协议列表 LISTENER_START=""LISTENER"" 监听器启动的名称 然后运行 $ORACLE_HOME/bin/netca /silent /responseFile <应答文件的绝对路径>
然后将这个文件赋予可执行的权限,运行
chmod a+x /etc/init.d/oracle 让 Oracle 的服务在 Linux 启动时自动运行 ln -s /etc/init.d/oracle /etc/rc.d/rc3.d/S99oracle ln -s /etc/init.d/oracle /etc/rc.d/rc5.d/S99oracle 这样就可以用 service 来启动和停止 Oracle 了。
一、注意:安装完成后需要给 slview 用户赋予 oracle 执行权限
1、可以把 slview 用户加到安装 oracle 时的用户组也行 2、chmod 775 /oracle -R
二,
在 tnsnames.ora 中加
DBNMS =
(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.x)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = xxxx) )