靜默安裝、建庫(轉)

myy10146發表於2013-01-21

靜默安裝DB軟體:

設定responseFile檔案。

 
[oracle@stream ~]$ cd database/response
[oracle@stream database]$ vi db_install.rsp

修改db_install.rsp檔案的以下內容。

oracle.install.option=INSTALL_DB_SWONLY 
UNIX_GROUP_NAME=oinstall 
INVENTORY_LOCATION=/u01/app/oracle/oraInventory 
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE 
oracle.install.db.isCustomInstall=false 
oracle.install.db.DBA_GROUP=dba 
oracle.install.db.OPER_GROUP=dba 
DECLINE_SECURITY_UPDATES=true

執行安裝命令。

[oracle@stream database]$ ./runInstaller -silent -
responseFile /home/oracle/database/response/db_install.rsp
Starting Oracle Universal Installer...
Checking Temp space:must be greater than 80 MB.Actual 10766 MB Passed
Checking swap space:must be greater than 150 MB.Actual 2020 MB Passed
Preparing to launch Oracle Universal Installer from 
/tmp/OraInstall2012-03-01_10-06-14AM. Please wait ...
You can find the log of this install session at:
/u01/app/oraInventory/logs/installActions2012-03-01_10-06-14AM.log

此時,會在後臺進行資料庫軟體的安裝,可能需要挺長的時間,可以在開一個SHELL,去監控安裝資料庫時產生的日誌檔案。

[oracle@stream database]$ tail –f /u01/app/oraInventory/logs/
installActions2012-03-01_10-06-14AM.log

直到提示用root使用者執行/u01/app/oracle/product/11.2.0/dbhome_1/root.sh指令碼。

The following configuration scripts need to be executed 
as the "root" user. 
 #!/bin/sh 
 #Root scripts to run
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/dbhome_1/root.sh
To execute the configuration scripts:
         1. Open a terminal window 
         2. Log in as "root" 
         3. Run the scripts 
         4. Return to this window and hit "Enter" key to continue

新開啟一個SHELL,切換到root使用者執行上述2個指令碼。

[root@stream ~]# /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使用者執行完這兩個指令碼後,在執行靜默安裝的SHELL視窗按下Enter鍵,結束安裝過程。


DBCA靜默建庫:

1、修改responseFile檔案的以下內容:

 
[oracle@stream ~]$ vi database/response/dbca.rsp
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
GDBNAME = "STREAM"
SID = "stream"
TEMPLATENAME = "New_Database.dbt"
SYSPASSWORD = "oracle"
SYSTEMPASSWORD = "oracle"
SYSMANPASSWORD = "oracle"
DBSNMPPASSWORD = "oracle"
DATAFILEDESTINATION ="/u01/app/oracle/oradata/stream"
STORAGETYPE=FS
CHARACTERSET = "ZHS16GBK"
NATIONALCHARACTERSET= "AL16UTF16"
DATABASETYPE = "MULTIPURPOSE"
AUTOMATICMEMORYMANAGEMENT = "FALSE"

以上引數的含義如下:

 
RESPONSEFILE_VERSION:資料庫版本資訊。
OPERATION_TYPE:執行操作型別:建立資料庫、根據DB建立模板、
建立克隆模板、刪除資料庫、配置資料庫、新增例項(RAC環境下)、
刪除例項(RAC環境下)
GDBNAME:指定Global Name
SID:指定SID
TEMPLATENAME:模板名稱
SYSPASSWORD:SYS使用者密碼
SYSTEMPASSWORD:SYSTEM使用者密碼
SYSMANPASSWORD:SYSMAN使用者的密碼,當EM管理型別選擇local的時候需要
DBSNMPPASSWORD:DBS的密碼,當EM設定了之後需要
DATAFILEDESTINATION:資料庫檔案的存放目錄
STORAGETYPE:資料庫要建立在何種檔案型別FS、ASM等
CHARACTERSET:資料庫字符集
NATIONALCHARACTERSET:國家字符集
DATABASETYPE:指定資料庫的型別,有OLTP或者warehouse
AUTOMATICMEMORYMANAGEMENT:是否開啟AMM記憶體自動管理

2.配置好responseFile檔案以後,就可以開始靜默安裝了。

[oracle@stream database]$ dbca -silent -responseFile 
/home/oracle/database/response/dbca.rsp 
Copying database files
1% complete
3% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/STREAM/
STREAM.log" for further details.
資料庫建立完成後,登入資料庫,驗證是否成功建立。


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

相關文章