ITPub博客

首页 > 数据库 > Oracle > 静默安装oracle 11g

静默安装oracle 11g

原创 Oracle 作者:z597011036 时间:2015-02-03 15:56:31 0 删除 编辑

1.安装依赖包

[root@oracle11g ~]# yum -y install binutils compat-libstdc++-33 compat-libcap1 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc.i686 glibc-devel glibc-devel.i686 ksh libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel.i686 libstdc++-devel libaio libaio.i686 libaio-devel libaio-devel.i686 make sysstat unixODBC unixODBC-devel elfutils-libelf elfutils-libelf-devel
[root@oracle11g ~]#

2.创建用户和用户组

[root@oracle11g ~]# groupadd -g 501 oinstall
[root@oracle11g ~]# groupadd -g 502 dba
[root@oracle11g ~]# useradd -u 501 -g oinstall -G dba oracle
[root@voracle11g ~]#

3.配置内核参数

[root@oracle11g ~]# vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
[root@oracle11g ~]# sysctl -p

4.配置文件打开数限制

[root@oracle11g ~]# vim /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240、
[root@oracle11g ~]#

5.修改用户登陆限制

[root@oracle11g ~]# vim /etc/pam.d/login
session required /lib/security/ pam_limits.so
[root@oracle11g ~]# vim /etc/profile
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
[root@oracle11g ~]#

6.创建安装目录

[root@oracle11g ~]# mkdir -p /u01/oracle/app/oracle/product/11.2.0.4
[root@oracle11g ~]# mkdir -p /u01/oracle/oraInventory
[root@oracle11g ~]# chown -R oracle:oinstall /u01/

7.配置环境变量

[root@oracle11g ~]# vim /home/oracle/.bash_profile
export ORACLE_BASE=/u01/oracle/
export ORACLE_HOME=$ORACLE_BASE/app/oracle/product/11.2.0.4
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export CLASSPATH=$CLASSPATH:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/jlib:$ORACLE_HOME/network/lib
[oracle@oracle11g ~]$

8.解压包,配置参数文件

