Oracle11G静默安装软件和建库

一、准备软件和补丁包

p13390677_112040_Linux-x86-64_1of7.zip

p13390677_112040_Linux-x86-64_2of7.zip

p6880880_112000_Linux-x86-64.zip

p26925576_112040_Linux-x86-64.zip

 

二、静默安装数据库软件

解压数据库软件包,在 /database/response 下面有一个 db_install.rsp 

主要做如下修改

oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=pc    #用hostname命令查看
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.installer.autoupdates.option=SKIP_UPDATES
DECLINE_SECURITY_UPDATES=true

*注意等号后面没有空格

--执行安装脚本

/soft/database/runInstaller -silent -responsefile /database/response/db_install.rsp -ignoresysprereqs -showProgress

--其中-silent 指的是静默安装, showProgress 显示进度, responseFile 是种子文件

--执行命令后,在最后需要执行脚本的时候报错了

Execute Root Scripts in progress.

As a root user, execute the following script(s):
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/oracle/product/11.2.0.4/db_1/root.sh


.................................................. 100% Done.

Execute Root Scripts successful.
Successfully Setup Software.

--报错信息如下

[root@pc ~]# cat /u01/app/oracle/product/11.2.0.4/db_1/install/root_pc_2020-04-22_16-09-36.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.4/db_1
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed 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.
/u01/app/oracle/product/11.2.0.4/db_1/root.sh: line 14: /u01/app/oracle/product/11.2.0.4/db_1/rdbms/install/rootadd_rdbms.sh: No such file or directory
/u01/app/oracle/product/11.2.0.4/db_1/root.sh: line 16: /u01/app/oracle/product/11.2.0.4/db_1/rdbms/install/rootadd_filemap.sh: No such file or directory

---最终找到原因!!!竟然是软件包有问题;导致解压后/database 有问题;上面安装进度,产生的文件大小是 du -sh /u01/app  2.4G ;正确安装应该是4.2G或者4.3G

--解压的软件包有问题,当时解压的文件大小是 1.4G;正常解压完/database 应该是2.5G;


--安装完成后可以测试登陆数据库


[oracle@pc ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Apr 22 18:07:39 2020

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

Connected to an idle instance.

SQL>
SQL> exit
Disconnected
[oracle@pc ~]$

---主库静默DBCA建库:
/u01/app/oracle/product/11.2.0.4/db_1/bin/dbca -silent -createDatabase -templateName /u01/app/oracle/product/11.2.0.4/db_1/assistants/dbca/templates/General_Purpose.dbc -gdbName pcc -sid pc -sysPassword oracle -systemPassword oracle -emConfiguration LOCAL -dbsnmpPassword oracle -sysmanPassword oracle -characterSet ZHS16GBK

--报错如下:

[root@pc soft]# cat /u01/app/oracle/cfgtoollogs/dbca/pc/pc.log
Copying database files
DBCA_PROGRESS : 1%
DBCA_PROGRESS : 2%
ORA-27102: out of memory

DBCA_PROGRESS : 4%
DBCA_PROGRESS : 11%
DBCA_PROGRESS : 12%
ORA-01034: ORACLE not available

ORA-01034: ORACLE not available

DBCA_PROGRESS : 100%

vi /etc/sysctl.conf

 

shmall 是全部允许使用的共享内存大小,
shmmax 是单个段允许使用的大小。这两个可以设置为内存的 90%。例如 16G 内存,16*1024*1024*1024*90% = 15461882265 ,
shmall 的大小为 15461882265/4k(getconf PAGESIZE可得到) = 3774873 。
修改 /etc/sysctl.conf
kernel.shmmax=15461882265
kernel.shmall=3774873
kernel.msgmax=65535
kernel.msgmnb=65535
执行 sudo sysctl -p
可以使用 ipcs -l 看结果。ipcs -u 可以看到实际使用的情况

--此服务器实际内存8G

修改后参数如下:

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

vm.swappiness=0


重新运行建库即可。

 

/u01/app/oracle/product/11.2.0.4/db_1/bin/dbca -silent -createDatabase -templateName /u01/app/oracle/product/11.2.0.4/db_1/assistants/dbca/templates/General_Purpose.dbc -gdbName pcc -sid pc -sysPassword oracle -systemPassword oracle -emConfiguration LOCAL -dbsnmpPassword oracle -sysmanPassword oracle -characterSet ZHS16GBK

 

各参数含义如下:

-silent 表示以静默方式安装

-responseFile 表示使用哪个响应文件,必需使用绝对路径

RESPONSEFILE_VERSION 响应文件模板的版本,该参数不要更改

OPERATION_TYPE 安装类型,该参数不要更改

GDBNAME 全局数据库名,点号前面默认是db_name,点号后面默认就是db_domain

TEMPLATENAME 建库模板名,参考各模板定义:$ORACLE_HOME/assistants/dbca/templates/*.dbc

CHARACTERSET 字符集,默认是WE8MSWIN1252

TOTALMEMORY 实例内存,默认是服务器物理内存的40%

 --系统参数调整

---修改影响系统SSH 时间的参数
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak

vi /etc/ssh/sshd_config
GSSAPIAuthentication 赋值为no

ClientAliveInterval 60
ClientAliveCountMax 3

查找UseDNS,赋值为 no(该项默认不启用的,要把前面的#删除掉)

UseDNS=no

systemctl restart sshd

 

posted @ 2020-04-24 09:42  钱若梨花落  阅读(607)  评论(0编辑  收藏  举报