oracle11g静默安装

xiaoxiao2025-08-08  27

安装准备检查的命令内存# grep MemTotal /proc/meminfo交换空间# grep SwapTotal /proc/meminfo磁盘空间# df -ah

安装目录 /data/oracle

给予目录普通用户oracle权限

关闭Selinux

sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config  setenforce 0

设置主机名

Hostname oracledb

vim /etc/hosts 添加

127.0.0.1 oracledb

创建用户和组(root用户:创建Oracle安装组oinstall,数据库管理员组dba,及oracle用户)并设置oracle用户密码:oracle

修改内核参数(root用户:修改 /etc/sysctl.conf 文件,加上如下参数)vim /etc/sysctl.conf  #末尾添加如下

net.ipv4.ip_local_port_range= 9000 65500 fs.file-max = 6815744 kernel.shmall = 10523004 kernel.shmmni = 4096 kernel.sem = 250 32000 100128 net.core.rmem_default=262144 net.core.wmem_default=262144 net.core.rmem_max=4194304 net.core.wmem_max=1048576 fs.aio-max-nr = 1048576

sysctl -p

#使配置生效

 

修改系统资源限制(root用户:修改 /etc/security/limits.conf 文件,加上下面的参数)

vim /etc/security/limits.conf #末尾添加如下

oracle  soft  nproc  2047 oracle  hard  nproc  16384 oracle  soft  nofile  1024 oracle  hard  nofile  65536

修改用户验证选项(修改/etc/pam.d/login文件加上如下参数)

 

vim /etc/pam.d/login session    required    pam_limits.so

创建安装目录及设置权限

mkdir -p /data/oracle/ 

chmod 755 /data

chown oracle.oinstall -R /data

设置oracle环境变量

su - oracle

vim .bash_profile在末尾添加

export ORACLE_BASE=/data/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin#export PATH=$PATH:$ORACLE_HOME/binexport ORACLE_PID=ora11g

export ORACLE_SID=ora11g

export NLS_LANG=AMERICAN_AMERICA.AL32UTF8export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

 

 

source .bash_profile 让它生效

步骤2 ****

安装依赖包

Exit 退出oracle用户

执行

yum -y install binutilscompat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-commonglibc-devel libaio libaio-devel libgcclibstdc++ libstdc++-devel unixODBC unixODBC-devel

Su - oracle切换用户 解压包

cd /data/

上传的oracle   11g的包放在/data/dba

unzip linux.x64_11gR2_database_1of2.zip

unzip linux.x64_11gR2_database_2of2.zip

 

解压后得到database目录,其中database目录下的response目录,该目录中有三个rsp文件,用来作为静默安装时的应答文件的模板。

 

修改静默安装的配置文件

 

/data/database/response  权限

