靜默安裝Oracle12.2資料庫

迷倪小魏發表於2017-07-10

實驗環境:

作業系統:Redhat 6.4 64

數  據 庫:Oracle 12c R2

 

一、 安裝前準備

1、 建立使用者和組

[root@wjq ~]# groupadd -g 1000 oinstall  

//oinstall組:是清單目錄組(Oracle Inventory group),用於管理清單目錄(Inventory)

[root@wjq ~]# groupadd -g 1001 dba       //dba組:用於資料庫管理

[root@wjq ~]# useradd -u 600 -g oinstall -G dba oracle

[root@wjq ~]# passwd oracle

Changing password for user oracle.

New password:

BAD PASSWORD: it is based on a dictionary word

BAD PASSWORD: is too simple

Retype new password:

passwd: all authentication tokens updated successfully.


2、 建立目錄

[root@wjq ~]# mkdir -p /u01/app/oracle/product/12.2.0/dbhome_1

[root@wjq ~]# chown -R oracle:oinstall /u01

[root@wjq ~]# chmod -R 775 /u01/app/oracle


3、 檢視實體記憶體、交換空間和檔案系統大小

[root@wjq ~]# free -m

             total       used       free     shared    buffers     cached

Mem:        3016        358       2657      0        19        158

-/+ buffers/cache:          180       2835

