Oracle静默安装(单机)
linux下静默安装oracle数据库各参数选项作用说明
https://www.imzcy.cn/1631.html
说明: 1. 操作系统版本为 Redhat6.7 , IP : 192.168.56.20 ,主机名: slient 。
2. 数据库版本为 11.2.0.4 ;
一:检查
1.内存(至少1G)
grep MemTotal /proc/meminfo
2.SWAP分区
内存在 2G 以下 , SWAP 分区就设置为内存的 1.5 倍
内存在 2G 至 8G 之间, SWAP 就设置为内存大小
内存在 8G 以上, SWAP 就设置为内存大小的 0.75 倍。
查看 SWAP 分区情况:
grep SwapTotal /proc/meminfo
3.TMP空间
要求至少 400M
查看 TMP 空间
df -k /tmp
4.查看系统补丁包
rpm -q binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel pdksh libgcc libstdc++ libstdc++-devel libaio libaio-devel make sysstat
binutils-2.20.51.0.2-5.43.el6.x86_64
package compat-libcap1 is not installed
package compat-libstdc++-33 is not installed
package gcc is not installed
package gcc-c++ is not installed
glibc-2.12-1.166.el6.x86_64
glibc-devel-2.12-1.166.el6.x86_64
package pdksh is not installed
libgcc-4.4.7-16.el6.x86_64
libstdc++-4.4.7-16.el6.x86_64
package libstdc++-devel is not installed
libaio-0.3.107-10.el6.x86_64
package libaio-devel is not installed
make-3.81-20.el6.x86_64
sysstat-9.0.4-27.el6.x86_64
注: pdksh没有安装,可以忽略。安装了ksh。
挂在光盘,安装未安装的包,如下:
[root@slient ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 35G 2.9G 31G 9% /
tmpfs 940M 76K 940M 1% /dev/shm
/dev/sda1 477M 41M 411M 9% /boot
/dev/sr0 3.6G 3.6G 0 100% /media/RHEL-6.7 Server.x86_64
[root@slient ~]#
[root@slient ~]# cd /mnt
[root@slient mnt]# mount /dev/sr0 /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only
-- 配置 yum 源:
vi yum.repo
[base]
name=base
baseurl=file:/// mnt /Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[HighAvailability]
name=HighAvailability
baseurl=file:/// mnt /HighAvailability
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[ResilientStorage]
name=ResilientStorage
baseurl=file:/// mnt /ResilientStorage
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[LoadBalancer]
name=LoadBalancer
baseurl=file:/// mnt /LoadBalancer
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
—安装未安装的包:
yum install -y compat-libcap1*
yum install -y compat-libstdc++-33*
yum install -y gcc*
yum install -y libstdc++-devel*
yum install -y libaio-devel*
5. 确认防火墙和 selinux已关闭
----- 查看 selinux 状态: sestatus
关闭 SELinux 的方法:
修改 /etc/selinux/config 文件中的 SELINUX="" 为 disabled ,然后重启。
如果不想重启系统,使用命令 setenforce 0
------ 查看 iptables 状态: service iptables status
关闭防火墙
1) 重启后永久性生效:
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后失效:
开启: service iptables start
关闭: service iptables stop
6. 增加相关用户及组
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
7. 修改配置文件
/etc/security/limits.conf 文件,添加如下:
Vi /etc/security/limits.conf
2047 oracle hard nproc
1024 oracle hard nofile
10240 's/^#.*$//g'
sed -i *.rsp INSTALL_DB_SWONLY<1span style="font-family:" color:#0000ff;"="">
ORACLE_HOSTNAME= slient
UNIX_GROUP_NAME= oinstall
INVENTORY_LOCATION= /u01/app/oraInventory
SELECTED_LANGUAGES= en
ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE= /u01/app/oracle
oracle.install.db.InstallEdition =EE
oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0
oracle.install.db.DBA_GROUP= DBA
oracle.install.db.OPER_GROUP=
oracle.install.db.CLUSTER_NODES=
oracle.install.db.isRACOneInstall=
oracle.install.db.racOneServiceName=
oracle.install.db.config.starterdb.type=
oracle.install.db.config.starterdb.globalDBName=
oracle.install.db.config.starterdb.SID=
oracle.install.db.config.starterdb.characterSet= AL32UTF8
oracle.install.db.config.starterdb.memoryOption= true
oracle.install.db.config.starterdb.memoryLimit=
oracle.install.db.config.starterdb.installExampleSchemas= false
oracle.install.db.config.starterdb.enableSecuritySettings= true
oracle.install.db.config.starterdb.password.ALL=
oracle.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_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=
DECLINE_SECURITY_UPDATES= true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
6. 静默安装软件 :
[oracle@slient database]$ pwd
/home/oracle/slient/database
[oracle@slient database]$ ls
install readme.html response rpm runInstaller sshsetup stage welcome.html
[oracle@slient database]$ ./runInstaller -silent -force -noconfig -responseFile /home/oracle/slient/database/response/db_install.rsp
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 25659 MB Passed
Checking swap space: must be greater than 150 MB. Actual 4095 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-07-13_04-13-03AM. Please wait ...[oracle@slient database]$ [WARNING] [INS-13014] Target environment do not meet some optional requirements.
CAUSE: Some of the optional prerequisites are not met. See logs for details. /tmp/OraInstall2017-07-13_04-13-03AM/installActions2017-07-13_04-13-03AM.log
ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2017-07-13_04-13-03AM/installActions2017-07-13_04-13-03AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
You can find the log of this install session at:
/u01/app/oraInventory/logs/installActions2017-07-13_04-13-03AM.log
[oracle@slient database]$ more The installation of Oracle Database 11g was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2017-07-13_04-13-03AM.log' for more details.
As a root user, execute the following script(s):
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Successfully Setup Software.
[root@slient ~]# /u01/app/oraInventory/orainstRoot.sh
Changing 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 scrip t is complete.
[root@slient ~]#
[root@slient ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Check /u01/app/oracle/product/11.2.0/dbhome_1/install/root_slient_2017-07-13_04-24-08.log for the output of root script
[root@slient ~]# cat /u01/app/oracle/product/11.2.0/dbhome_1/install/root_slient_2017-07-13_04-25-03.log
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
Finished product-specific root actions.
[root@slient ~]#
7. 静默安装监听
-- 编辑监听静默文件:
[oracle@slient response]$ cat netca.rsp
[GENERAL]
RESPONSEFILE_VERSION="11.2"
CREATE_TYPE="CUSTOM"
[oracle.net.ca]
INSTALLED_COMPONENTS={"server","net8","javavm"}
INSTALL_TYPE=""typical""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER"}
LISTENER_PROTOCOLS={"TCP;1521"}
LISTENER_START=""LISTENER""
NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}
NSN_NUMBER=1
NSN_NAMES={"EXTPROC_CONNECTION_DATA"}
NSN_SERVICE={"PLSExtProc"}
NSN_PROTOCOLS={"TCP;HOSTNAME;1521"}
[oracle@slient response]$
[oracle@slient response]$ $ORACLE_HOME/bin/netca /silent /responseFile /home/oracle/slient/database/response/netca.rsp
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /home/oracle/slient/database/response/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
[oracle@slient response]$
8. 静默 dbca建库
[oracle@slient response]$ more dbca.rsp
[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "test"
SID = "test
TEMPLATENAME = "General_Purpose.dbc"
[createTemplateFromDB]
SOURCEDB = "myhost:1521:orcl"
SYSDBAUSERNAME = "system"
TEMPLATENAME = "My Copy TEMPLATE"
[createCloneTemplate]
SOURCEDB = "orcl"
TEMPLATENAME = "My Clone TEMPLATE"
[DELETEDATABASE]
SOURCEDB = "orcl"
[generateScripts]
TEMPLATENAME = "New Database"
GDBNAME = "orcl11.us.oracle.com"
[CONFIGUREDATABASE]
[ADDINSTANCE]
DB_UNIQUE_NAME = "orcl11g.us.oracle.com"
NODELIST=
SYSDBAUSERNAME = "sys"
[DELETEINSTANCE]
DB_UNIQUE_NAME = "orcl11g.us.oracle.com"
INSTANCENAME = "orcl11g"
SYSDBAUSERNAME = "sys"
[oracle@slient response]$
上面就可以成功建库,但绝大多数情况 [CREATEDATABASE] 下还需要指定一些其他参数, 因为默认的可能不符合实际要求,尤其是你创建的数据库字符集必须要按你的设计需求显示指定: 加入如下部分( em, 可以不加 )
characterSet = "ZHS16GBK"
memoryPercentage = "60"
emConfiguration = "LOCAL"
sysPassword = "oracle"
systemPassword = "oracle"
dbsnmpPassword = "oracle"
sysmanPassword = "oracle"
[oracle@slient response]$ $ORACLE_HOME/bin/dbca -silent -responseFile /home/oracle/slient/database/response/dbca.rsp
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/test/test.log" for further details.
[oracle@slient response]$
注意:如果已经在响应文件中配置 sys和system密码,上面就不会提示你输入密码了。
完成!
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341