標籤:容量 www. lib bst ksh 開頭 一個 ace 分享圖片
參考文章:
http://www.cnblogs.com/lightnear/archive/2012/10/07/2714247.html
http://www.cnblogs.com/xqzt/p/5456401.html
http://www.cnblogs.com/anzerong2012/p/7528311.html
一、安裝環境
CentOS Linux release 7.2.1511 (Core)
Oracle Database 11g Release 2 (11.2.0.4)
二、安裝前準備2.1 修改主機名稱
修改/etc/sysconfig/network設定檔中的HOSTNAME變數
[[email protected] ~]# hostnamectl set-hostname oracledb####永久性修改[[email protected] ~]#vi /etc/sysconfig/networkNETWORKING=yesHOSTNAME= oracledb[[email protected] ~]# hostnameoracledb
2.2 添加主機名稱與IP對應記錄
[[email protected] ~]# vi /etc/hosts172.17.22.70 oracledb
2.3 關閉Selinux
[[email protected] ~]# sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config [[email protected] ~]# setenforce 0
2.4 firewall開啟1521連接埠及oem控制台連接埠
[[email protected] ~]# firewall-cmd --permanent --zone=public --add-port=1521/tcp success
[[email protected] ~]# firewall-cmd --permanent --zone=public --add-port=1588/tcp success
[[email protected] ~]# firewall-cmd --reload success
2.5下載
Oracle 11g
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
2.6 檢查硬體設定要求
最小記憶體 1 GB of RAM
虛擬記憶體容量
Available RAM |
Swap Space Required |
Between 1 GB and 2 GB |
1.5 times the size of RAM |
Between 2 GB and 16 GB |
Equal to the size of RAM |
More than 16 GB |
16 GB |
硬碟空間要求
資料庫軟體硬碟空間需求:
Installation Type |
Requirement for Software Files (GB) |
Enterprise Edition |
3.95 |
Standard Edition |
3.88 |
資料檔案硬碟空間需求:
Installation Type |
Requirement for Data Files (GB) |
Enterprise Edition |
1.7 |
Standard Edition |
1.5 |
檢查的命令
#記憶體 grep MemTotal /proc/meminfo#交換空間 grep SwapTotal /proc/meminfo#磁碟空間 df -ah
2.7
安裝所需的軟體包
通過查看Oracle安裝文檔中列出的Package Requirements可以查看在不同平台上需要的軟體包。
packages for Oracle Linux 7
yum -y install binutils compat-libcap1 compat-libstdc++.i686 compat-libstdc++.x86_64 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc.i686 glibc.x86_64 glibc-devel.i686 glibc-devel.x86_64 ksh libgcc.i686 libgcc.x86_64 libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 libaio.i686 libaio.x86_64 libaio-devel.i686 libaio-devel.x86_64 libXext libXtst libX11 libXau libxcb libXi make sysstat unixODBC-devel.i686 unixODBC-devel.x86_64 unixODBC.i686 unixODBC.x86_64 compat-libstdc++-33.i686 compat-libstdc++-33.x86_64
2.8建立安裝oracle所需使用者與使用者組
root使用者:建立Oracle安裝組oinstall,資料庫管理員組dba,及oracle使用者
[[email protected] ~]# groupadd -g 200 oinstall[[email protected] ~]# groupadd -g 201 dba[[email protected] ~]# useradd -u 440 -g oinstall -G dba -d /home/oracle oracle[[email protected] ~]# passwd oracle
2.9 更改kernel參數
[[email protected] ~]# vi /etc/sysctl.conf#末尾添加如下net.ipv4.ip_local_port_range= 9000 65500 fs.file-max = 6815744 kernel.shmall = 10523004 kernel.shmmax = 6465333657 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 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
執行以下命令使更改生效
[[email protected] ~]# sysctl -p
2.10 修改系統資源限制
[[email protected] ~]# vi /etc/security/limits.conforacle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536
[[email protected] ~]# vi /etc/profile if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fifi
[[email protected] ~]# vi /etc/pam.d/login #下面添加一條pam_limits.so session required pam_limits.so
2.11 建立安裝目錄及設定許可權
[[email protected] /]$ tree /u01//u01/└── oracle ├── app └── oradata
root建立
[[email protected] ~]# mkdir /u01[[email protected] ~]# chown 777 /u01
[[email protected] ~]$ chmod 755 /u01/oracle[[email protected] ~]$ mkdir /u01/oracle/app[[email protected] ~]$ chmod 755 /u01/oracle/app/[[email protected] ~]$ mkdir /u01/oracle/oradata[[email protected] ~]$ chmod 755 /u01/oracle/oradata/[[email protected] ~]$ vi ./.bash_profile# 在檔案末尾添加umask 022export ORACLE_BASE=/u01/oracle/app
2.12 設定oracle環境變數
[[email protected] ~]$ vi ~/.bash_profile export ORACLE_BASE=/u01/oracle/appexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export PATH=$PATH:$ORACLE_HOME/binexport ORACLE_SID=orcl [[email protected] ~]$ source .bash_profile #立即生效複製代碼
2.13 安裝GNOME圖形案頭
yum groupinstall "GNOME Desktop" "Graphical Administration Tools" #安裝startx #進入圖形案頭
export DISPLAY=:0xhost +
三、安裝Oracle Database
使用FileZilla把linux.x64_11gR2_database_1of2.zip、linux.x64_11gR2_database_2of2.zip上傳到CentOS
unzip linux.x64_11gR2_database_1of2.zipunzip linux.x64_11gR2_database_2of2.zip
cd /database./runInstaller #運行安裝程式
輸入郵件地址及密碼(oracle使用者),以從oralce接收安全更新等資訊
選擇安裝資料庫軟體並建立資料,也可以選擇第二項僅安裝資料庫軟體
選擇伺服器版本
本執行個體中選擇安裝單一實例資料庫
進階模式安裝
選擇語言
選擇要安裝的版本,這裡選擇 “Enterprise Edition”
指定Oracle Base 與 Software Location, 我們在oracle使用者的profile檔案裡已設定此環境變數,此處保持預設
指定Inventory Directory, 本例保持預設
選擇資料庫用途
資料庫名及服務名
開啟自動記憶體管理
設定預設編碼為UTF8
樣本方案
啟用Oracle企業管理主控台OEM
選擇資料庫檔案目錄
自動備份設定
設定資料庫使用者名稱和密碼[注意:密碼不要以數字開頭,否則後面會報錯ORA-00922: 選項缺失或無效]
指定oralce特權使用者組,本例保持預設
接下來,oralce安裝程式會對安裝環境進行檢查,
安裝完缺少的package,重新檢查
顯示安裝資訊如下。直接Finish, 開始安裝。
靜待oracle安裝
當出現以下視窗時,另開一個終端,以root使用者登陸,並執行下面的命令。執行完畢後,點擊OK
[[email protected] oracle]# /usr/oracle/oraInventory/orainstRoot.sh
[[email protected] oracle]# /usr/oracle/app/product/11.2.0/dbhome_1/root.sh
至此oracle 11g R2資料庫安裝完畢。
環境變數配置
[[email protected] oracle]$ vi ~/.bash_profile# 在檔案末尾添加export ORACLE_BASE=/usr/oracle/appexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export PATH=$PATH:$ORACLE_HOME/binexport ORACLE_SID=orcl
四、oracle啟動
啟動oracle
su oracleSQL> startup
啟動監聽器
lsnrctl start 啟動lsnrctl status 查看狀態
啟動emctl
emctl start dbconsole
五、遇到問題(解決連結)
http://blog.csdn.net/ljunjie82/article/details/49404481
http://www.voidcn.com/article/p-ftlwoyby-gn.html
centos 7 安裝Oracle Database 11g Release 2 (11.2.0.4)