Swap:        3023          0       3023

 [root@wjq ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/vg_wjq-lv_root

                       26G  2.8G   22G  12% /

tmpfs                 1.5G   72K  1.5G   1% /dev/shm

/dev/sda1             485M   38M  423M   9% /boot

/dev/mapper/vg_wjq-lv_home

                      4.0G  137M  3.7G   4% /home

/dev/mapper/vg_wjq-lv_u01

                       66G  180M   62G   1% /u01

4、 檢視作業系統架構

[root@wjq ~]# cat /proc/version

Linux version 2.6.32-358.el6.x86_64 (mockbuild@x86-022.build.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Tue Jan 29 11:47:41 EST 2013

 [root@wjq ~]# lsb_release -a

LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch

Distributor ID: RedHatEnterpriseServer

Description:    Red Hat Enterprise Linux Server release 6.4 (Santiago)

Release:        6.4

Codename:       Santiago

[root@wjq ~]# uname -r

2.6.32-358.el6.x86_64


5、 安裝軟體包

binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6.i686
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-2.12-1.7.el6 (i686)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6.i686
ksh
libgcc-4.4.4-13.el6 (i686)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6.i686
libstdc++-devel-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6.i686
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6.i686
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6.i686
libXext-1.1 (x86_64)
libXext-1.1 (i686)
libXtst-1.0.99.2 (x86_64)
libXtst-1.0.99.2 (i686)
libX11-1.3 (x86_64)
libX11-1.3 (i686)
libXau-1.0.5 (x86_64)
libXau-1.0.5 (i686)
libxcb-1.5 (x86_64)
libxcb-1.5 (i686)
libXi-1.3 (x86_64)
libXi-1.3 (i686)
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)


6、 禁用SELinux和防火牆

[root@wjq sofrware]# vim /etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

SELINUX=disabled

# SELINUXTYPE= can take one of these two values:

#     targeted - Targeted processes are protected,

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted


SELinux 的不正確配置會影響網路

(1)enforcing --- SELinux security policy is enforced.代表記錄警告且阻止可疑行為
(2)permissive --- SELinux prints warnings instead of
代表僅記錄安全警告但不阻止可疑行為
(3)disabled --- SELinux is fully disabled.SELinux
被禁用

SELINUXTYPE
設定
(1)targeted
代表僅針對預製的幾種網路服務和訪問請求使用 SELinux 保護,
(2)strict
代表所有網路服務和訪問請求都要經過 SELinux


檢視當前系統的安全策略

[root@wjq ~]# sestatus 

SELinux status:                 disabled

[root@wjq ~]# getenforce

Disabled


[root@wjq sofrware]# service iptables stop

iptables: Flushing firewall rules:                         [  OK  ]

iptables: Setting chains to policy ACCEPT: filter            [  OK  ]

iptables: Unloading modules:                            [  OK  ]

[root@wjq sofrware]# chkconfig iptables off


7、 解壓安裝包,設定環境變數

[root@wjq sofrware]#unzip linuxx64_12201_database.zip

[oracle@wjq ~]$ vim .bash_profile

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1

export ORACLE_SID=seiang

export ORACLE_OWNER=oracle

export ORACLE_TERM=vt100

export PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin

export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH

export BASE_PATH=/usr/sbin:$PATH; export BASE_PATH

export PATH=$ORACLE_HOME/bin:$BASE_PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib

export ORACLE_HOSTNAME=wjq.comsys.com

export DB_UNIQUE_NAME=prod

export CVUQDISK_GRP=oinstall

umask 022

[oracle@wjq ~]$ source .bash_profile

 

8、 設定核心引數

[root@wjq sofrware]# vim /etc/sysctl.conf

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 2097152

kernel.shmmax = 1349242060

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=1048586

[root@wjq sofrware]# sysctl –a   //讓核心引數檔案立即生效


shmmax=實體記憶體*80%*80%,單位是位元組
kernel.shmmax
:表示單個共享記憶體段的最大值,以位元組為單位,此值一般為實體記憶體的一半,不過大一點也沒關係,這裡設定的為4GB,即“4294967295/1024/1024/1024=4G”。
kernel.shmmin
:表示單個共享記憶體段的最小值,預設為1byte
kernel.shmall
:表示整個系統範圍內可用共享記憶體頁的總量,單位是頁(page),在32位系統上一頁等於4kB,也就是4096位元組。計算公式是:shmmax/PAGE_SIZE
kernel.shmmni
:表示整個系統範圍內記憶體段的最大數量,一般為4096.
ip_local_port_range  
:表示埠的範圍。在監聽器幫助客戶端程式和伺服器程式建立連線時,會用到指定範圍內的埠。
kernel.sem  
:表示設定的訊號量,這4個引數內容大小固定。
net.core.rmem_default  
:表示接收套接字緩衝區大小的預設值(以位元組為單位)。
net.core.rmem_max  
:表示接收套接字緩衝區大小的最大值(以位元組為單位)
net.core.wmem_default  
:表示傳送套接字緩衝區大小的預設值(以位元組為單位)。
net.core.wmem_max  
:表示傳送套接字緩衝區大小的最大值(以位元組為單位)。



9、 修改資源控制檔案

[root@wjq sofrware]# vim /etc/security/limits.conf

oracle               soft    nproc   2047
oracle               hard    nproc   16384
oracle               soft    nofile  1024
oracle               hard    nofile  65536


資源限制是針對單個程式的限制,不是針對整個系統總的設定
修改limits.conf以後,將馬上生效。但是,如果使用者已經登入系統,那麼對於該使用者的限制將在下一次使用者重新登入以後才生效。如果要讓對該使用者的限制生效,只能讓該使用者登出然後重新登入就可以了。
/etc/security/limits.conf
    core -
限制核心檔案的大小
  date - 最大資料大小
  fsize - 最大檔案大小
  memlock - 最大鎖定記憶體地址空間
  nofile - 開啟檔案的最大數目
  rss - 最大持久設定大小
  stack - 最大棧大小
  cpu - 以分鐘為單位的最多 CPU 時間
  noproc - 程式的最大數目
  as - 地址空間限制
  maxlogins - 此使用者允許登入的最大數目

nofile - 開啟檔案的最大數目,該值不能等於/proc/sys/fs/file-max,如果等於file-max且開啟的檔案控制程式碼的數量達到file-max,使用者將不能登陸作業系統。


二、安裝Oracle軟體

1、 相應檔案模板的存放位置

[root@wjq sofrware]# find / -name *.rsp

/u01/sofrware/database/response/netca.rsp

/u01/sofrware/database/response/db_install.rsp

/u01/sofrware/database/response/dbca.rsp


2、 瀏覽響應檔案內容,並編輯響應檔案

[root@wjq response]# ll

total 64

drwxr-xr-x 2 root root  4096 Jul  5 16:32 backup.rsp

-rwxrwxr-x 1 root root 25502 Jan  5 14:00 dbca.rsp

-rw-rw-r-- 1 root root 22924 Jan 26 21:44 db_install.rsp

-rwxrwxr-x 1 root root  6209 Jun 20  2016 netca.rsp


瀏覽響應檔案內容

[oracle@wjq database]$ sed -n '/^[^#]/p' response/db_install.rsp

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.2.0

oracle.install.option=

UNIX_GROUP_NAME=

INVENTORY_LOCATION=

ORACLE_HOME=

ORACLE_BASE=

oracle.install.db.InstallEdition=

oracle.install.db.OSDBA_GROUP=

oracle.install.db.OSOPER_GROUP=

oracle.install.db.OSBACKUPDBA_GROUP=

oracle.install.db.OSDGDBA_GROUP=

oracle.install.db.OSKMDBA_GROUP=

oracle.install.db.OSRACDBA_GROUP=

oracle.install.db.rac.configurationType=

oracle.install.db.CLUSTER_NODES=

oracle.install.db.isRACOneInstall=false

oracle.install.db.racOneServiceName=

oracle.install.db.rac.serverpoolName=

oracle.install.db.rac.serverpoolCardinality=

oracle.install.db.config.starterdb.type=

oracle.install.db.config.starterdb.globalDBName=

oracle.install.db.config.starterdb.SID=

oracle.install.db.ConfigureAsContainerDB=

oracle.install.db.config.PDBName=

oracle.install.db.config.starterdb.characterSet=

oracle.install.db.config.starterdb.memoryOption=

oracle.install.db.config.starterdb.memoryLimit=

oracle.install.db.config.starterdb.installExampleSchemas=

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.DBSNMP=

oracle.install.db.config.starterdb.password.PDBADMIN=

oracle.install.db.config.starterdb.managementOption=

oracle.install.db.config.starterdb.omsHost=

oracle.install.db.config.starterdb.omsPort=

oracle.install.db.config.starterdb.emAdminUser=

oracle.install.db.config.starterdb.emAdminPassword=

oracle.install.db.config.starterdb.enableRecovery=

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=

PROXY_HOST=

PROXY_PORT=

PROXY_USER=

PROXY_PWD=

COLLECTOR_SUPPORTHUB_URL=


編輯Oracle資料庫軟體響應檔案db_install.rsp

[root@wjq response]# vim db_install.rsp

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.2.0

oracle.install.option=INSTALL_DB_SWONLY

UNIX_GROUP_NAME=oinstall

INVENTORY_LOCATION=/u01/app/oraInventory

ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1

ORACLE_BASE=/u01/app/oracle

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.rac.configurationType=

oracle.install.db.CLUSTER_NODES=

oracle.install.db.isRACOneInstall=false

oracle.install.db.racOneServiceName=

oracle.install.db.rac.serverpoolName=

oracle.install.db.rac.serverpoolCardinality=

oracle.install.db.config.starterdb.type=

oracle.install.db.config.starterdb.globalDBName=

oracle.install.db.config.starterdb.SID=

oracle.install.db.ConfigureAsContainerDB=

oracle.install.db.config.PDBName=

oracle.install.db.config.starterdb.characterSet=

oracle.install.db.config.starterdb.memoryOption=

oracle.install.db.config.starterdb.memoryLimit=

oracle.install.db.config.starterdb.installExampleSchemas=

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.DBSNMP=

oracle.install.db.config.starterdb.password.PDBADMIN=

oracle.install.db.config.starterdb.managementOption=

oracle.install.db.config.starterdb.omsHost=

oracle.install.db.config.starterdb.omsPort=

oracle.install.db.config.starterdb.emAdminUser=

oracle.install.db.config.starterdb.emAdminPassword=

oracle.install.db.config.starterdb.enableRecovery=

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=false

DECLINE_SECURITY_UPDATES=true

PROXY_HOST=

PROXY_PORT=

PROXY_USER=

PROXY_PWD=

COLLECTOR_SUPPORTHUB_URL=


3、 獲取幫助,啟動靜默安裝

在靜默安裝Oracle軟體之前,如果沒有配置/etc/hosts檔案,將會出現如五(1)的錯誤。

[oracle@wjq database]$ ./runInstaller –help

[oracle@wjq database]$ ./runInstaller -silent -ignoreSysPrereqs -ignorePrereq -responseFile /u01/sofrware/database/response/db_install.rsp

Starting Oracle Universal Installer...


Checking Temp space: must be greater than 500 MB.   Actual 18788 MB    Passed

Checking swap space: must be greater than 150 MB.   Actual 3023 MB    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-07-06_02-07-35PM. Please wait ...[oracle@wjq database]$ You can find the log of this install session at:

 /u01/app/oraInventory/logs/installActions2017-07-06_02-07-35PM.log


The installation of Oracle Database 12c was successful.

Please check '/u01/app/oraInventory/logs/silentInstall2017-07-06_02-07-35PM.log' for more details.


As a root user, execute the following script(s):

        1. /u01/app/oraInventory/orainstRoot.sh

        2. /u01/app/oracle/product/12.2.0/dbhome_1/root.sh


Successfully Setup Software.


-silent             表示靜默安裝
-noconfig         
表示只安裝軟體
-responseFile     
指定響應檔案


4、 監控安裝過程所產生的日誌

[root@wjq response]# tail -f /u01/app/oraInventory/logs/installActions2017-07-06_02-07-35PM.log

INFO: Using paramFile: /u01/sofrware/database/install/oraparam.ini

INFO:

INFO:

INFO: Checking Temp space: must be greater than 500 MB.   Actual 18788 MB    Passed

INFO: Checking swap space: must be greater than 150 MB.   Actual 3023 MB    Passed

INFO:

INFO: The commandline for unzip:

INFO: /u01/sofrware/database/install/unzip -qqqo ../stage/Components/oracle.jdk/1.8.0.91.0/1/DataFiles/\*.jar -d

/tmp/OraInstall2017-07-06_02-07-35PM

INFO: Using the umask value '022' available from oraparam.ini

INFO: INFO: Oracle Universal Installer Version 12.2.0.1.4

INFO:

INFO: Execvp of the child jre : the cmdline is /tmp/OraInstall2017-07-06_02-07-35PM/jdk/jre/bin/java, and the arg

v is

INFO: /tmp/OraInstall2017-07-06_02-07-35PM/jdk/jre/bin/java

INFO: -Doracle.installer.library_loc=/tmp/OraInstall2017-07-06_02-07-35PM/oui/lib/linux64

INFO: -Doracle.installer.oui_loc=/tmp/OraInstall2017-07-06_02-07-35PM/oui

INFO: -Doracle.installer.bootstrap=TRUE

INFO: -Doracle.installer.startup_location=/u01/sofrware/database/install

INFO: -Doracle.installer.jre_loc=/tmp/OraInstall2017-07-06_02-07-35PM/jdk/jre

INFO: -Doracle.installer.nlsEnabled="TRUE"

INFO: -Doracle.installer.prereqConfigLoc=

INFO: -Doracle.installer.unixVersion=2.6.32-358.el6.x86_64

………

………

INFO: Completed executing action at state

INFO: Waiting for completion of background operations

INFO: Completed background operations

INFO: Waiting for completion of background operations

INFO: Completed background operations

INFO: Moved to state

INFO: Waiting for completion of background operations

INFO: Completed background operations

INFO: Validating state

WARNING: Validation disabled for the state finish

INFO: Completed validating state

INFO: Terminating all background operations

INFO: Terminated all background operations

INFO: Successfully executed the flow in SILENT mode

INFO: Dispose the current Session instance

INFO: Dispose the install area control object

INFO: Update the state machine to STATE_CLEAN

INFO: Finding the most appropriate exit status for the current application

INFO: Exit Status is 0

INFO: Shutdown Oracle Database 12c Release 2 Installer


5、安裝過程,以root使用者執行相應的指令碼

[root@wjq ~]# /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 script is complete.

[root@wjq ~]# /u01/app/oracle/product/12.2.0/dbhome_1/root.sh

Check /u01/app/oracle/product/12.2.0/dbhome_1/install/root_wjq.comsys.com_2017-07-06_14-23-00-707842960.log for the output of root script


三、 配置監聽器

1、 瀏覽Oracle監聽響應檔案netca.rsp

[oracle@wjq database]$ sed -n '/^[^#]/p' response/netca.rsp

[GENERAL]

RESPONSEFILE_VERSION="12.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"}


