Oracle 11g靜默安裝軟體+手工建立資料庫
由於是二次跳轉+遠程操作,無法使用圖形介面,不能直接圖形介面安裝。採用靜默安裝軟體+手工建立資料庫的方式完成需求。
1.靜默模式安裝Oracle軟體,配置監聽程式
2.手工建庫
3.檢查各組件是否符合要求
1. 靜默模式安裝Oracle軟體,配置監聽程式
這裡預設已經安裝了所有Oracle軟體依賴的安裝包,調整了作業系統的相關參數。
安裝軟體前的準備工作不清楚可參見:Linux平台oracle 11g單一實例 安裝部署配置 快速參考
解壓的資料庫安裝包,在database檔案夾中的response檔案夾下,有設定檔db_install.rsp,根據需求修改這個設定檔。
cd ./database/response/
db_install.rsp //安裝資料庫軟體
注意這個選項DECLINE_SECURITY_UPDATES=true,預設值為false,要改為true。
$ ./runInstaller -silent -force -ignorePrereq -ignoreSysPrereqs -responseFile /data/database/response/db_install.rsp
正在啟動 Oracle Universal Installer...
檢查臨時空間: 必須大於 120 MB。 實際為 8122 MB 通過
檢查交換空間: 必須大於 150 MB。 實際為 255999 MB 通過
準備從以下地址啟動 Oracle Universal Installer /tmp/OraInstall2015-07-09_01-40-01PM. 請稍候...[oracle@CRNOPHQDW12 database]$ [WARNING] [INS-32055] 主產品清單位於 Oracle 基目錄中。
原因: 主產品清單位於 Oracle 基目錄中。
操作: Oracle 建議將此主產品清單放置在 Oracle 基目錄之外的位置中。
可以在以下位置找到本次安裝會話的日誌:
/opt/app/oracle/oraInventory/logs/installActions2015-07-09_01-40-01PM.log
Oracle Database 11g 的 安裝 已成功。
請查看 '/opt/app/oracle/oraInventory/logs/silentInstall2015-07-09_01-40-01PM.log' 以擷取詳細資料。
以 root 使用者的身份執行以下指令碼:
1. /opt/app/oracle/oraInventory/orainstRoot.sh
2. /opt/app/oracle/product/11.2.0/dbhome_1/root.sh
Successfully Setup Software.
然後按提示root使用者執行2個指令碼,第2個指令碼執行結果參見工具提示給出的記錄檔。
db_install.rsp修改的內容參考(由於是只安裝軟體,有關資料庫的未修改):
#------------------------------------------------------------------------------
# Do not change the following system generated value.
#------------------------------------------------------------------------------
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
#------------------------------------------------------------------------------
# Specify the installation option.
# It can be one of the following:
# - INSTALL_DB_SWONLY
# - INSTALL_DB_AND_CONFIG
# - UPGRADE_DB
#-------------------------------------------------------------------------------
oracle.install.option=INSTALL_DB_SWONLY
#-------------------------------------------------------------------------------
# Specify the hostname of the system as set during the install. It can be used
# to force the installation to use an alternative hostname rather than using the
# first hostname found on the system. (e.g., for systems with multiple hostnames
# and network interfaces)
#-------------------------------------------------------------------------------
ORACLE_HOSTNAME=CRNOPHQDW12
#-------------------------------------------------------------------------------
# Specify the Unix group to be set for the inventory directory.
#-------------------------------------------------------------------------------
UNIX_GROUP_NAME=oinstall
#-------------------------------------------------------------------------------
# Specify the location which holds the inventory files.
# This is an optional parameter if installing on
# Windows based Operating System.
#-------------------------------------------------------------------------------
INVENTORY_LOCATION=/opt/app/oracle/oraInventory
#-------------------------------------------------------------------------------
# Specify the languages in which the components will be installed.
#
# en : English ja : Japanese
# fr : French ko : Korean
# ar : Arabic es : Latin American Spanish
# bn : Bengali lv : Latvian
# pt_BR: Brazilian Portuguese lt : Lithuanian
# bg : Bulgarian ms : Malay
# fr_CA: Canadian French es_MX: Mexican Spanish
# ca : Catalan no : Norwegian
# hr : Croatian pl : Polish
# cs : Czech pt : Portuguese
# da : Danish ro : Romanian
# nl : Dutch ru : Russian
# ar_EG: Egyptian zh_CN: Simplified Chinese
# en_GB: English (Great Britain) sk : Slovak
# et : Estonian sl : Slovenian
# fi : Finnish es_ES: Spanish
# de : German sv : Swedish
# el : Greek th : Thai
# iw : Hebrew zh_TW: Traditional Chinese
# hu : Hungarian tr : Turkish
# is : Icelandic uk : Ukrainian
# in : Indonesian vi : Vietnamese
# it : Italian
#
# all_langs : All languages
#
# Specify value as the following to select any of the languages.
# Example : SELECTED_LANGUAGES=en,fr,ja
#
# Specify value as the following to select all the languages.
# Example : SELECTED_LANGUAGES=all_langs
#------------------------------------------------------------------------------
SELECTED_LANGUAGES=en,zh_CN
#------------------------------------------------------------------------------
# Specify the complete path of the Oracle Home.
#------------------------------------------------------------------------------
ORACLE_HOME=/opt/app/oracle/product/11.2.0/dbhome_1
#------------------------------------------------------------------------------
# Specify the complete path of the Oracle Base.
#------------------------------------------------------------------------------
ORACLE_BASE=/opt/app/oracle
#------------------------------------------------------------------------------
# Specify the installation edition of the component.
#
# The value should contain only one of these choices.
# - EE : Enterprise Edition
# - SE : Standard Edition
# - SEONE : Standard Edition One
# - PE : Personal Edition (WINDOWS ONLY)
#------------------------------------------------------------------------------
oracle.install.db.InstallEdition=EE
#------------------------------------------------------------------------------
# This variable is used to enable or disable custom install and is considered
# only if InstallEdition is EE.
#
# true : Components mentioned as part of 'optionalComponents' property
# are considered for install.
# false : Value for 'optionalComponents' is not considered.
#------------------------------------------------------------------------------
oracle.install.db.EEOptionsSelection=false
#------------------------------------------------------------------------------
# This variable is considered only if 'EEOptionsSelection' is set to true.
#
# Description: List of Enterprise Edition Options you would like to enable.
#
# The following choices are available. You may specify any
# combination of these choices. The components you choose should
# be specified in the form "internal-component-name:version"
# Below is a list of components you may specify to enable.
#
# oracle.oraolap:11.2.0.4.0 - Oracle OLAP
# oracle.rdbms.dm:11.2.0.4.0 - Oracle Data Mining
# oracle.rdbms.dv:11.2.0.4.0 - Oracle Database Vault
# oracle.rdbms.lbac:11.2.0.4.0 - Oracle Label Security
# oracle.rdbms.partitioning:11.2.0.4.0 - Oracle Partitioning
# oracle.rdbms.rat:11.2.0.4.0 - Oracle Real Application Testing
#------------------------------------------------------------------------------
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,or
acle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0
#------------------------------------------------------------------------------
# The DBA_GROUP is the OS group which is to be granted OSDBA privileges.
#------------------------------------------------------------------------------
oracle.install.db.DBA_GROUP=dba
#------------------------------------------------------------------------------
# The OPER_GROUP is the OS group which is to be granted OSOPER privileges.
# The value to be specified for OSOPER group is optional.
#------------------------------------------------------------------------------
oracle.install.db.OPER_GROUP=
#------------------------------------------------------------------------------
# Specify whether user doesn't want to configure Security Updates.
# The value for this variable should be true if you don't want to configure
# Security Updates, false otherwise.
#
# The value can be either true or false. If left blank it will be assumed
# to be false.
#
# Example : DECLINE_SECURITY_UPDATES=false
#------------------------------------------------------------------------------
DECLINE_SECURITY_UPDATES=true
netca.rsp不需要修改,直接建立監聽
netca -silent -responsefile /data/database/response/netca.rsp
netca靜默建立監聽:
$ netca -silent -responsefile /data/database/response/netca.rsp
正在對命令列參數進行文法分析:
參數"silent" = true
參數"responsefile" = /data/database/response/netca.rsp
完成對命令列參數進行文法分析。
Oracle Net Services 配置:
完成概要檔案配置。
Oracle Net 監聽程式啟動:
正在運行監聽程式控制:
/opt/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start LISTENER
監聽程式控制完成。
監聽程式已成功啟動。
監聽程式配置完成。
成功完成 Oracle Net Services 配置。結束代碼是0
2. 手工建庫
建立參數檔案 $ORACLE_HOME/dbs/initcrnophq.ora
db_name=crnophq
memory_target=100G
建庫指令碼:
CREATE DATABASE crnophq
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
LOGFILE GROUP 1 ('/opt/app/oracle/oradata/crnophq/redo01a.log') SIZE 2000M BLOCKSIZE 512,
GROUP 2 ('/opt/app/oracle/oradata/crnophq/redo02a.log') SIZE 2000M BLOCKSIZE 512,
GROUP 3 ('/opt/app/oracle/oradata/crnophq/redo03a.log') SIZE 2000M BLOCKSIZE 512
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 1000
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/opt/app/oracle/oradata/crnophq/system01.dbf' SIZE 300M REUSE
SYSAUX DATAFILE '/opt/app/oracle/oradata/crnophq/sysaux01.dbf' SIZE 300M REUSE
DEFAULT TABLESPACE users
DATAFILE '/opt/app/oracle/oradata/crnophq/users01.dbf'
SIZE 5M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE temp
TEMPFILE '/opt/app/oracle/oradata/crnophq/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE undotbs
DATAFILE '/opt/app/oracle/oradata/crnophq/undotbs01.dbf'
SIZE 20M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
執行下面指令碼,建立資料字典和預存程序等
SQL> @?/rdbms/admin/catalog.sql
SQL> @?/rdbms/admin/catproc.sql
SQL> @?/sqlplus/admin/pupbld.sql
關於手工建庫,更多可以參見轉載的文章:Oracle 11g 手工建庫
3. 檢查各組件是否符合要求
col comp_name for a60
set linesize 1000
select comp_id, comp_name, version, status from sys.dba_registry;