RHEL 6.2 64位安裝ORACLE 11G R2
1、安裝環境:
作業系統及版本
[root@stone ~]# cat /etc/issue
Red Hat Enterprise Linux Server release 6.2 (Santiago)
記憶體設定
[root@stone ~]# free -m
total used free shared buffers cached
Mem: 1063 721 341 0 25 387
-/+ buffers/cache: 309 754
Swap: 1999 0 1999
#記憶體至少1G,swap至少為1.5倍記憶體
磁碟分割槽
[root@stone ~]# df -ah
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 23G 2.9G 19G 14% /
proc 0 0 0 - /proc
sysfs 0 0 0 - /sys
devpts 0 0 0 - /dev/pts
tmpfs 532M 264K 532M 1% /dev/shm
none 0 0 0 - /proc/sys/fs/binfmt_misc
sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs
gvfs-fuse-daemon 0 0 0 - /root/.gvfs
vmware-vmblock 0 0 0 - /var/run/vmblock-fuse
.host:/ 76G 26G 50G 35% /mnt/hgfs
#建議oracle所作分割槽(本例為/)至少10G
2、配置YUM(需要上公網或架設內網伺服器)
[root@stone ~]# cd /etc/yum.repos.d/
[root@stone yum.repos.d]# wget
--2014-03-09 14:35:00--
Resolving mirrors.163.com... 123.58.173.106
Connecting to mirrors.163.com|123.58.173.106|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2006 (2.0K) [application/octet-stream]
Saving to: “CentOS6-Base-163.repo”
100%[===========================================================================>] 2,006 --.-K/s in 0s
2014-03-09 14:35:00 (137 MB/s) - “CentOS6-Base-163.repo” saved [2006/2006]
[root@stone yum.repos.d]# ls
CentOS6-Base-163.repo redhat.repo rhel-source.repo
[root@stone ~]# vim /etc/yum.repos.d/CentOS6-Base-163.repo
:g/$releasever/s//6/g
:wq
[root@stone ~]# yum makecache
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
base | 3.7 kB 00:00
base/group_gz | 220 kB 00:00
base/filelists_db | 5.9 MB 00:28
base/primary_db | 4.4 MB 00:20
base/other_db | 2.8 MB 00:12
extras | 3.4 kB 00:00
extras/filelists_db | 11 kB 00:00
extras/prestodelta | 907 B 00:00
extras/primary_db | 19 kB 00:00
extras/other_db | 5.8 kB 00:00
updates | 3.4 kB 00:00
updates/filelists_db | 1.3 MB 00:05
updates/prestodelta | 169 kB 00:00
updates/primary_db | 2.0 MB 00:09
updates/other_db | 16 MB 01:11
Metadata Cache Created
3、安裝所需軟體包
[root@stone ~]# cat ora_software1.txt
binutils*
compat-libstdc++*
elfutils-libelf*
elfutils-libelf-devel*
elfutils-libelf-devel-static*
gcc*
gcc-c++*
glibc*
glibc-common*
glibc-devel*
glibc-headers*
kernel-headers*
ksh*
libaio*
libaio*
libgcc*
libgomp*
libstdc++*
libstdc++-devel*
make*
sysstat*
unixODBC*
unixODBC-devel*
[root@stone ~]# cat ora_software1.txt | xargs yum install -y
或者直接使用oracle為OEL提供的yum直接安裝,步驟如下:
[root@stone ~]# cd /etc/yum.repos.d/
[root@stone yum.repos.d]# wget
--2014-03-09 21:01:00--
Resolving public-yum.oracle.com... 206.160.170.8, 206.160.170.56
Connecting to public-yum.oracle.com|206.160.170.8|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4233 (4.1K) [text/plain]
Saving to: “public-yum-ol6.repo”
100%[===========================================================================>] 4,233 --.-K/s in 0s
2014-03-09 21:01:01 (119 MB/s) - “public-yum-ol6.repo” saved [4233/4233]
[root@stone ~]# rpm --import
[root@stone yum.repos.d]# yum install oracle-rdbms-server-11gR2-preinstall
4、建立oracle所需組和使用者(如果使用OEL的yum安裝,會自動建立)
[root@stone ~]# groupadd oinstall
[root@stone ~]# groupadd dba
[root@stone ~]# useradd -g oinstall -G dba oracle
[root@stone ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: it is too simplistic/systematic
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
5、設定安裝目錄
[root@stone ~]# mkdir -p /u01/oraInventory
[root@stone ~]# chown -R oracle:oinstall /u01/
[root@stone ~]# chmod -R 775 /u01/
將第4步和第5步做成指令碼:
[root@stone ~]# cat ora_user_dir.sh
#!/bin/bash
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
echo "123456" | passwd --stdin oracle
mkdir -p /u01/oraInventory
chown -R oracle:oinstall /u01/
chmod -R 775 /u01/
[root@stone ~]# sh ora_user_dir.sh
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
6、設定環境變數
[root@stone ~]#xhost +
[root@stone ~]# su - oracle
[oracle@stone ~]$ export ORACLE_BASE=/u01/app/oracle
7、解壓安裝包
[oracle@stone ~]$ unzip /mnt/hgfs/software/linux.x64_11gR2_database_1of2.zip
[oracle@stone ~]$ unzip /mnt/hgfs/software/linux.x64_11gR2_database_2of2.zip
[oracle@stone ~]$ ls
database
8、開始安裝:
[oracle@stone ~]$ ./database/runInstaller
選擇不接收安全更新
先僅安裝資料庫軟體,後面再建立資料庫
選擇單例項
選擇語言預設為英語
選擇版本為預設的企業版
安裝路徑為預設路徑
產品目錄為預設路徑
管理和操作組保留預設值(這是作業系統認證所需要)
安裝環境檢查
檢查出一些引數設定和軟體依賴包缺失問題,點選Fix&Chick Again
生成修復指令碼,並提示指令碼路徑和執行步驟
以root使用者執行修復指令碼
[root@stone ~]# sh /tmp/CVU_11.2.0.1.0_oracle/runfixup.sh
Response file being used is :/tmp/CVU_11.2.0.1.0_oracle/fixup.response
Enable file being used is :/tmp/CVU_11.2.0.1.0_oracle/fixup.enable
Log file location: /tmp/CVU_11.2.0.1.0_oracle/orarun.log
Setting Kernel Parameters...
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
指令碼修復後,還有一些軟體依賴包提示缺失,其實這些軟體前面已經安裝過了,且版本比需求的高,故可以選擇Ignore All
檢視安裝摘要,確認無誤後進行安裝
開始安裝
安裝完成後提示執行兩個指令碼
以root使用者執行指令碼
[root@stone ~]# /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@stone ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_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.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
將以下檔案中的環境變數寫入oracle主目錄下的.bash_profile檔案
[root@stone ~]# cat ora_env.txt
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH
ORACLE_SID=stone; export ORACLE_SID
ORA_NLS33=$ORACLE_HOME/nls/admin/data; export ORA_NLS33
NLS_LANG=american_america.zhs16gbk;export NLS_LANG
PATH=$ORACLE_HOME/bin:$PATH; export PATH
[root@stone ~]# cat ora_env.txt >> /home/oracle/.bash_profile
[root@stone ~]# cat /home/oracle/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH
ORACLE_SID=stone; export ORACLE_SID
ORA_NLS33=$ORACLE_HOME/nls/admin/data; export ORA_NLS33
NLS_LANG=american_america.zhs16gbk;export NLS_LANG
PATH=$ORACLE_HOME/bin:$PATH; export PATH
切換到oracle使用者,確認環境變數已生效
[root@stone ~]# su - oracle
[oracle@stone ~]$ env | grep ORACLE
ORACLE_SID=stone
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
9、使用netmgr新建一個監聽,以便在建立資料庫時同時安裝em
[oracle@stone ~]$ netmgr
新建監聽
增加一個監聽地址
設定對應的資料庫服務
儲存關閉,然後啟動監聽
[oracle@stone ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 17-MAR-2014 11:41:15
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/stone/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=stone)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=stone)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 17-MAR-2014 11:41:16
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/stone/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=stone)(PORT=1521)))
Services Summary...
Service "stone" has 1 instance(s).
Instance "stone", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
10、使用dbca建立資料庫
[oracle@stone ~]$ dbca
選擇建立資料庫
資料庫型別為“通用或事物處理”
選擇em,保持預設設定
僅做測試用,為管理帳號設定統一密碼
儲存型別保持預設設定
閃回設定,保持預設
勾選上示例模式
設定記憶體,選擇自動記憶體管理
設定塊大小和最大處理程式數量
選擇字符集,如果有中文一般選擇ZHS16GBK
選擇連線模式為專用服務模式
控制檔案設定
檔案數量設定
資料檔案設定
重做日誌檔案設定
選擇建立資料庫,儲存該模版,生成建立指令碼
檢視建立資料庫設定摘要
開始建立資料庫
建立完成
進入em
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28536251/viewspace-1428946/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- rhel 5.4 64位上安裝oracle 11g R2Oracle
- RHEL5 Oracle 11G R2 RAC 靜默安裝 (二)GI靜默安裝Oracle
- RHEL 6.5 64位安裝ORACLE 11G R2 Grid Infrastructure for a Standalone ServerOracleASTStructServer
- RHEL5 Oracle 11G R2 RAC 靜默安裝 (三) rdbms安裝 dbca 建庫Oracle
- RHEL5 Oracle 11G R2 RAC 靜默安裝 (一) GI安裝前 準備Oracle
- oracle 11g R2安裝RACOracle
- Linux (RHEL 5.4)下安裝 Oracle 10g R2LinuxOracle 10g
- Omnibus系列之 Object Server安裝 on RHEL6.2ObjectServer
- RHEL6(CentOS6)安裝 Oracle 11g R2 手記(完整詳細可用版)CentOSOracle
- ubuntu10.04 安裝oracle 11g r2UbuntuOracle
- RHEL6 上安裝Oracle 11g軟體Oracle
- 手動安裝、驗證、解除安裝11g R2 oracle textOracle
- RHEL6.2下掛載光碟機安裝軟體
- Oracle 10g R2 for RHEL AS4 安裝重點小記Oracle 10g
- rhel7 安裝11g rac
- rhel5.5 linux系統下安裝Oracle 11gLinuxOracle
- 開源虛擬磁帶庫MHVTL 安裝on RHEL6.2
- Oraccle 11G R2 RAC解除安裝
- 基於IBM AIX系統安裝oracle 11g R2IBMAIOracle
- solaris 10 安裝 oracle 11g R2核心引數設定Oracle
- Oracle 11g在RHEL 6.4下的詳細安裝過程Oracle
- Oracle 11g R2 RAC安裝前的系統環境搭建Oracle
- ORACLE 11g R2 RAC 11.2.0.2.12 PSU 安裝升級Oracle
- Oracle 11g R2的解除安裝與重灌過程詳解Oracle
- CentOS 6.6系統上命令列靜默安裝安裝Oracle 11G R2(11.2.0.3)CentOS命令列Oracle
- redhat6.2安裝oracle11.2.0.3RACRedhatOracle
- centos 6.5 x64最小化安裝後需要安裝的包 for oracle 11g r2CentOSOracle
- 虛擬RHEL5上安裝11g RAC-安裝配置
- RHEL7.3 安裝11G grid和Rdbms
- oracle_11gR2_05 CentOS5.5 正式開始安裝 Oracle 11g r2OracleCentOS
- CentOS-6.4-x64上靜默安裝Oracle 11g R2 (11.2.0.4)CentOSOracle
- Oracle11g R2 RAC安裝Oracle
- Oracle 11g r2 racOracle
- rhel5安裝oracle10gOracle
- 水煮oracle 20——redhat6下的oracle 11g r2的靜默安裝與配置OracleRedhat
- 【Oracle】RHEL6.4-64位 安裝oracle11.2.0.3(三) 安裝Oracle軟體Oracle
- Oracle 11G 安裝文件Oracle
- Oracle 11g解除安裝Oracle