chmod +x /data/database/response/*

vim db_install.rsp  修改下面的内容

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0oracle.install.option=INSTALL_DB_SWONLYORACLE_HOSTNAME=oracledbUNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/data/oracle/oraInventorySELECTED_LANGUAGES=en,zh_CNORACLE_HOME=/data/oracle/product/11.2.0/db_1ORACLE_BASE=/data/oracleoracle.install.db.InstallEdition=EE

oracle.install.db.isCustomInstall=false

oracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=oinstall

oracle.install.db.CLUSTER_NODES=oracle.install.db.config.starterdb.type=GENERAL_PURPOSEoracle.install.db.config.starterdb.globalDBName=ora11goracle.install.db.config.starterdb.SID=ora11goracle.install.db.config.starterdb.characterSet=AL32UTF8oracle.install.db.config.starterdb.memoryOption=trueoracle.install.db.config.starterdb.memoryLimit=1500oracle.install.db.config.starterdb.installExampleSchemas=falseoracle.install.db.config.starterdb.enableSecuritySettings=trueoracle.install.db.config.starterdb.password.ALL=oracleoracle.install.db.config.starterdb.password.SYS=oracle.install.db.config.starterdb.password.SYSTEM=oracle.install.db.config.starterdb.password.SYSMAN=oracle.install.db.config.starterdb.password.DBSNMP=oracle.install.db.config.starterdb.control=DB_CONTROLoracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=falseoracle.install.db.config.starterdb.dbcontrol.emailAddress=oracle.install.db.config.starterdb.dbcontrol.SMTPServer=oracle.install.db.config.starterdb.automatedBackup.enable=falseoracle.install.db.config.starterdb.automatedBackup.osuid=oracle.install.db.config.starterdb.automatedBackup.ospwd=oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGEoracle.install.db.config.starterdb.fileSystemStorage.dataLocation=oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=oracle.install.db.config.asm.diskGroup=oracle.install.db.config.asm.ASMSNMPPassword=MYORACLESUPPORT_USERNAME=MYORACLESUPPORT_PASSWORD=SECURITY_UPDATES_VIA_MYORACLESUPPORT=DECLINE_SECURITY_UPDATES=true    //一定要设为 truePROXY_HOST=PROXY_PORT=PROXY_USER=PROXY_PWD=

 

开始静默安装

cd 进入/data/database

./runInstaller -ignorePrereq -silent -force -responseFile /data/database/response/db_install.rsp

安装过程中,如果提示[WARNING]不必理会,此时安装程序仍在后台进行,如果出现[FATAL],则安装程序已经停止了

执行完会出现两个脚本  复制这两个脚本  切换到root用户执行就行

步骤3 ***

配置监听程序 切换oracle用户执行

[oracle@liukaibo dba]$ $ORACLE_HOME/bin/netca /silent /responseFile /data/database/response/netca.rsp

 

Parsing command line arguments:    Parameter "silent" = true    Parameter "responsefile" = /data/database/response/netca.rspDone parsing command line arguments.Oracle Net Services Configuration:Profile configuration complete.Listener "LISTENER" already exists.Oracle Net Services configuration successful. The exit code is 0

 

启动监控程序$  /data/oracle/product/11.2.0/db_1/bin/lsnrctl start LISTENER

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 30-JAN-2015 13:23:46

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /data/dba/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - ProductionSystem parameter file is /data/oracle/product/11.2.0/db_1/network/admin/listener.oraLog messages written to /data/oracle/diag/tnslsnr/oracledb/listener/alert/log.xmlListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))STATUS of the LISTENER------------------------Alias                     LISTENERVersion                   TNSLSNR for Linux: Version 11.2.0.1.0 - ProductionStart Date                30-JAN-2015 13:23:47Uptime                    0 days 0 hr. 1 min. 3 secTrace Level               offSecurity                  ON: Local OS AuthenticationSNMP                      OFFListener Parameter File   /data/oracle/product/11.2.0/db_1/network/admin/listener.oraListener Log File         /data/oracle/diag/tnslsnr/oracledb/listener/alert/log.xmlListening Endpoints Summary...  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb)(PORT=1521)))The listener supports no servicesThe command completed successfully

启动成功

 

静默dbca建库

 vim /data/database/response/dbca.rsp修改里面的内容

GDBNAME= "ora11g"

SID ="ora11g"

SYSPASSWORD= "oracle"

SYSTEMPASSWORD= "oracle"

SYSMANPASSWORD= "oracle"

DBSNMPPASSWORD= "oracle"

DATAFILEDESTINATION=/data/oracle/oradata

RECOVERYAREADESTINATION=/data/oracle/fast_recovery_area

CHARACTERSET= "AL32UTF8"

TOTALMEMORY= "1638"

这个信息一定要配置全,不然后面问题很多

[oracle@liukaibo response]$ $ORACLE_HOME/bin/dbca -silent -responseFile /data/database/response/dbca.rsp 

The Oracle system identifier(SID) "xxx" already exists. Specify another SID

如果报错这个,那时系统与oracle的SID冲突:用root用户以远程登录模式编辑etc/oratab,删除最后一行或注释掉: xxx:/u01/oracle:N ,保存退出问题解决

Enter SYS user password:    Enter SYSTEM user password:   sh: /bin/ksh: No such file or directorysh: /bin/ksh: No such file or directoryCopying database files1% complete3% complete11% complete18% complete26% complete37% completeCreating and starting Oracle instance40% complete45% complete50% complete55% complete56% complete57% complete60% complete62% completeCompleting Database Creation66% complete70% complete73% complete74% complete85% complete96% complete100% completeLook at the log file "/data/oracle/cfgtoollogs/dbca/ora11g/ora11g.log" for further details.

出现这些百分比就代表安装成功了

 

启动数据库

[oracle@oracledb ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Mon Feb 16 14:26:57 2015

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startSP2-1506: START, @ or @@ command has no argumentsSQL> startupORACLE instance started.

Total System Global Area 3290345472 bytesFixed Size                  2217832 bytesVariable Size            1795164312 bytesDatabase Buffers         1476395008 bytesRedo Buffers               16568320 bytesDatabase mounted.Database opened.SQL> 出现这两个,代表安装成功

使用show parameter;或者select table_name from dba_tables看看是否正常

启动监听启动监听:lsnrctl start 查看监听:lsnrctl status 停止监听:lsnrctl stop

  [oracle@oracledb ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 16-FEB-2015 14:45:01

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /opt/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0 - ProductionSystem parameter file is /data/oracle/product/11.2.0/db_1/network/admin/listener.oraLog messages written to /data/oracle/diag/tnslsnr/oracledb/listener/alert/log.xmlListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))STATUS of the LISTENER------------------------Alias                     LISTENERVersion                   TNSLSNR for Linux: Version 11.2.0.1.0 - ProductionStart Date                16-FEB-2015 14:45:02Uptime                    0 days 0 hr. 1 min. 3 secTrace Level               offSecurity                  ON: Local OS AuthenticationSNMP                      OFFListener Parameter File   /opt/app/oracle/product/11.2.0/db_1/network/admin/listener.oraListener Log File         /data/oracle/diag/tnslsnr/oracledb/listener/alert/log.xmlListening Endpoints Summary...  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb)(PORT=1521)))The listener supports no servicesThe command completed successfully

 

 

静默安装的时候,如果这两个不通过,基本上是交换空间不足的原因

解决方法:

 

在root权限下执行这条命令dd if=/dev/zero of=/opt/image/swap bs=1024 count=2048000

问题2 ****部署报错:****。

如果出现报错 主要看这里。看什么报错。如果不是严重性的错误。不用管。等他执行完就行。如果输出内容卡在这里。不执行了。。就得看报什么错误

解决方法:

根据报错内容。去百度查下。基本都有解决

转载请注明原文地址: https://www.6miu.com/read-5034468.html

最新回复(0)