2、 編輯監聽器配置響應檔案netca.rsp

[oracle@wjq database]$ vim response/netca.rsp

[GENERAL]

RESPONSEFILE_VERSION="12.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"}

 

3、靜默安裝監聽器

[oracle@wjq database]$ $ORACLE_HOME/bin/netca -silent -responsefile /u01/sofrware/database/response/netca.rsp


Parsing command line arguments:

    Parameter "silent" = true

    Parameter "responsefile" = /u01/sofrware/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/12.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


4、檢視監聽狀態,並啟動監聽器

[oracle@wjq database]$ lsnrctl status


LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 06-JUL-2017 14:46:27


Copyright (c) 1991, 2016, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=wjq.comsys.com)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production

Start Date                06-JUL-2017 14:43:52

Uptime                    0 days 0 hr. 2 min. 34 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora

Listener Log File         /u01/app/oracle/diag/tnslsnr/wjq/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=wjq.comsys.com)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

The listener supports no services

The command completed successfully


四、建立資料庫

1、 瀏覽Oracle資料庫響應檔案dbca.rsp

[oracle@wjq database]$ sed -n '/^[^#]/p' response/dbca.rsp

responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0

gdbName=

sid=

databaseConfigType=

RACOneNodeServiceName=

policyManaged=