[root@oracle11g ~]# su - oracle
[oracle@oracle11g ~]$ unzip p13390677_112040_Linux-x86-64_1of7.zip  -d $ORACLE_HOME
[oracle@oracle11g ~]$ unzip p13390677_112040_Linux-x86-64_2of7.zip  -d $ORACLE_HOME
[oracle@oracle11g ~]$ cd /u01/oracle/app/oracle/product/11.2.0.4/
[oracle@oracle11g 11.2.0.4]$ cp -a /home/oracle/database/*  .
[oracle@oracle11g 11.2.0.4]$ ll
total 44
drwxr-xr-x 4 oracle oinstall 248 Aug 27 2013 install
-rw-r--r-- 1 oracle oinstall 30016 Aug 27 2013 readme.html
drwxr-xr-x 2 oracle oinstall 61 Aug 27 2013 response
drwxr-xr-x 2 oracle oinstall 34 Aug 27 2013 rpm
-rwxr-xr-x 1 oracle oinstall 3267 Aug 27 2013 runInstaller
drwxr-xr-x 2 oracle oinstall 29 Aug 27 2013 sshsetup
drwxr-xr-x 14 oracle oinstall 4096 Aug 27 2013 stage
-rw-r--r-- 1 oracle oinstall 500 Aug 27 2013 welcome.html
[oracle@oracle11g 11.2.0.4]$ grep -v '^#' response/db_install.rsp | grep -v '^$'
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=oracle11g
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/oracle/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/oracle/app/oracle/product/11.2.0.4
ORACLE_BASE=/u01/oracle/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
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.0oracle.install.db.DBA_GROUP=oinstall
oracle.install.db.OPER_GROUP=oinstall
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=
[oracle@oracle11g 11.2.0.4]$

9.安装oracle数据库软件

[oracle@oracle11g 11.2.0.4]$ ./runInstaller -silent -force -noconfig -ignoreSysPrereqs -showProgress -responseFile /u01/oracle/app/oracle/product/11.2.0.4/response/db_install.rsp 
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB.   Actual 91084 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3906 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2023-06-26_04-20-51PM. Please wait ...[oracle@oracle11g 11.2.0.4]$ [WARNING] [INS-32016] The selected Oracle home contains 
directories or files.   CAUSE: The selected Oracle home contained directories or files.
   ACTION: To start with an empty Oracle home, either remove its contents or choose another location.
[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/OraInstall2023-06-26_04-20-51PM/installActions2023-06-26_04-20-51PM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2023-06-26_04-20-51PM/installActions2023-06-26_04-20-51PM.log. Then either from the log file or from i
nstallation manual find the appropriate configuration to meet the prerequisites and fix it manually.You can find the log of this install session at:
 /u01/oracle/oraInventory/logs/installActions2023-06-26_04-20-51PM.log
Prepare in progress.
..................................................   9% Done.
Prepare successful.
Copy files in progress.
..................................................   14% Done.
..................................................   20% Done.
..................................................   26% Done.
..................................................   31% Done.
..................................................   36% Done.
..................................................   41% Done.
..................................................   46% Done.
..................................................   51% Done.
..................................................   56% Done.
..................................................   63% Done.
..................................................   68% Done.
..................................................   73% Done.
..................................................   78% Done.
..................................................   83% Done.
..............................
Copy files successful.
Link binaries in progress.
..........
Link binaries successful.
Setup files in progress.
..................................................   88% Done.
..................................................   94% Done.
Setup files successful.
The installation of Oracle Database 11g was successful.
Please check '/u01/oracle/oraInventory/logs/silentInstall2023-06-26_04-20-51PM.log' for more details.
Execute Root Scripts in progress.
As a root user, execute the following script(s):
1. /u01/oracle/oraInventory/orainstRoot.sh
2. /u01/oracle/app/oracle/product/11.2.0.4/root.sh
..................................................   100% Done.
Execute Root Scripts successful.
Successfully Setup Software.
[oracle@oracle11g 11.2.0.4]$

10.执行sh脚本( 不需要执行sh脚本)


11.创建和启动监听(默认配置文件)

[oracle@oracle11g 11.2.0.4]$ netca -silent -responsefile /u01/oracle/app/oracle/product/11.2.0.4/response/netca.rsp 
Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /u01/oracle/app/oracle/product/11.2.0.4/response/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
    Running Listener Control: 
      /u01/oracle/app/oracle/product/11.2.0.4/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
[oracle@oracle11g 11.2.0.4]$ netstat -antulp | grep 1521
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp6 0 0 :::1521 :::* LISTEN 25831/tnslsnr
[oracle@oracle11g 11.2.0.4]$

12.创建数据库(也可以编辑dbca.rsp文件)

[oracle@oracle11g 11.2.0.4]$ grep -v '^#' response/dbca.rsp | grep -v '^$'
[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = " orcl.us.oracle.com"
SID = "orcl"
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 = " orcl.us.oracle.com"
NODELIST=
SYSDBAUSERNAME = "sys"
[DELETEINSTANCE]
DB_UNIQUE_NAME = " orcl.us.oracle.com"
INSTANCENAME = "orcl"
SYSDBAUSERNAME = "sys"
[oracle@oracle11g 11.2.0.4]$ dbca -silent -responseFile /u01/oracle/app/oracle/product/11.2.0.4/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/oracle/cfgtoollogs/dbca/orcl11g/orcl11g.log" for further details.
[oracle@oracle11g 11.2.0.4]$

13.登陆数据库

[oracle@oracle11g 11.2.0.4]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 26 17:25:36 2023
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from dual;
D
-
X
SQL>

14.命令历史记录工具

[root@oracle11g ~]# wget https://fossies.org/linux/privat/rlwrap-0.46.1.tar.gz
[root@oracle11g ~]# tar xvf rlwrap-0.46.1.tar.gz
[root@oracle11g ~]# cd rlwrap-0.46.1/
[root@oracle11g rlwrap-0.46.1]# yum install readline-*
[root@oracle11g rlwrap-0.46.1]# ./configure
[root@oracle11g rlwrap-0.46.1]# make
[root@oracle11g rlwrap-0.46.1]# make install
[root@oracle11g rlwrap-0.46.1]# vim /home/oracle/.bash_profile
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
[root@oracle11g rlwrap-0.46.1]# su - oracle
Last login: Mon Jun 26 17:10:53 CST 2023 on pts/0
[oracle@oracle11g ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Jun 26 17:39:58 2023
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from dual;
D
-
X
SQL>


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25854343/viewspace-1425183/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 静默安装oracle 21C
请登录后发表评论 登录
全部评论

注册时间:2014-03-31

  • 博文量
    79
  • 访问量
    486682