快速安裝指引
■Reviewing Information About This Guide
■Logging In to the System as root 以root用戶登錄系統
■Checking the Hardware Requirements 檢查硬件需求
■Checking the Software Requirements 檢查軟件需求
■Creating Required Operating System Groups and Users創建用戶和組
■Configuring Kernel Parameters 配置內核參數
■Creating Required Directories 創建所需目錄
■Configuring the oracle User’s Environment 配置用戶環境
■Mounting the Product Disc 裝載安裝盤
■Installing Oracle Database 安裝數據庫
■Installing Oracle Database Examples 安裝數據庫樣例
■What to Do Next?
■Additional Information
■Documentation Accessibility
■Logging In to the System as root
[root@OCP Desktop]# xhost +
access control disabled, clients can connect from any host
配置IP 地址和主機名的映射
[root@OCP Desktop]# vi /etc/hosts
加入下面內容
本機IP(172.16.40.41) + OCP(別名) OCP.localdomain(主機名)
[root@OCP Desktop]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=OCP.localdomain
■Checking the Hardware Requirements
檢查硬件需求
RAM |
Swap Space |
Between 1 GB and 2 GB |
1.5 times the size of the RAM |
Between 2 GB and 16 GB |
Equal to the size of the RAM |
More than 16 GB |
16 GB |
[root@OCP Desktop]# grep MemTotal /proc/meminfo
MemTotal: 1541880 kB
[root@OCP Desktop]# uname -m
x86_64
[root@OCP Desktop]# grep SwapTotal /proc/meminfo
SwapTotal: 5119996 kB
[root@OCP Desktop]# free
total used free shared buffers cached
Mem: 1541880 485160 1056720 0 29140 180520
-/+ buffers/cache: 275500 1266380
Swap: 5119996 0 5119996
[root@OCP Desktop]# df -k /dev/shm/
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 770940 76 770864 1% /dev/shm
[root@OCP Desktop]# df -h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_ocp-LogVol01 57G 4.1G 50G 8% /
[root@OCP Desktop]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_ocp-LogVol01 57G 4.1G 50G 8% /
tmpfs 753M 76K 753M 1% /dev/shm
/dev/sda1 477M 55M 397M 13% /boot
■Checking the Software Requirements
檢查軟件需求
[root@OCP Desktop]# cat /proc/version
Linux version 3.8.13-16.2.1.el6uek.x86_64 (mockbuild@ca-build44.us.oracle.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Thu Nov 7 17:01:44 PST 2013
[root@OCP Desktop]# lsb_release -id
Distributor ID: OracleServer
Description: Oracle Linux Server release 6.5
[root@OCP Desktop]# uname -r
3.8.13-16.2.1.el6uek.x86_64
以下為oracle linux 6 64位必須安裝的軟件包
Oracle Linux 6 and Red Hat Enterprise Linux 6 |
The following packages (or later versions) must be installed: binutils-2.20.51.0.2-5.11.el6 (x86_64) compat-libcap1-1.10-1 (x86_64) compat-libstdc++-33-3.2.3-69.el6 (x86_64) compat-libstdc++-33-3.2.3-69.el6.i686 gcc-4.4.4-13.el6 (x86_64) gcc-c++-4.4.4-13.el6 (x86_64) glibc-2.12-1.7.el6 (i686) glibc-2.12-1.7.el6 (x86_64) glibc-devel-2.12-1.7.el6 (x86_64) glibc-devel-2.12-1.7.el6.i686 ksh libgcc-4.4.4-13.el6 (i686) libgcc-4.4.4-13.el6 (x86_64) libstdc++-4.4.4-13.el6 (x86_64) libstdc++-4.4.4-13.el6.i686 libstdc++-devel-4.4.4-13.el6 (x86_64) libstdc++-devel-4.4.4-13.el6.i686 libaio-0.3.107-10.el6 (x86_64) libaio-0.3.107-10.el6.i686 libaio-devel-0.3.107-10.el6 (x86_64) libaio-devel-0.3.107-10.el6.i686 make-3.81-19.el6 sysstat-9.0.4-11.el6 (x86_64) |
[root@OCP Desktop]# rpm -qa binutils* compat-lib* gcc* glibc* ksh* libgcc* libstdc* libaio* make* sysstat*
compat-libstdc++-296-2.96-144.el6.i686
compat-libtermcap-2.0.8-49.el6.x86_64
gcc-4.4.7-4.el6.x86_64
gcc-c++-4.4.7-4.el6.x86_64
glibc-headers-2.12-1.132.el6.x86_64
compat-libstdc++-33-3.2.3-69.el6.x86_64
compat-libgfortran-41-4.1.2-39.el6.x86_64
glibc-2.12-1.132.el6.i686
sysstat-9.0.4-22.el6.x86_64
libgcc-4.4.7-4.el6.x86_64
glibc-2.12-1.132.el6.x86_64
libstdc++-4.4.7-4.el6.x86_64
binutils-2.20.51.0.2-5.36.el6.x86_64
make-3.81-20.el6.x86_64
libstdc++-devel-4.4.7-4.el6.x86_64
glibc-devel-2.12-1.132.el6.x86_64
libaio-0.3.107-10.el6.x86_64
compat-libf2c-34-3.4.6-19.el6.x86_64
libgcc-4.4.7-4.el6.i686
gcc-gfortran-4.4.7-4.el6.x86_64
binutils-devel-2.20.51.0.2-5.36.el6.x86_64
compat-libcap1-1.10-1.x86_64
glibc-common-2.12-1.132.el6.x86_64
從顯示結果來看,需要的包都已經安裝好了。
如果沒有安裝我們可以搭建yum,利用yum快速安裝。
[root@OCP Desktop]# vi /etc/yum.repos.d/server.repo
[server]
name=OCP
baseurl=file:///media/mycdrom/Server
enabled=1
gpgcheck=0
[root@OCP Desktop]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_ocp-LogVol01 57G 4.1G 50G 8% /
tmpfs 753M 224K 753M 1% /dev/shm
/dev/sda1 477M 55M 397M 13% /boot
/dev/sr0 3.7G 3.7G 0 100% /media/OL6.5 x86_64 Disc 1 20131125
[root@OCP Desktop]# umount /dev/sr0
[root@OCP Desktop]# mount /dev/sr0 /media/mycdrom
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@OCP yum.repos.d]# mv public-yum-ol6.repo public-yum-ol6.repo.bak修改yum默認打開的文件,不然它找不到server.repo
[root@OCP Desktop]#yum install -y binutils* compat-lib* gcc* glibc* ksh* libgcc* libstdc* libaio* make* sysstat*
最后執行上面的安裝命令
■Creating Required Operating System Groups and Users
創建操作系統用戶組和用戶
[root@OCP Desktop]# grep oinstall /etc/group
[root@OCP Desktop]# more /etc/oraInst.loc
/etc/oraInst.loc: No such file or directory
[root@OCP Desktop]# /usr/sbin/groupadd oinstall
[root@OCP Desktop]# /usr/sbin/groupadd -g 502 dba
[root@OCP Desktop]# /usr/sbin/groupadd -g 503 oper
[root@OCP Desktop]# id oracle
id: oracle: No such user
[root@OCP Desktop]# /usr/sbin/useradd -u 502 -g oinstall -G dba,oper oracle
[root@OCP Desktop]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
■Configuring Kernel Parameters
配置內核參數
檢查軟硬限制
Check the soft and hard limits for the file descriptor setting
[root@OCP Desktop]# ulimit -Sn
1024
[root@OCP Desktop]# ulimit -Hn
4096
Check the soft and hard limits for the number of processes available to a user
[root@OCP Desktop]# ulimit -Su
11861
[root@OCP Desktop]# ulimit -Hu
11861
Check the soft limit for the stack setting
[root@OCP Desktop]# ulimit -Ss
8192
[root@OCP Desktop]# ulimit -Hs
Unlimited
設置oracle的軟限制和硬限制
root@OCP Desktop]# vi /etc/security/limits.conf
加入下面內容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
設置內核參數
[root@OCP Desktop]# cat /etc/sysctl.conf|grep -v ^#|grep ^[^#]
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
[root@OCP Desktop]# vi /etc/sysctl.conf
加入如下內容
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
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 = 1048576
執行/sbin/sysctl –p使參數生效
■Creating Required Directories
創建所需目錄
[root@OCP Desktop]# mkdir -p /u01/app/oracle
[root@OCP Desktop]# chown -R oracle:oinstall /u01/app
[root@OCP Desktop]# chmod -R 775 /u01/app/oracle
■Configuring the oracle User’s Environment
配置oracle用戶環境
切換到oracle用戶su – oracle
[root@OCP Desktop]# su - oracle
[oracle@OCP ~]$ vi /home/oracle/.bash_profile
加入下面內容
export ORACLE_SID=orcl
export ORACLE_BASE=/u01/app/oracle //ORACLE
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_TERM=xterm
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export CLASSPATH=$ORACLE_HOME/JRE:ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
■Mounting the Product Disc
裝載安裝盤
到官網下載oracle軟件包http://www.oracle.com/technetwork/indexes/downloads/index.html
本例用的是zip包。
p13390677_112040_Linux-x86-64_1of7.zip
p13390677_112040_Linux-x86-64_2of7.zip
把兩個包粘貼到同一個文件夾下(本例在/u01/app/oracle),用unzip命令解壓。
如unzip p13390677_112040_Linux-x86-64_1of7.zip
解壓后cd database
執行安裝
■Installing Oracle Database
安裝oracle數據庫
[oracle@OCP oracle]$ ll database
total 60
drwxr-xr-x. 4 oracle oinstall 4096 Aug 27 2013 install
-rw-r--r--. 1 oracle oinstall 30016 Aug 27 2013 readme.html
drwxr-xr-x. 2 oracle oinstall 4096 Aug 27 2013 response
drwxr-xr-x. 2 oracle oinstall 4096 Aug 27 2013 rpm
-rwxr-xr-x. 1 oracle oinstall 3267 Aug 27 2013 runInstaller
drwxr-xr-x. 2 oracle oinstall 4096 Aug 27 2013 sshsetup
drwxr-xr-x. 14 oracle oinstall 4096 Aug 27 2013 stage
-rw-r--r--. 1 oracle oinstall 500 Aug 27 2013 welcome.html
[oracle@OCP oracle]$ cd database
[oracle@OCP database]$ ls
install response runInstaller stage
readme.html rpm sshsetup welcome.html
[oracle@OCP database]$ xhost +
access control disabled, clients can connect from any host
[oracle@OCP database]$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 43474 MB Passed
Checking swap space: must be greater than 150 MB. Actual 4999 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-07-24_04-41-31PM. Please wait ...
有兩個包提示警告,我們到root用戶下用rpm -qa 查看
發現這兩個包沒有裝,我們用yum對這兩個包進行安裝。
[root@OCP Desktop]# yum install -y ksh* libaio-devel
Loaded plugins: refresh-packagekit, security
server | 3.7 kB 00:00 ...
server/primary_db | 3.0 MB 00:00 ...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ksh.x86_64 0:20120801-10.el6 will be installed
---> Package libaio-devel.x86_64 0:0.3.107-10.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
ksh x86_64 20120801-10.el6 server 755 k
libaio-devel x86_64 0.3.107-10.el6 server 13 k
Transaction Summary
================================================================================
Install 2 Package(s)
Total download size: 768 k
Installed size: 1.7 M
Downloading Packages:
--------------------------------------------------------------------------------
Total 4.0 MB/s | 768 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libaio-devel-0.3.107-10.el6.x86_64 1/2
Installing : ksh-20120801-10.el6.x86_64 2/2
Verifying : ksh-20120801-10.el6.x86_64 1/2
Verifying : libaio-devel-0.3.107-10.el6.x86_64 2/2
Installed:
ksh.x86_64 0:20120801-10.el6 libaio-devel.x86_64 0:0.3.107-10.el6
Complete!
再次查看.顯示裝好。單擊Check Again再次檢查
在root用戶下執行這兩個腳本。執行完后按OK繼續
[root@OCP Desktop]# /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@OCP Desktop]# /u01/app/oracle/product/11.2.0/db_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.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 script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
到此數據庫軟件就安裝好了