一.安裝 Oracle Linux 6.1 系統
我這裡使用VBox 來安裝,具體使用參考:
OracleVirtual Box 安裝使用 說明
http://blog.csdn.net/tianlesoftware/article/details/6826389
在安裝OS 時安裝如下包:
Base System > Base
Base System > Client management tools
Base System > Compatibility libraries
Base System > Hardware monitoring utilities
Base System > Large Systems Performance
Base System > Network file system client
Base System > Performance Tools
Base System > Perl Support
Servers > Server Platform
Servers > System administration tools
Desktops > Desktop
Desktops > Desktop Platform
Desktops > Fonts
Desktops > General Purpose Desktop
Desktops > Graphical Administration Tools
Desktops > Input Methods
Desktops > X Window System
Development > Additional Development
Development > Development Tools
Applications >Internet Browser
二.安裝 Oracle 11gR2
之前也整理了幾篇Oracle安裝的文章,參考:
linux平台oracle 資料庫 安裝文檔
http://blog.csdn.net/tianlesoftware/article/details/4718218
64位 linux平台下Oracle安裝文檔
http://blog.csdn.net/tianlesoftware/article/details/6062816
這裡我們看一下在OracleLinux 下Oracle 的安裝。
2.1 安裝軟體下載
Oracle從11g開始安裝介質就可以獨立進行安裝,從OTN上我們只能下載到11.2.0.1版本,從MOS上,我們可以下載到11.2.0.3版本。 我這裡使用MOS上的11.2.0.3版本進行測試。
OTN上的:
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
2.2 解壓縮 Patchset
Oracle 11g的Patchset 分幾個檔案,每個檔案的作用都不同。
第一, 二個包表示database , 如果升級資料庫,只需要這2個檔案即可。
第三個包表示grid, 用來升級RAC 的CRS。如果升級RAC 要先用這個檔案。
第四個表示用戶端,
第五個表示gateways,
第六個表示examples, 這個是我們的樣本檔案安裝包。
第七個表示deinstall .
更多內容參考:
Oracle 11gR2Patchset 不同檔案作用 說明
http://blog.csdn.net/tianlesoftware/article/details/6818770
#11.2.0.3
unzipp10404530_112030_Linux-x86-64_1of7.zip
unzipp10404530_112030_Linux-x86-64_2of7.zip
2.3 修改hosts 檔案
The "/etc/hosts" file mustcontain a fully qualified name for the server.
<IP-address> <fully-qualified-machine-name> <machine-name>
For example.
127.0.0.1 localhost
192.168.3.201 dave
2.4 修改配置參數
2.4.1 使用preinstall自動化佈建
之前單獨整理了一篇Blog來說明preinstall 包,參考:
Oracle Linux6 下Oracle RDBMS Server 11gR2 Preinstall RPM 包說明
http://blog.csdn.net/tianlesoftware/article/details/7456878
該包會自動完成大部分的配置工作,從而提高我們部署的效率。
[root@dave Desktop]# yum install oracle-rdbms-server-11gR2-preinstall
Loaded plugins: refresh-packagekit
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Packageoracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-3.el6 will be installed
--> Processing Dependency: gcc-c++ forpackage: oracle-rdbms-server-11gR2-preinstall-1.0-3.el6.x86_64
--> Processing Dependency:libstdc++-devel for package:oracle-rdbms-server-11gR2-preinstall-1.0-3.el6.x86_64
--> Processing Dependency: libaio-develfor package: oracle-rdbms-server-11gR2-preinstall-1.0-3.el6.x86_64
--> Processing Dependency: ksh forpackage: oracle-rdbms-server-11gR2-preinstall-1.0-3.el6.x86_64
--> Running transaction check
---> Package gcc-c++.x86_640:4.4.6-3.el6 will be installed
--> Processing Dependency: libstdc++ =4.4.6-3.el6 for package: gcc-c++-4.4.6-3.el6.x86_64
---> Package ksh.x86_640:20100621-12.el6_2.1 will be installed
---> Package libaio-devel.x86_640:0.3.107-10.el6 will be installed
---> Package libstdc++-devel.x86_640:4.4.6-3.el6 will be installed
--> Running transaction check
---> Package libstdc++.x86_640:4.4.5-6.el6 will be updated
---> Package libstdc++.x86_640:4.4.6-3.el6 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
oracle-rdbms-server-11gR2-preinstall
x86_641.0-3.el6 ol6_latest 15 k
Installing for dependencies:
gcc-c++ x86_64 4.4.6-3.el6 ol6_latest 4.7 M
ksh x86_6420100621-12.el6_2.1 ol6_latest 683 k
libaio-devel x86_640.3.107-10.el6 ol6_latest 13 k
libstdc++-devel x86_64 4.4.6-3.el6 ol6_latest 1.5 M
Updating for dependencies:
libstdc++ x86_644.4.6-3.el6 ol6_latest 290 k
Transaction Summary
================================================================================
Install 5 Package(s)
Upgrade 1 Package(s)
Total size: 7.2 M
Total download size: 4.7 M
Is this ok [y/N]: y
Downloading Packages:
gcc-c++-4.4.6-3.el6.x86_64.rpm | 4.7 MB 00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating :libstdc++-4.4.6-3.el6.x86_64 1/7
Installing : libstdc++-devel-4.4.6-3.el6.x86_64 2/7
Installing : gcc-c++-4.4.6-3.el6.x86_64 3/7
Installing : libaio-devel-0.3.107-10.el6.x86_64 4/7
Installing : ksh-20100621-12.el6_2.1.x86_64 5/7
Installing : oracle-rdbms-server-11gR2-preinstall-1.0-3.el6.x86_64 6/7
Cleanup :libstdc++-4.4.5-6.el6.x86_64 7/7
Installed:
oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-3.el6
Dependency Installed:
gcc-c++.x86_64 0:4.4.6-3.el6 ksh.x86_64 0:20100621-12.el6_2.1
libaio-devel.x86_64 0:0.3.107-10.el6 libstdc++-devel.x86_64 0:4.4.6-3.el6
Dependency Updated:
libstdc++.x86_64 0:4.4.6-3.el6
Complete!
[root@dave Desktop]#
2.4.2 手工設定
如果不使用rpm 包自動設定,就需要手工的做配置,具體的配置工作如下:
(1) 修改/etc/sysctl.conf 檔案
Oracle 需求的最小配置如下:
fs.suid_dumpable = 1
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.wmem_max = 1048586
可以使用如下命令來查看某個參數值:
/sbin/sysctl -a | grep <param-name>
在/etc/sysctl.conf檔案裡在添加或者修改如下內容:
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm,semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
修改完成之後執行如下命令使修改生效:
/sbin/sysctl –p
(2)在/etc/security/limits.conf 檔案裡添加如下內容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 4096
oracle hard nofile 65536
oracle soft stack 10240
(3)安裝相關的RPM 包
# From Oracle Linux 6 DVD
cd /media/cdrom/Server/Packages
rpm -Uvh binutils-2*x86_64*
rpm -Uvh glibc-2*x86_64*nss-softokn-freebl-3*x86_64*
rpm -Uvh glibc-2*i686*nss-softokn-freebl-3*i686*
rpm -Uvh compat-libstdc++-33*x86_64*
rpm -Uvh glibc-common-2*x86_64*
rpm -Uvh glibc-devel-2*x86_64*
rpm -Uvh glibc-devel-2*i686*
rpm -Uvh glibc-headers-2*x86_64*
rpm -Uvh elfutils-libelf-0*x86_64*
rpm -Uvh elfutils-libelf-devel-0*x86_64*
rpm -Uvh gcc-4*x86_64*
rpm -Uvh gcc-c++-4*x86_64*
rpm -Uvh ksh-*x86_64*
rpm -Uvh libaio-0*x86_64*
rpm -Uvh libaio-devel-0*x86_64*
rpm -Uvh libaio-0*i686*
rpm -Uvh libaio-devel-0*i686*
rpm -Uvh libgcc-4*x86_64*
rpm -Uvh libgcc-4*i686*
rpm -Uvh libstdc++-4*x86_64*
rpm -Uvh libstdc++-4*i686*
rpm -Uvh libstdc++-devel-4*x86_64*
rpm -Uvh make-3.81*x86_64*
rpm -Uvh numactl-devel-2*x86_64*
rpm -Uvh sysstat-9*x86_64*
rpm -Uvh compat-libstdc++-33*i686*
rpm -Uvh compat-libcap*
cd /
eject
(4)建立groups 和 users
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 506 asmdba
groupadd -g 505 asmoper
useradd -u 502 -g oinstall -Gdba,asmdba,oper oracle
passwd oracle
2.5 其他設定
2.5.1 禁用SELINUX
在/etc/selinux/config裡設定:SELINUX=disabled
修改這個參數需要重啟系統才會生效。
2.5.2 建立目錄並賦權
mkdir -p/u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
2.5.3 切換到oracle使用者,並修改.bash_profile 檔案
[oracle@dave ~]$ vi ~/.bash_profile
在.bash_profile檔案裡添加如下內容:
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=dave; exportORACLE_HOSTNAME
ORACLE_UNQNAME=dave; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; exportORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1;export ORACLE_HOME
ORACLE_SID=dave; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;export CLASSPATH
2.6 安裝軟體
這裡可以使用NoMachine,VNC 等工具。
遠端桌面工具-- NoMachine
http://blog.csdn.net/tianlesoftware/article/details/6003610
我這裡直接在系統裡來:
(1) 用root 使用者執行:
Xhost +
(2) 用Oracle 執行:
DISPLAY=<machine-name>:0.0; exportDISPLAY
(3) 開始安裝
./runInstaller
2.7 修改自啟動參數
修改/etc/oratab 檔案,將最後標記改成Y
Edit the "/etc/oratab" filesetting the restart flag for each instance to 'Y'.
dave:/u01/app/oracle/product/11.2.0/db_1:Y
關於Oracle執行個體開機自啟動的更多內容參考:
Linux 下Oracle開機自啟動 與 oratab, dbstart 指令碼 說明
http://blog.csdn.net/tianlesoftware/article/details/7220657
-------------------------------------------------------------------------------------------------------
著作權,文章允許轉載,但必須以連結方式註明源地址,否則追究法律責任!
Skype: tianlesoftware
Email: tianlesoftware@gmail.com
Blog: http://www.tianlesoftware.com
Weibo: http://weibo.com/tianlesoftware
Twitter: http://twitter.com/tianlesoftware
Facebook: http://www.facebook.com/tianlesoftware
Linkedin: http://cn.linkedin.com/in/tianlesoftware
-------加群需要在備忘說明Oracle資料表空間和資料檔案的關係,否則拒絕申請----
DBA1 群:62697716(滿); DBA2 群:62697977(滿) DBA3 群:62697850(滿)
DBA 超級群:63306533(滿); DBA4 群:83829929 DBA5群: 142216823
DBA6 群:158654907 DBA7 群:172855474 DBA總群:104207940