您好,登錄后才能下訂單哦!
這篇文章主要為大家展示了“如何靜默安裝數據庫oracle11gR2”,內容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領大家一起研究并學習一下“如何靜默安裝數據庫oracle11gR2”這篇文章吧。
xhost hdp01.hammer-test-tpl-wh.com
telnet hdp01.hammer-test-tpl-wh.com
sudo sh
---原本
yum -y install binutils-2.23.52.0.1-12.el7.x86_64 compat-libcap1-1.10-3.el7.x86_64 compat-libstdc++-33-3.2.3-71.el7.i686 compat-libstdc++-33-3.2.3-71.el7.x86_64 gcc-4.8.2-3.el7.x86_64
yum -y install gcc-c++-4.8.2-3.el7.x86_64 glibc-2.17-36.el7.i686 glibc-2.17-36.el7.x86_64 glibc-devel-2.17-36.el7.i686 glibc-devel-2.17-36.el7.x86_64 ksh libaio-0.3.109-9.el7.i686
yum -y install libaio-0.3.109-9.el7.x86_64 libaio-devel-0.3.109-9.el7.i686 libaio-devel-0.3.109-9.el7.x86_64 libgcc-4.8.2-3.el7.i686 libgcc-4.8.2-3.el7.x86_64 libstdc++-4.8.2-3.el7.i686
yum -y install libstdc++-4.8.2-3.el7.x86_64 libstdc++-devel-4.8.2-3.el7.i686 libstdc++-devel-4.8.2-3.el7.x86_64 libXi-1.7.2-1.el7.i686 libXi-1.7.2-1.el7.x86_64 libXtst-1.2.2-1.el7.i686
yum -y install libXtst-1.2.2-1.el7.x86_64 make-3.82-19.el7.x86_64 sysstat-10.1.5-1.el7.x86_64
---實踐調整為
yum -y install binutils* compat-libcap1-* compat-libstdc++-* compat-libstdc++* gcc-*
yum -y install gcc-c++-* glibc-* ksh* libaio-* libaio-* libgcc-* libstdc++-* libXi-* libXtst-* make-* sysstat-*
yum -y install libaio* glibc* compat-libstdc* elfutils-libelf-devel* libgcc* libstdc* unixODBC* pdksh*
echo inventory_loc=/u01/app/oraInventory >>/etc/oraInst.loc
echo inst_group=oinstall >>/etc/oraInst.loc
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -g oinstall -G dba oracle
---如果已有oracle賬戶時,輸入 /usr/sbin/usermod -g oinstall -G dba oracle
passwd oracle
--- 手工輸入 oracle_123
--/etc/sysctl.conf
--fs.aio-max-nr = 1048576
--fs.file-max = 6815744
--kernel.shmall = 2097152
--kernel.shmmax = 536870912
--kernel.shmmni = 4096
--kernel.sem = 250 32000 100 128
--net.ipv4.ip_local_port_range = 9000 65500
--net.core.rmem_default = 262144
--net.core.rmem_max = 4194304
--net.core.wmem_default = 262144
--net.core.wmemax = 1048576
echo kernel.shmmax=206158430208 >>/etc/sysctl.conf
echo kernel.shmmni=4096 >>/etc/sysctl.conf
echo kernel.shmall= 67108864 >>/etc/sysctl.conf
echo kernel.sem = 250 32000 100 128 >>/etc/sysctl.conf
echo net.ipv4.ip_local_port_range = 9000 65500 >>/etc/sysctl.conf
echo net.core.rmem_default = 262144 >>/etc/sysctl.conf
echo net.core.rmem_max = 4194304 >>/etc/sysctl.conf
echo net.core.wmem_default = 262144 >>/etc/sysctl.conf
echo net.core.wmem_max = 1048576 >>/etc/sysctl.conf
echo fs.file-max = 6815744 >>/etc/sysctl.conf
echo fs.aio-max-nr = 1048576 >>/etc/sysctl.conf
sysctl -p
----SHMALL參數的設置。這個值推薦設置為物理內存大小除以分頁大小
getconf PAGE_SIZE
--計算方法:例如256G內存,page_size為4096時 256*1024*1024*1024/4096
/sbin/sysctl -p
echo "* soft nofile 1024">> /etc/security/limits.conf
echo "* hard nofile 65536">> /etc/security/limits.conf
echo "* soft nproc 2047">> /etc/security/limits.conf
echo "* hard nproc 16384">> /etc/security/limits.conf
echo "* soft stack 10240">> /etc/security/limits.conf
echo "* hard stack 32768">> /etc/security/limits.conf
mkdir -p /tpdata/app/
chown -R oracle:oinstall /tpdata/app/
chmod -R 775 /tpdata/app/
umask 022
echo $SHELL
su - oracle
./.bash_profile
--export DISPLAY=local_host:0.0
export DISPLAY=:0.0
export DISPLAY=:1
xhost + hdp01.hammer-test-tpl-wh.com
mkdir /tpdata/tmp
chmod a+wr /tpdata/tmp
chown oracle:oinstall -R /tpdata
echo umask 022 >> ./.bash_profile
echo TMP=/tpdata/tmp >> ./.bash_profile
echo TMPDIR=/tpdata/tmp >> ./.bash_profile
echo export TMP TMPDIR >> ./.bash_profile
echo ORACLE_BASE=/tpdata/app/oracle >> ./.bash_profile
echo ORACLE_SID=carthage >> ./.bash_profile
echo export ORACLE_BASE ORACLE_SID >> ./.bash_profile
unset ORACLE_HOME
unset TNS_ADMIN
vi /etc/sysconfig/selinux
SELINUX=disabled
echo "session required /lib/security/pam_limits.so">>/etc/pam.d/login
echo "session required pam_limits.so">>/etc/pam.d/login
service iptables stop
---------------------------------------以上為OS環境配置----------------------------------------
參考文章
http://www.oracle.com/technetwork/cn/articles/wininst-otn-096093-zhs.html
http://blog.itpub.net/27042095/viewspace-766965
10.2 創建響應文件
# su - oracle
僅安裝Oracle軟件的響應文件UPRR_INSTALL_DB_SWONLY.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=hdp01.hammer-test-tpl-wh.com
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/tpdata/app/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN,zh_TW
ORACLE_HOME=/tpdata/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/tpdata/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=false
創建數據庫的響應文件UPRR_DBCA.rsp
[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "hammer"
SID = "hammer"
TEMPLATENAME = "General_Purpose.dbc"
SYSPASSWORD = "oracle_123"
SYSTEMPASSWORD = "oracle_123"
DATAFILEDESTINATION = "/tpdata/app/oracle/oradata"
RECOVERYAREADESTINATION= "/tpdata/app/oracle/flash_recovery_area"
CHARACTERSET = "AL32UTF8"
NATIONALCHARACTERSET= "UTF8"
LISTENERS = "listener1"
NET配置的響應文件使用Oracle默認即可,無需修改,該文件在Oracle安裝包的路徑:
$cp database/response/netca.rsp /home/oracle/UPRR_NETCA.rsp
$ su - root
# chmod 700 /home/oracle/UPRR_INSTALL_DB_SWONLY.rsp
10.3 安裝Oracle
安裝:
# su - oracle
$ cd database
$ mkdir -p /u01/app/oracle/oraInventory
-- $ ./runInstaller -silent -debug -force -responseFile /home/oracle/UPRR_INSTALL_DB_SWONLY.rsp
$ ./runInstaller -silent -responseFile /home/oracle/UPRR_INSTALL_DB_SWONLY.rsp
備注:(可選參數-noconfig -IgnoreSysPreReqs)
出現類似如下提示表示安裝完成:
#-------------------------------------------------------------------
...
/tpdata/app/oracle/oraInventory/orainstRoot.sh
/tpdata/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
Successfully Setup Software.
#-------------------------------------------------------------------
安裝期間查看安裝日志信息了解安裝進度
$ cd $ORACLE_BASE/oraInventory/logs
$ tail -100f installActions*.log
root執行$ORACLE_HOME下的root.sh來建立oratab,dbhome,oraenv,coraenv文件, 如果提示則一直回車:
$ su - root
# /tpdata/app/oracle/product/11.2.0/dbhome_1/root.sh
# more /etc/oratab
設置環境變量
vi /home/oracle/.bash_profile
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/JRE/lib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export LIBPATH=${CLASSPATH}:$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib
export ORACLE_OWNER=oracle
export SPFILE_PATH=$ORACLE_HOME/dbs
export ORA_NLS10=$ORACLE_HOME/nls/data
source /home/oracle/.bash_profile
Sqlplus測試
$ sqlplus /nolog
11 靜默配置網絡
$ $ORACLE_HOME/bin/netca /silent /responseFile /home/oracle/UPRR_NETCA.rsp
/tpdata/app/oracle/product/11.2.0/dbhome_6/srvm/admin/getcrshome 沒有可執行權限?
12 靜默安裝數據庫
# su - oracle
$ $ORACLE_HOME/bin/dbca -silent -responseFile /home/oracle/UPRR_DBCA.rsp
安裝期間查看日志信息了解進度:
$ tail -100f $ORACLE_BASE/cfgtoollogs/dbca/$ORACLE_SID/$ORACLE_SID.log
建庫后實例檢查
$ ps -ef | grep ora_ | grep -v grep | wc -l
$ ps -ef | grep ora_ | grep -v grep
建庫后監聽檢查
$ lsnrctl status
如果使用歸檔日志
$ sqlplus / as sysdba
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database archivelog;
SQL> alter database flashback on; (如果要啟用數據庫閃回功能則執行)
SQL> alter database open;
SQL> execute utl_recomp.recomp_serial(); (重新編譯所有可能失效對象)
SQL> alter system archive log current; (手工歸檔測試)
默認安裝的數據庫用戶檢查
SQL> set lines 256 pages 500
SQL> select USER_ID,USERNAME,ACCOUNT_STATUS,DEFAULT_TABLESPACE from dba_users order by 1;
以上是“如何靜默安裝數據庫oracle11gR2”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。