Oracle 11g靜默安裝軟件+手工創建數據庫


由於是二次跳轉+遠程操作,無法使用圖形界面,不能直接圖形界面安裝。采用靜默安裝軟件+手工創建數據庫的方式完成需求。

  1. 靜默模式安裝Oracle軟件,配置監聽程序
  2. 手工建庫
  3. 檢查各組件是否符合要求

1. 靜默模式安裝Oracle軟件,配置監聽程序

這里默認已經安裝了所有Oracle軟件依賴的安裝包,調整了操作系統的相關參數。 安裝軟件前的准備工作不清楚可參見:[Linux平台oracle 11g單實例 安裝部署配置 快速參考](http://www.cnblogs.com/jyzhao/p/3891769.html)

解壓的數據庫安裝包,在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   --system用戶執行

關於手工建庫,更多可以參見轉載的文章:Oracle 11g 手工建庫

3. 檢查各組件是否符合要求

col comp_name for a40
set linesize 1000
select comp_id, comp_name, version, status from sys.dba_registry;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM