使用responseFile進行Oracle靜默安裝

來源:互聯網
上載者:User

我們通常使用的資料庫,都是基於圖形GUI介面進行的。在Windows和其他圖形化作業系統中,圖形互動式安裝時很方便的安裝手段。但是,在很多情況下,圖形互動式安裝時有很多的限制的。
 
首先,圖形GUI介面要求顯示圖形能力較強。對很多異地安裝需求或者無顯示介面的伺服器安裝過程,互動安裝時有一些困難的。
 
其次,很多實際營運人員在安裝時,是需要同時安裝多台機器,而且配置相同。逐個GUI互動安裝,工作量大且容易出錯。
 
針對這樣的情況,Oracle軟體產品在GUI圖形介面的安裝配置外,通常提供了靜默安裝silent和回應檔responseFile安裝模式。
 
注意:遠程Oracle安裝,除了使用silent安裝,還可以選擇X Windows功能的產品,將遠端案頭映射到安裝的用戶端。筆者常常使用的產品是X Manager套件的Passive產品。
 
1、Silent安裝模式
 
很多作業系統,如Windows、Linux都提供了伺服器網路安裝和大量安裝,目的就是為了減少系統營運人員的安裝負擔和安裝錯誤。原理其實都是相同的,都是將各種互動問題答案事先儲存在一個檔案(通常是文字檔)中,之後安裝程式會去讀取檔案中的配置資訊,用於安裝過程。
 
在Oracle安裝過程中,包括Oracle程式安裝、Oracle Net配置和資料庫建立,都提供了silent安裝方法。只需要在安裝程式中,指定responseFile的名字,就可以進行silent安裝過程。
 
為了進行silent安裝,在Oracle安裝目錄下,有一些提供的responseFile模板。我們在實際中,可以修改這些檔案作為建立的模板。
 
 
[root@bspdev upload]# ls -l
total 4
drwxr-xr-x 6 root root 4096 Jul 3 2005 database
[root@bspdev upload]#
 
[root@bspdev response]# pwd
/upload/database/response
[root@bspdev response]# ls -l
total 244
-rwxr-xr-x 1 root root 25278 Jul 3 2005 custom.rsp
-rwxr-xr-x 1 root root 44600 Jul 3 2005 dbca.rsp
-rwxr-xr-x 1 root root 8476 Jul 3 2005 emca.rsp
-rwxr-xr-x 1 root root 71113 Jul 3 2005 enterprise.rsp
-rwxr-xr-x 1 root root 5742 Jul 3 2005 netca.rsp
-rwxr-xr-x 1 root root 71113 Jul 3 2005 standard.rsp
 
 
Response目錄下,一共提供了6個rsp檔案,分別作為幾種組件的安裝模板。Custom.rsp用於個人化安裝的回應檔模板。Dbca用於database Configuration Assistant組件,emca.rsp用於Oracle Enterprise Management Configuration Assistant。而netca.rsp用於Net Configuration Assistant。
 
Enterprise和Standard分別適用於不同規模和版本的資料庫軟體安裝。
 
我們可以選擇不同的安裝需求,來進行修改。
 
2、Database Software安裝
 
在建立Software之前,我們需要單獨的建立一個oraInst.loc檔案,來指定資產庫位置。
 
 
[root@bspdev ~]# cd /etc
[root@bspdev etc]# vi oraInst.loc
 
inventory_loc=/u01/app/oracle
inst_group=oinstall
~
 
[root@bspdev etc]# chown oracle:oinstall oraInst.loc
[root@bspdev etc]# chmod 664 oraInst.loc
[root@bspdev etc]# ls -l | grep oraInst.loc
-rw-rw-r--  1 oracle oinstall    50 Jun 30 11:02 oraInst.loc
 
 
注意:這個步驟在GUI版本時候,是不強制的。
 
我們首先需要安裝Oracle軟體,建立單獨的回應檔。
 
 
[oracle@bspdev response]$ cp enterprise.rsp creat.rsp
[oracle@bspdev response]$ ls -l
total 320
-rwxr-xr-x 1 oracle oinstall 71113 Jun 30 10:55 creat.rsp
-rwxr-xr-x 1 oracle oinstall 25278 Jul 3 2005 custom.rsp
 
 
使用vi開啟編輯,修改各種選項。模板回應檔設定的很好,每個選項都提供了詳細的解釋和設定法則。我們可以根據自己的需要進行修改,例如:
 
 
#------------------------------------------------------------------------------
#Name      : UNIX_GROUP_NAME
#Datatype  : String
#Description: Unix group to be set for the inventory directory.
#Example   : UNIX_GROUP_NAME = "install"
#------------------------------------------------------------------------------
UNIX_GROUP_NAME=ointall
 
 
在配置過程中,同GUI安裝Oracle Software一樣,我們是可以選擇在安裝Software過程中建立資料庫的。注意,一般我們不推薦這樣做。我們本篇中單專屬介紹dbca的回應檔使用部分。
 
之後,我們就可以啟動runInstaller程式進行安裝。
 
 
[oracle@bspdev database]$ ./runInstaller -silent -force -noconfig-responseFile /upload/database/response/creat.rsp
Starting Oracle Universal Installer...
 
Checking installer requirements...
 
Checking operating system version: must be RedHat-3, SUSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                     Passed
 
All installer requirements met.
 
 
注意,responseFile參數中指定的檔案,一定是回應檔的絕對路徑。
 
如果配置沒有明確的錯誤資訊,會持續下去,包括系列的驗證和安裝過程。
 
(篇幅原因,省略部分輸出內容…..)
......................................................... 18% Done.
............................................................... 36% Done.
............................................................... 54% Done.
............................................................... 72% Done.
................                                                76% Done.
Install successful
 
Linking in progress (Sat Jun 30 11:13:55 CST 2012)
Link successful
 
Setup in progress (Sat Jun 30 11:15:55 CST 2012)
..............                                                 100% Done.
Setup successful
 
End of install phases.(Sat Jun 30 11:16:02 CST 2012)
WARNING:The following configuration scripts
/u01/app/oracle/product/10.2.0/db_1/root.sh
need to be executed as root for configuring the system. If you skip the execution of the configuration tools, the configuration will not be
complete and the product wont function properly. In order to get the product to function properly, you will be required to execute the scripts
and the configuration tools after exiting the OUI.
 
The installation of Oracle Database 10g was successful.
Please check '/u01/app/oracle/logs/silentInstall2012-06-30_11-12-13AM.log' for more details.
 
 
從提示資訊來看,我們還需要使用root使用者執行root.sh指令碼。
 
 
[root@bspdev RPMS]# cd /u01/app/oracle/product/10.2.0/db_1/
[root@bspdev db_1]# ./root.sh
Running Oracle10 root.sh script...
 
The following environment variables are set as:
   ORACLE_OWNER= oracle
   ORACLE_HOME= /u01/app/oracle/product/10.2.0/db_1
 
Enter the full pathname of the local bin directory: [/usr/local/bin]:
  Copying dbhome to /usr/local/bin ...
  Copying oraenv to /usr/local/bin ...
  Copying coraenv to /usr/local/bin ...
 
 
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
[root@bspdev db_1]#
 
 
至此,我們完成了安裝Oracle Software過程。下面使用dbca靜默安裝過程,來建立資料庫。

  • 1
  • 2
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.