ITPub博客

首页 > 数据库 > Oracle > 静默安装oracle 21C

静默安装oracle 21C

原创 Oracle 作者:z597011036 时间:2015-01-26 14:49:21 0 删除 编辑

1.安装依赖包

[root@vm172-16-2-233 ~]# yum -y install compat-libcap1 compat-libstdc++-33 elfutils-libelf-devel fontconfig-devel glibc-devel ksh libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libstdc++-devel libxcb smartmontools sysstat

2.创建用户和用户组

[root@vm172-16-2-233 ~]# groupadd oinstall
[root@vm172-16-2-233 ~]# groupadd dba
[root@vm172-16-2-233 ~]# useradd -g oinstall oracle

3.配置内核参数

[root@vm172-16-2-233 ~]# vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 16451328
kernel.shmmax = 33692319744
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@vm172-16-2-233 ~]# sysctl -p

4.配置文件打开数限制

[root@vm172-16-2-233 ~]# vim /etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle hard nproc 16384
oracle soft nproc 2047
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 3145728
oracle soft memlock 3145728
[root@vm172-16-2-233 ~]#

5.修改用户登陆限制

[root@vm172-16-2-233 ~]# vim /etc/pam.d/login
session required /lib/security/ pam_limits.so
[root@vm172-16-2-233 ~]# 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@vm172-16-2-233 ~]#

6.创建安装目录

[root@vm172-16-2-233 ~]# mkdir -p /export/oracle/app/oracle/product/21.3.0
[root@vm172-16-2-233 ~]# mkdir -p /export/oracle/oraInventory
[root@vm172-16-2-233 ~]# chown -R oracle:oinstall /export/oracle

7.配置环境变量

[root@vm172-16-2-233 ~]# vim /home/oracle/.bash_profile
export ORACLE_BASE=/export/oracle/
export ORACLE_HOME=$ORACLE_BASE/app/oracle/product/21.3.0
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
[root@vm172-16-2-233 ~]#

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

[root@vm172-16-2-233 ~]# su - oracle
Last login: Fri May 26 18:04:29 CST 2023 on pts/1
[oracle@vm172-16-2-233 ~]$ unzip LINUX.X64_213000_db_home.zip -d $ORACLE_HOME
[oracle@vm172-16-2-233 ~]$ cd $ORACLE_HOME
[oracle@vm172-16-2-233 21.3.0]$ grep -v '#' install/response/db_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v21.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/export/oracle/oraInventory
ORACLE_HOME=/export/oracle/app/oracle/product/21.3.0
ORACLE_BASE=/export/oracle/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=oinstall
oracle.install.db.OSOPER_GROUP=oinstall
oracle.install.db.OSBACKUPDBA_GROUP=oinstall
oracle.install.db.OSDGDBA_GROUP=oinstall
oracle.install.db.OSKMDBA_GROUP=oinstall
oracle.install.db.OSRACDBA_GROUP=oinstall
oracle.install.db.rootconfig.executeRootScript=false
oracle.install.db.config.starterdb.globalDBName=orcl
oracle.install.db.config.starterdb.SID=orcl
oracle.install.db.config.starterdb.characterSet=AL32UTF8
[oracle@vm172-16-2-233 21.3.0]$

9.安装oracle数据库软件

[oracle@vm172-16-2-233 21.3.0]$ ./runInstaller -silent -responseFile install/response/db_install.rsp
Launching Oracle Database Setup Wizard...

[WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. installActions2023-05-26_06-48-34PM.log
   ACTION: Identify the list of failed prerequisite checks from the log: installActions2023-05-26_06-48-34PM.log. Then either from the log file or from installati
on manual find the appropriate configuration to meet the prerequisites and fix it manually.The response file for this session can be found at:
 /export/oracle/app/oracle/product/21.3.0/install/response/db_2023-05-26_06-48-34PM.rsp

You can find the log of this install session at:
 /tmp/InstallActions2023-05-26_06-48-34PM/installActions2023-05-26_06-48-34PM.log

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

Execute /export/oracle/oraInventory/orainstRoot.sh on the following nodes: 
[vm172-16-2-233]
Execute /export/oracle/app/oracle/product/21.3.0/root.sh on the following nodes: 
[vm172-16-2-233]

Successfully Setup Software with warning(s).
Moved the install session logs to:
 /export/oracle/oraInventory/logs/InstallActions2023-05-26_06-48-34PM
[oracle@vm172-16-2-233 21.3.0]$ 

10.执行sh脚本

[root@vm172-16-2-233 app]# sh /export/oracle/oraInventory/orainstRoot.sh
Changing permissions of /export/oracle/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /export/oracle/oraInventory to oinstall.
The execution of the script is complete.
[root@vm172-16-2-233 app]# sh /export/oracle/app/oracle/product/21.3.0/root.sh
Check /export/oracle/app/oracle/product/21.3.0/install/root_vm172-16-2-233.cloud.local_2023-05-26_19-03-13-739586237.log for the output of root script
[root@vm172-16-2-233 app]#

11.创建和启动监听

[oracle@vm172-16-2-233 21.3.0]$ cd assistants/netca/
[oracle@vm172-16-2-233 netca]$ cp -a netca.rsp netca.rsp.back
[oracle@vm172-16-2-233 netca]$ vim netca.rsp
[oracle@vm172-16-2-233 netca]$ netca /silent /responseFile /export/oracle/app/oracle/product/21.3.0/assistants/netca/netca.rsp
Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /export/oracle/app/oracle/product/21.3.0/assistants/netca/netca.rsp
Done 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
[oracle@vm172-16-2-233 netca]$ lsnrctl start          #启动监听服务
LSNRCTL for Linux: Version 21.0.0.0.0 - Production on 26-MAY-2023 19:40:49
Copyright (c) 1991, 2021, Oracle. All rights reserved.
Starting /export/oracle//app/oracle/product/21.3.0/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 21.0.0.0.0 - Production
Log messages written to /export/oracle/diag/tnslsnr/vm172-16-2-233/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vm172-16-2-233.cloud.local)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 21.0.0.0.0 - Production
Start Date 26-MAY-2023 19:40:50
Uptime 0 days 0 hr. 0 min. 40 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /export/oracle/diag/tnslsnr/vm172-16-2-233/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vm172-16-2-233.cloud.local)(PORT=1521)))
Services Summary...
Service "c8209f27c6b16005e053362ee80ae60e" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@vm172-16-2-233 dbca]$ 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.)
tcp 0 0 127.0.0.1:23451 127.0.0.1:1521 ESTABLISHED 11878/ora_lreg_orcl
tcp6 0 0 :::1521 :::* LISTEN 13998/tnslsnr
tcp6 0 0 127.0.0.1:1521 127.0.0.1:23455 TIME_WAIT -
tcp6 0 0 127.0.0.1:1521 127.0.0.1:23451 ESTABLISHED 13998/tnslsnr
[oracle@vm172-16-2-233 dbca]$

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

[oracle@vm172-16-2-233 netca]$ cd ../../assistants/dbca/
[oracle@vm172-16-2-233 dbca]$ dbca -silent -createDatabase -responseFile NO_VALUE -templateName General_Purpose.dbc -gdbname orcl -sid orcl -datafileDestination '
/export/oracle/app/oradata' -recoveryAreaDestination '/export/oracle/flash_recovery_area' -databaseType OLTP
Enter SYS user password:                  #输入SYS密码
Enter SYSTEM user password:          #输入SYSTEM密码
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 dig
it [0-9].b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 dig
it [0-9].b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Prepare for db operation
10% complete
Copying database files
40% complete
Creating and starting Oracle instance
42% complete
46% complete
52% complete
56% complete
60% complete
Completing Database Creation
66% complete
69% complete
70% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
/export/oracle/app/oracle/cfgtoollogs/dbca/orcl.
Database Information:
Global Database Name:orcl
System Identifier(SID):orcl
Look at the log file "/export/oracle/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.
[oracle@vm172-16-2-233 dbca]$

13.登陆数据库

[oracle@vm172-16-2-233 ~]$ sqlplus / as sysdba
SQL*Plus: Release 21.0.0.0.0 - Production on Fri May 26 19:54:35 2023
Version 21.3.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Connected to:
Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0
SQL> select * from dual;
ADDR INDX INST_ID CON_ID D
---------------- ---------- ---------- ---------- -
0000000016F6435C 0 1 0 X
SQL>


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

上一篇: hive 2.3.4环境搭建
下一篇: 静默安装oracle 11g
请登录后发表评论 登录
全部评论

注册时间:2014-03-31

  • 博文量
    79
  • 访问量
    486685