centos 7.4靜默安裝oracle 19.3

z597011036發表於2021-05-23

1.安裝依賴軟體包
[root@test02 ~]# yum -y install libaio libaio*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 libXp xhost unzip zip libXtst libXp*.i686 libXt*.i686 xterm xdpyinfo smartmontools-* readline-devel*

2.修改系統核心引數
[root@test02 ~]# vim /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
fs.file-max = 6815744
fs.aio-max-nr = 1048576
[root@test02 ~]# 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@test02 ~]#

3.建立使用者和新增環境變數
[root@test02 ~]# groupadd oinstall
[root@test02 ~]# groupadd dba
[root@test02 ~]# useradd -g oinstall -G dba oracle
[root@test02 ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.
[root@test02 ~]# mkdir /data/app/oracle/product/12.2.3/db_1 -p
[root@test02 ~]# chown  -R oracle:oinstall /u01/
[root@test02 ~]# vim /etc/profile
export ORACLE_BASE=/data/app/oracle
export ORACLE_HOME=/data/app/oracle/product/12.2.3/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin
[root@test02 ~]# . /etc/profile

4.安裝資料庫軟體
[root@test02 ~]# xhost +
xhost:  unable to open display ""
[root@test02 ~]# su oracle
[oracle@test02 ~]$ cd /data/LINUX.X64_193000_db_home/
[oracle@test02 LINUX.X64_193000_db_home]$ unzip LINUX.X64_193000_db_home.zip -d $ORACLE_HOME  --必須解壓到$ORACLE_HOME目錄,否則安裝報錯。
[oracle@test02 LINUX.X64_193000_db_home]$ cd /data/app/oracle/product/12.2.3/db_1/install/response/
[oracle@test02 response]$ vim db_install.rsp   --配置檔案中ORACLE_HOME和ORACLE_BASE註釋,否則安裝報錯。
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/data/app/oracle/oraInventory
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=dba
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
oracle.install.db.rootconfig.executeRootScript=false
oracle.install.db.rootconfig.configMethod=ROOT
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=orcl
oracle.install.db.config.starterdb.SID=orcl
oracle.install.db.ConfigureAsContainerDB=true
oracle.install.db.config.PDBName=orcl
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=false
oracle.install.db.config.starterdb.installExampleSchemas=true
oracle.install.db.config.starterdb.password.ALL=System135
oracle.install.db.config.starterdb.managementOption=DEFAULT
[oracle@test02 db_1]$ ./runInstaller -silent -ignorePrereq -responseFile  install/response/db_install.rsp
Launching Oracle Database Setup Wizard...
[WARNING] [INS-32047] The location (/data/app/oracle/oraInventory) specified for the central inventory is not empty.
   ACTION: It is recommended to provide an empty location for the inventory.
[WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
   ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
[WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. installActions2021-05-24_06-14-47AM.log
   ACTION: Identify the list of failed prerequisite checks from the log: installActions2021-05-24_06-14-47AM.log. Then either from the log file or from installation
manual find the appropriate configuration to meet the prerequisites and fix it manually.The response file for this session can be found at:
 /data/app/oracle/product/12.2.3/db_1/install/response/db_2021-05-24_06-14-47AM.rsp
You can find the log of this install session at:
 /tmp/InstallActions2021-05-24_06-14-47AM/installActions2021-05-24_06-14-47AM.log
As a root user, execute the following script(s):
 1. /data/app/oracle/oraInventory/orainstRoot.sh
 2. /data/app/oracle/product/12.2.3/db_1/root.sh
Execute /data/app/oracle/oraInventory/orainstRoot.sh on the following nodes:
[test02]
Execute /data/app/oracle/product/12.2.3/db_1/root.sh on the following nodes:
[test02]


Successfully Setup Software with warning(s).
Moved the install session logs to:
 /data/app/oracle/oraInventory/logs/InstallActions2021-05-24_06-14-47AM
[oracle@test02 db_1]$ exit
exit
[root@test02 db_1]# sh /data/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /data/app/oracle/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /data/app/oracle/oraInventory to oinstall.
The execution of the script is complete.
[root@test02 db_1]# sh /data/app/oracle/product/12.2.3/db_1/root.sh
Check /data/app/oracle/product/12.2.3/db_1/install/root_test02_2021-05-24_06-17-57-999062101.log for the output of root script
[root@test02 db_1]#

5.建立監聽
[oracle@test02 db_1]$ egrep -v "^#|^$" assistants/netca/netca.rsp
[GENERAL]
RESPONSEFILE_VERSION="19.0"
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@test02 db_1]$ netca -silent -force -responsefile /data/app/oracle/product/12.2.3/db_1/assistants/netca/netca.rsp
Parsing command line arguments:
    Parameter "silent" = true
Wrong command line argument passed: "force"
    Parameter "responsefile" = /data/app/oracle/product/12.2.3/db_1/assistants/netca/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
    Running Listener Control:
      /data/app/oracle/product/12.2.3/db_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@test02 db_1]$

6.建立資料庫
[oracle@test02 db_1]$ egrep -v "^#|^$" assistants/dbca/dbca.rsp
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v19.0.0
gdbName=orcl
sid=orcl
databaseConfigType=SI
createAsContainerDatabase=true
numberOfPDBs=1
pdbName=pdb1
useLocalUndoForPDBs=TRUE
pdbAdminPassword=System135
templateName=General_Purpose.dbc
sysPassword=System135
systemPassword=System135
emExpressPort=5500
databaseType=MULTIPURPOSE
[oracle@test02 db_1]$
[oracle@test02 db_1]$ dbca -silent -createDatabase -responsefile /data/app/oracle/product/12.2.3/db_1/assistants/dbca/dbca.rsp
Enter SYSTEM user password:
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
53% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /data/app/oracle/cfgtoollogs/dbca/orcl.
Database Information:
Global Database Name:orcl
System Identifier(SID):orcl
Look at the log file "/data/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.
[oracle@test02 db_1]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon May 24 07:09:25 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle.  All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> set linesize 2000
SQL> select * from v$version;
BANNER    BANNER_FULL             
 BANNER_LEGACY                CON_ID-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------
---------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production   Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production      
 Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production      0           Version 19.3.0.0.0
SQL>


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25854343/viewspace-2773569/,如需轉載,請註明出處,否則將追究法律責任。

相關文章