createServerPool=

serverPoolName=

cardinality=

force=

pqPoolName=

pqCardinality=

createAsContainerDatabase=

numberOfPDBs=

pdbName=

useLocalUndoForPDBs=

pdbAdminPassword=

nodelist=

templateName=

sysPassword=

systemPassword=

oracleHomeUserPassword=

emConfiguration=

emExpressPort=5500

runCVUChecks=

dbsnmpPassword=

omsHost=

omsPort=

emUser=

emPassword=

dvConfiguration=

dvUserName=

dvUserPassword=

dvAccountManagerName=

dvAccountManagerPassword=

olsConfiguration=

datafileJarLocation=

datafileDestination=

recoveryAreaDestination=

storageType=

diskGroupName=

asmsnmpPassword=

recoveryGroupName=

characterSet=

nationalCharacterSet=

registerWithDirService=

dirServiceUserName=

dirServicePassword=

walletPassword=

listeners=

variablesFile=

variables=

initParams=

sampleSchema=

memoryPercentage=

databaseType=

automaticMemoryManagement=

totalMemory=


2、 編輯響應檔案dbca.rsp

[oracle@wjq database]$ vim response/dbca.rsp                                                             responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0

gdbName=prod.comsys.com

sid=seiang

databaseConfigType=

RACOneNodeServiceName=

