本文來自我的github pages博客http://galengao.github.io/ 即www.gaohuirong.cn
摘要:
- 自己在centos6.6上搭建的單實例oracle12c
- 由於搭建過程有些不好寫,所以圖片偏多
-
*由於截圖不規則導致排版有點亂,已經安裝過來了,有些截圖不能回頭截圖了,見諒
- oracle軟件與linux 認證版本
- 檢查硬件要求(Check Hardware Requirements)
Check CPU
grep "model name" /proc/cpuinfo cat /proc/cpuinfo | grep "processor" | wc -l cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
Check Memory
grep MemTotal /proc/meminfo grep SwapTotal /proc/meminfo free -g
Oracle 12c 對系統內存的最低要求為1G,推薦2G或更大的內存
Oracle對交換分區(Swap Space)的推薦設置如下
Check Disk Capacity
df -h
Oracle 12c 企業版的需要6.4G大小的磁盤空間,標准版需要6.1G大小的磁盤空間。/tmp 需要至少1G的大小
- 檢查軟件要求(Checking the Software Requirements)
操作系統版本檢測
Oracle 12 c 只支持64位的Linux系統。不支持32Linux平台,這也許是以后的趨勢了。Operating System Requirements for x86-64 Linux Platforms。
Oracle 的官方文檔明確列出了支持下面三個Linux版本:
Supported Oracle Linux 6 and Red Hat Enterprise Linux 6 Distributions for x86-64
Supported Oracle Linux 5 and Red Hat Enterprise Linux 5 Distributions for x86-64
Supported SUSE Distributions for x86-64
uname -m uname -r more /etc/redhat-release uname -a lsb_release -id
依賴包檢查
Packages for 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) libXext-1.1 (x86_64) libXext-1.1 (i686) libXtst-1.0.99.2 (x86_64) libXtst-1.0.99.2 (i686) libX11-1.3 (x86_64) libX11-1.3 (i686) libXau-1.0.5 (x86_64) libXau-1.0.5 (i686) libxcb-1.5 (x86_64) libxcb-1.5 (i686) libXi-1.3 (x86_64) libXi-1.3 (i686) make-3.81-19.el6 sysstat-9.0.4-11.el6 (x86_64)
檢查包
rpm -q binutils compat-libcap1 compat-libstdc++ gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXext libXtst libX11 libXau libXi make sysstat
還有7個沒安裝
yum install compat-libcap1 compat-libstdc++ gcc gcc-c++ ksh libaio-devel libstdc++-devel
如yum沒有的就從本地光盤或者下載來安裝
- service iptables stop
chkconfig iptables off
- vi /etc/selinux/config
修改
SELINUX=disabled
- vi etc/hosts
增加
192.168.1.140 dgp
- 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 oracle hard stack 32768 ###若RAC,需要增加如下 grid soft nproc 2047 grid hard nproc 16384 grid soft nofile 1024 grid hard nofile 65536 grid soft stack 10240 grid hard stack 32768
- 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
注:因為kernel.shmall和kernel.shmmax 系統里已經有比它大的值了,所以把這兩個參數注釋
sysctl -p 生效
- vi /etc/profile
if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi
篇幅太長,截取部分
- vi /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so
- 上傳oracle12c軟件並解壓
mkdir /u01
- 創建oracle用戶和用戶組
groupadd dba groupadd oinstall useradd -g oinstall -G dba oracle passwd oracle chown -R oracle:oinstall /u01
- 啟動xmanager圖形界面安裝
如果沒圖形界面,需要先安裝
yum groupinstall "X Window System" yum -y groupinstall Desktop runlevel vi /etc/inittab id:5:initdefault:
先啟動Xmanager - Passive
然后啟動 Xstart
輸入主機地址,協議用SSH,然后彈出輸入密碼
進入securecrt 切換到oracle用戶
su - oracle
輸入export DISPLAY=192.168.10.20:0.0 ##本地ip
- 開始安裝oracle12c
cd database ./runInstaller
- 不需要支持,彈出提示時點yes
- 先僅安裝數據庫軟件
- 這里安裝單實例的
- 選擇默認英語
- 默認企業版
- 軟件安裝路徑
如果空間不夠,新增一塊硬盤,然后格式化並掛載上去
fdisk -l
fdisk /dev/sdb
- 默認
- 默認
- 安裝條件檢查,前面准備好一般沒什么問題;
- 然后開始安裝
- 配置環境變量
source .bash_profile
- dbca創建實例
- 設置全局庫名及密碼下一步
- 先決條件檢查,這里空間不夠先忽略
- 前面設置的預覽
- 點結束開始安裝
- 檢查
至此就安裝結束了