1.手工删除oracle軟體:
删除/etc/ora*
删除軟體安裝目錄下的所有檔案,我這裡是:/u01/app/oracle/*
删除/usr/local/bin/*
2.指令行下安裝oracle軟體:
(1).編寫應答檔案,一般下載下傳的資料庫解壓包中,有應答檔案的模闆,我們這裡修改一下即可
[oracle@stu135 database]$ pwd # 我的資料庫解壓後在/tmp/database目錄下
/tmp/database
[oracle@stu135 database]$ ls # response目錄為應答檔案所在目錄,進入
doc install response runInstaller stage welcome.html
[oracle@stu135 database]$ cd response/
[oracle@stu135 response]$ ls
custom.rsp dbca.rsp emca.rsp enterprise.rsp netca.rsp standard.rsp
[oracle@stu135 response]$ cp enterprise.rsp /tmp/database/ent.rsp # 複制應答檔案,并改名
[oracle@stu135 response]$ vim /tmp/database/ent.rsp # 編輯應答檔案
# 主要修改如下參數,其他參數暫時預設【我們這裡的安裝,是大家了解有這種方法】
UNIX_GROUP_NAME= "oinstall" # 組名,這個組時我們自己建的
FROM_LOCATION="/tmp/database/stage/products.xml" # 指定products.xml路徑,絕對路徑
ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_2" # 指定oracle産品的安裝目錄
ORACLE_HOME_NAME= "oracle_home2" # 指定這個資料庫産品的名字,即軟體的名字,友善以後删除
ORACLE_HOSTNAME= "xcg.xuchanggang.cn" # 指定自己機器的主機名
COMPONENT_LANGUAGES={"en"} # 指定語言
INSTALL_TYPE="EE" # 指定安裝版本,這裡是企業版
s_nameForDBAGrp= "dba" # 指定DBA組
s_nameForOPERGrp= "dba" # 指定操作組
n_configurationOption=3 # 指定配置說明,檔案中數字代表的含義,都有注釋說明,這裡僅安裝軟體
(2).運作腳本(自帶),就在資料庫解壓目錄下
[oracle@stu135 database]$ ls
doc ent.rsp install response runInstaller stage welcome.html
[oracle@stu135 database]$ ./runInstaller -help # 如果不知道跟那些參數,可以用help查詢
# 使用靜默安裝【無互動的】,指定應答檔案,忽略系統檢查,此步可省略
[oracle@stu135 database]$ ./runInstaller -responseFile /tmp/database/ent.rsp -ignoreSysPrereqs -silent
Starting Oracle Universal Installer...
Checking installer requirements...
................................................(詳細的安裝過程省略)
Installation in progress (Mon Jun 17 15:32:29 CST 2013)
Install successful
(3).安裝完成後,會提示安裝腳本[兩個腳本:orainstRoot.sh / root.sh ],兩個腳本以root使用者身份運作
[root@stu135 db_1]# cd /u01/app/oracle/oraInventory/
[root@stu135 oraInventory]# bash orainstRoot.sh
Changing permissions of /u01/app/oracle/oraInventory to 770.
Changing groupname of /u01/app/oracle/oraInventory to oinstall.
The execution of the script is complete
[root@stu135 oraInventory]# cd /u01/app/oracle/product/10.2.0/db_2/
[root@stu135 db_2]# bash 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_2
Enter the full pathname of the local bin directory: [/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
yFinished running generic part of root.sh script.
Now product-specific root actions will be performed.