policyManaged=

createServerPool=

serverPoolName=

cardinality=

force=

pqPoolName=

pqCardinality=

createAsContainerDatabase=

numberOfPDBs=

pdbName=

useLocalUndoForPDBs=

pdbAdminPassword=

nodelist=

templateName=General_Purpose.dbc

sysPassword=oracle

systemPassword=oracle

oracleHomeUserPassword=oracle

emConfiguration=

emExpressPort=5500

runCVUChecks=

dbsnmpPassword=

omsHost=

omsPort=

emUser=

emPassword=

dvConfiguration=

dvUserName=

dvUserPassword=

dvAccountManagerName=

dvAccountManagerPassword=

olsConfiguration=

datafileJarLocation=

datafileDestination=

recoveryAreaDestination=

storageType=

diskGroupName=

asmsnmpPassword=

recoveryGroupName=

characterSet=

nationalCharacterSet=

registerWithDirService=

dirServiceUserName=

dirServicePassword=

walletPassword=

listeners=

variablesFile=

variables=

initParams=

sampleSchema=true

memoryPercentage=

databaseType=

automaticMemoryManagement=

totalMemory=


3、靜默建立資料庫

[oracle@wjq templates]$ $ORACLE_HOME/bin/dbca -silent -createDatabase -responseFile /u01/sofrware/database/response/dbca.rsp

[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 digit [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 digit [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.

Copying database files

1% complete

2% complete

18% complete

33% complete

Creating and starting Oracle instance

35% complete

40% complete

44% complete

49% complete

53% complete

54% complete

55% complete

58% complete

Completing Database Creation

59% complete

60% complete

61% complete

64% complete

68% complete

69% complete

Executing Post Configuration Actions

100% complete

Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/prod/prod.log" for further details.


3、測試例項是否註冊成功和能否登入到資料庫

[oracle@wjq database]$ lsnrctl status


LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 07-JUL-2017 15:05:17


Copyright (c) 1991, 2016, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=wjq.comsys.com)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production

Start Date                06-JUL-2017 14:43:52

Uptime                    1 days 0 hr. 21 min. 25 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora

Listener Log File         /u01/app/oracle/diag/tnslsnr/wjq/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=wjq.comsys.com)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Services Summary...

Service "prod.comsys.com" has 1 instance(s).

  Instance "seiang", status READY, has 1 handler(s) for this service...

Service "seiangXDB.comsys.com" has 1 instance(s).

  Instance "seiang", status READY, has 1 handler(s) for this service...

The command completed successfully


[oracle@wjq database]$ sqlplus / as sysdba


SQL*Plus: Release 12.2.0.1.0 Production on Fri Jul 7 15:06:40 2017


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



Connected to:

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


SQL>

SQL> select status from v$instance;


STATUS

------------

OPEN


至此,靜態安裝Oracle12.2結束,其他複雜引數的配置請參考Oracle官方文件!

 

 

五、遇到的錯誤以及解決方法

1、安裝Oracle軟體時報錯:PRVF-0002 : Could not retrieve local nodename.

檢視日誌資訊

[root@wjq ~]# tail -f  /tmp/OraInstall2017-07-06_01-49-38PM/installActions2017-07-06_01-49-38PM.log

INFO: Setting value for the property:configcmds in the bean:configcmdmappings

SEVERE: [FATAL] PRVF-0002 : could not retrieve local node name.

Refer associated stacktrace #oracle.install.commons.util.exception.AbstractErrorAdvisor:37

INFO: Advice is ABORT

SEVERE: Unconditional Exit

INFO: Adding ExitStatus FAILURE to the exit status set

WARNING: A log of this session is currently saved as: /tmp/OraInstall2017-07-06_01-49-38PM/installActions2017-07-06_01-49-38PM.log. Oracle recommends that if you want to keep this log, you should move it from the temporary location.

INFO: Finding the most appropriate exit status for the current application

INFO: Exit Status is -1

INFO: Shutdown Oracle Database 12c Release 2 Installer


猜測是找不到主機名的對應ip


解決辦法:

修改了下/etc/hosts

[root@wjq ~]# vim /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

10.1.1.45       wjq.comsys.com   wjq

 

 

2、安裝Oracle軟體時報錯:Invalid My Oracle Support credentials. Specify the correct email address and password that you use to log in to My Oracle Support.


檢視日誌資訊

[root@wjq ~]# tail -f /tmp/OraInstall2017-07-06_01-57-21PM/installActions2017-07-06_01-57-21PM.log

INFO: Waiting for completion of background operations

INFO: Completed background operations

INFO: Validating state

SEVERE: Invalid My Oracle Support credentials. Specify the correct email address and password that you use to log in to My Oracle Support.

After 2 more incorrect attempts, the product will be registered anonymously with the specified email address.

INFO: Adding ExitStatus VAR_VALIDATION_FAILURE to the exit status set

WARNING: A log of this session is currently saved as: /tmp/OraInstall2017-07-06_01-57-21PM/installActions2017-07-06_01-57-21PM.log. Oracle recommends that if you want to keep this log, you should move it from the temporary location.

INFO: Finding the most appropriate exit status for the current application

INFO: Exit Status is -2

INFO: Shutdown Oracle Database 12c Release 2 Installer


原因所在:

相應檔案db_install.rsp檔案中的引數MYORACLESUPPORT_USERNAME和MYORACLESUPPORT_PASSWORD配置的有問題


解決辦法:

這兩個引數不進行設定



3、 靜默建立資料庫時報錯:[DBT-10503] Invalid template file specified.

出現這個報錯資訊的原因是:dbcs.rsp響應檔案中的引數templateName配置出現錯誤,下面的這個東西就是我們們在建庫的時候選擇的模板,general purpose還是Data warehouing還是custom。這個東西在該路徑下$ORACLE_HOME/assistants/dbca/templates

[oracle@wjq ~]$ cd $ORACLE_HOME/assistants/dbca/templates

[oracle@wjq templates]$ ll

total 411616

-rw-r----- 1 oracle oinstall      4697 Jan 26 15:38 Data_Warehouse.dbc                   //資料倉儲的模板

-rw-r----- 1 oracle oinstall      4577 Jan 26 15:38 General_Purpose.dbc                    //標準的模板

-rw-r----- 1 oracle oinstall     10578 Jun 10  2016 New_Database.dbt                      //自定義的模板

-rw-r----- 1 oracle oinstall 121667584 Jan 26 15:30 pdbseed.dfb

-rw-r----- 1 oracle oinstall      6685 Jan 26 15:30 pdbseed.xml

-rw-r----- 1 oracle oinstall  18726912 Jan 26 15:37 Seed_Database.ctl                    //這個就是恢復的種子資料庫的控制檔案

-rw-r----- 1 oracle oinstall 281059328 Jan 26 15:37 Seed_Database.dfb                 //這個就是種子資料庫的備份片,加上控制檔案就能恢復出一個資料庫來


解決方法:

將dbca.rsp響應檔案中的引數按照如下的方式進行設定:templateName=General_Purpose.dbc

 

 

4、其他錯誤

特別要注意的是,等號兩邊不能有空格:
oracle.install.option=INSTALL_DB_SWONLY
 
DECLINE_SECURITY_UPDATES要設定成true
INFO: Adding ExitStatus VAR_VALIDATION_FAILURE to the exit status set


作者:SEian.G(苦練七十二變,笑對八十一難)

◇本文在ITPUBhttp://blog.itpub.net/31015730/

      51CTOhttp://seiang.blog.51cto.com/上有同步更新

◇本文itpub地址:http://blog.itpub.net/31015730/viewspace-2141874/

◇本文51CTO地址:http://seiang.blog.51cto.com/10819863/1946087


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

相關文章