最近一段時(shí)間在刻苦的學(xué)習(xí)Oracle的體系結(jié)構(gòu)等理論知識(shí),在這里總結(jié)一些知識(shí),以及自己在此做個(gè)實(shí)驗(yàn)擴(kuò)展鞏固最近所學(xué)的知識(shí)。
實(shí)驗(yàn)環(huán)境
Redhat Enterprise Linux 6.5 x86_64 IP地址:192.168.60.100 Oracle 11g release 11.2.0.4系統(tǒng)安裝在此略過,IP地址已經(jīng)更改完成,首先通過ssh協(xié)議登陸到RHEL系統(tǒng),配置YUM本地源環(huán)境,安裝Oracle所必須的軟件依賴包;
[c:\~]$ ssh root@192.168.60.100 [root@rhel6 ~]# vi /etc/yum.conf [local] //修改本地YUM源環(huán)境; name=local baseurl=file:///mnt gpgcheck=0 enabled=1 [root@rhel6 ~]# mount /dev/sr0 /mnt/ //掛載本地光盤作為YUM源; mount: block device /dev/sr0 is write-protected, mounting read-only [root@rhel6 ~]# yum repolist //檢測(cè)本地YUM源配置是否正確; Loaded plugins: product-id, refresh-packagekit, security, : subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. local | 3.9 kB 00:00 ... local/primary_db | 3.1 MB 00:00 ... repo id repo name status local local 3,690 repolist: 3,690 [root@rhel6 ~]#yum install binutils -y //通過YUM安裝Oracle所必須的軟件包; [root@rhel6 ~]#yum install compat-libcap1 -y [root@rhel6 ~]#yum install compat-libstdc++-33 -y [root@rhel6 ~]#yum install gcc -y [root@rhel6 ~]#yum install gcc-c++ -y [root@rhel6 ~]#yum install glibc -y [root@rhel6 ~]#yum install glibc-devel -y [root@rhel6 ~]#yum install ksh -y [root@rhel6 ~]#yum install libgcc -y [root@rhel6 ~]#yum install libstdc++ -y [root@rhel6 ~]#yum install libstdc++-devel -y [root@rhel6 ~]#yum install libaio -y [root@rhel6 ~]#yum install libaio-devel -y [root@rhel6 ~]#yum install libXext -y [root@rhel6 ~]#yum install libXtst -y [root@rhel6 ~]#yum install libX11 -y [root@rhel6 ~]#yum install libXau -y [root@rhel6 ~]#yum install libxcb -y [root@rhel6 ~]#yum install libXi -y [root@rhel6 ~]#yum install make -y [root@rhel6 ~]#yum install sysstat -y [root@rhel6 ~]#yum install unixODBC -y [root@rhel6 ~]#yum install unixODBC-devel -y修改相應(yīng)的系統(tǒng)主機(jī)名以及IP地址
[root@rhel6 ~]# vi /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 192.168.60.100 rhel6添加相應(yīng)的grid用戶及用戶組
[root@rhel6 ~]# groupadd -g 501 oinstall [root@rhel6 ~]# groupadd -g 502 dba [root@rhel6 ~]# groupadd -g 503 oper [root@rhel6 ~]# groupadd -g 504 asmadmin [root@rhel6 ~]# groupadd -g 505 asmoper [root@rhel6 ~]# groupadd -g 506 asmdba [root@rhel6 ~]# useradd -g oinstall -G dba,asmdba,oper oracle [root@rhel6 ~]# useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid [root@rhel6 ~]# passwd oracle [root@rhel6 ~]# passwd grid創(chuàng)建Grid Infrastructure組件安裝目錄
[root@rhel6 ~]# mkdir -p /u01/app/grid [root@rhel6 ~]# mkdir -p /u01/app/11.2.0/grid [root@rhel6 ~]# chown -R grid:oinstall /u01 [root@rhel6 ~]# mkdir -p /u01/app/oraInventory [root@rhel6 ~]# chown -R grid:oinstall /u01/app/oraInventory [root@rhel6 ~]# mkdir -p /u01/app/oracle [root@rhel6 ~]# chown -R oracle:oinstall /u01/app/oracle [root@rhel6 ~]# chmod -R 775 /u01修改操作系統(tǒng)參數(shù)
[root@rhel6 ~]# vi /etc/security/limits.conf grid soft nproc 2047 grid hard nproc 16384 grid soft nofile 1024 grid hard nofile 65536 grid soft stack 10240 grid hard stack 32768 oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 32768修改Linux服務(wù)器ulmits限制
[root@rhel6 ~]# vi /etc/security/limits.d/90-nproc.conf #* soft nproc 1024 * - nproc 16384禁用SELINUX安全限制
[root@rhel6 ~]# vi /etc/selinux/config SELINUX=disabled //修改配置文件永久關(guān)閉selinux; [root@rhel6 ~]# setenforce 0關(guān)閉IPTABLES防火墻
[root@rhel6 ~]# service iptables stop iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ] [root@rhel6 ~]# chkconfig --level 35 iptables off //3、5級(jí)別永久關(guān)閉iptables;修改Linux操作系統(tǒng)的登陸配置文件
[root@rhel6 ~]# vi /etc/pam.d/login session required pam_limits.so修改Linux系統(tǒng)內(nèi)核Kernel配置
[root@rhel6 ~]# vi /etc/sysctl.conf #kernel.shmmax = 68719476736 //注釋掉原先的系統(tǒng)的配置; #kernel.shmall = 4294967296 fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmmax = 858993459 //大于SGA,小于物理內(nèi)存; kernel.shmall = 1048576 //物理內(nèi)存%4K; 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 [root@rhel6 ~]# sysctl -p配置grid和oracle用戶的環(huán)境變量
[root@rhel6 ~]# su - grid //grid用戶環(huán)境變量配置; [grid@rhel6 ~]$ vi .bash_profile PS1="[`whoami`@`hostname`:"'$PWD]$' export PS1 umask 022 export TMP=/tmp export LANG=en_US export TMPDIR=$TMP export ORACLE_HOSTNAME=rhel6 ORACLE_SID=+ASM; export ORACLE_SID ORACLE_TERM=xterm; export ORACLE_TERM ORACLE_BASE=/u01/app/grid; export ORACLE_BASE ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH THREADS_FLAG=native; export THREADS_FLAG if [ $USER = "oracle" ] || [ $USER = "grid" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi umask 022 fi ---------------------------------------------------------------------------- [root@rhel6 ~]# su - oracle [oracle@rhel6 ~]$ vi .bash_profile TMP=/tmp; export TMP TMPDIR=$TMP; export TMPDIR export LANG=en_US ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/11.2.0; export ORACLE_HOME ORACLE_SID=itpuxdb; export ORACLE_SID export ORACLE_UNQNAME=orcl ORACLE_TERM=xterm; export ORACLE_TERM 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/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG if [ $USER = "oracle" ] || [ $USER = "grid" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi umask 022 fi配置udev配置ASM(在此系統(tǒng)所用磁盤為/dev/sda),
[root@rhel6 ~]# fdisk /dev/(sdb\sdc\sdd\sde\sdf) //對(duì)磁盤進(jìn)行分區(qū); [root@rhel6 ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules KERNEL=="sdb1", NAME="asm_grid1", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sdc1", NAME="asm_system", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sdd1", NAME="asm_recovery", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sde1", NAME="asm_data01", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sdf1", NAME="asm_data02", OWNER="grid", GROUP="asmadmin", MODE="0660" [root@rhel6 ~]# partprobe /dev/sdb1 [root@rhel6 ~]# partprobe /dev/sdc1 [root@rhel6 ~]# partprobe /dev/sdd1 [root@rhel6 ~]# partprobe /dev/sde1 [root@rhel6 ~]# partprobe /dev/sdf1 [root@rhel6 ~]# udevadm control --reload-rules [root@rhel6 ~]# start_udev Starting udev: [ OK ] [root@rhel6 ~]# ls -lsa /dev/asm* 0 brw-rw----. 1 grid asmadmin 8, 65 May 24 05:48 /dev/asm_data01 0 brw-rw----. 1 grid asmadmin 8, 81 May 24 05:48 /dev/asm_data02 0 brw-rw----. 1 grid asmadmin 8, 17 May 24 05:48 /dev/asm_grid1 0 brw-rw----. 1 grid asmadmin 8, 49 May 24 05:48 /dev/asm_recovery 0 brw-rw----. 1 grid asmadmin 8, 33 May 24 05:48 /dev/asm_system上傳Oracle安裝包到服務(wù)器
[root@rhel6 ~]#yum -y install lrzsz //安裝xshell所用的FTP軟件; [root@rhel6 ~]#unzip p13390677_112040_Linux-x86-64_3of7.zip [root@rhel6 ~]# chown -R grid:oinstall /opt/grid/配置VNC遠(yuǎn)程桌面
[root@rhel6 ~]# yum -y install vnc-server [root@rhel6 opt]# su - grid [grid@rhel6:/home/grid]$vncserver You will require a password to access your desktops. Password: Verify: xauth: creating new authority file /home/grid/.Xauthority New 'rhel6:1 (grid)' desktop is rhel6:1 Creating default startup script /home/grid/.vnc/xstartup Starting applications specified in /home/grid/.vnc/xstartup Log file is /home/grid/.vnc/rhel6:1.logVNC遠(yuǎn)程桌面連接配置安裝Grid Infrastructure組件
[grid@rhel6 ~]$ cd /opt/grid/ [grid@rhel6 grid]$ ./runInstaller選擇單節(jié)點(diǎn)安裝配置Grid Infrastructure
選擇語言環(huán)境
掃描ASM磁盤
配置統(tǒng)一的賬戶密碼
環(huán)境變量配置正確的情況下會(huì)自動(dòng)識(shí)別用戶組
配置安裝目錄(可手動(dòng)調(diào)整)
檢測(cè)依賴包等信息后,出現(xiàn)警告(因測(cè)試虛擬機(jī)內(nèi)存較少,未能達(dá)到Oracle推薦值這里可以忽略)
執(zhí)行所要求的腳本
配置安裝成功
配置安裝Oracle 客戶端
[root@rhel6 opt]# su - oracle [oracle@rhel6 ~]$ vncserver You will require a password to access your desktops. Password: Verify: xauth: creating new authority file /home/oracle/.Xauthority New 'rhel6:2 (oracle)' desktop is rhel6:2 Creating default startup script /home/oracle/.vnc/xstartup Starting applications specified in /home/oracle/.vnc/xstartup Log file is /home/oracle/.vnc/rhel6:2.log [root@rhel6 opt]# unzip p13390677_112040_Linux-x86-64_1of7.zip [root@rhel6 opt]# unzip p13390677_112040_Linux-x86-64_2of7.zip [root@rhel6 opt]# chown -R oracle.oinstall database/VNC遠(yuǎn)程桌面安裝Oracle軟件
[oracle@rhel6 database]$ ./runInstaller選擇只安裝Oracle軟件(后續(xù)再建實(shí)例)
選擇單實(shí)例節(jié)點(diǎn)安裝
選擇安裝企業(yè)版
Oracle數(shù)據(jù)庫(kù)軟件安裝位置(環(huán)境變量讀取正確不需要修改)
由于測(cè)試環(huán)境內(nèi)存偏小,所以這里可以忽略警告繼續(xù)安裝
以root用戶執(zhí)行所需的腳本
安裝完成
Oracle和ASM配置安裝完成接下來安裝配置ASM,建instance
以grid用戶遠(yuǎn)程桌面登陸,配置ASM磁盤
[grid@rhel6:/home/grid]$asmca以oracle用戶遠(yuǎn)程桌面登陸,配置創(chuàng)建數(shù)據(jù)庫(kù)
[oracle@rhel6 database]$ dbca選擇創(chuàng)建數(shù)據(jù)庫(kù)
由于這里是實(shí)驗(yàn)環(huán)境選擇第一項(xiàng)
配置instance名
由于這里是實(shí)驗(yàn)環(huán)境,選擇啟用OEM,不勾選快速閃回
配置統(tǒng)一的密碼
在此選擇ASM磁盤而非file system,選擇創(chuàng)建的ASM磁盤組
實(shí)驗(yàn)環(huán)境勾選實(shí)例
配置SGA、PGA空間大小,配置中文字符集ZHFS16GBK,配置并發(fā)連接數(shù),配置專用共享池
在此可配置數(shù)據(jù)文件大小以及自動(dòng)擴(kuò)展、redo log組配置,(實(shí)驗(yàn)環(huán)境在此不做過多配置)
在此可將數(shù)據(jù)配置文件等信息導(dǎo)出(方便后續(xù)文檔撰寫)
創(chuàng)建數(shù)據(jù)庫(kù)中...
數(shù)據(jù)庫(kù)安裝完成
以grid用戶查看集群狀態(tài)及監(jiān)聽狀態(tài)
[grid@rhel6:/home/grid]$crsctl status resource -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE rhel6 ora.DSG.dg ONLINE ONLINE rhel6 ora.LISTENER.lsnr ONLINE ONLINE rhel6 ora.asm ONLINE ONLINE rhel6 Started ora.ons OFFLINE OFFLINE rhel6 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.cssd 1 ONLINE ONLINE rhel6 ora.diskmon 1 OFFLINE OFFLINE ora.evmd 1 ONLINE ONLINE rhel6 ora.orcl.db 1 ONLINE ONLINE rhel6 Open ------------------------------------------------------------------------ [grid@rhel6:/home/grid]$lsnrctl status LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 24-MAY-2017 08:28:36 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 24-MAY-2017 07:15:42 Uptime 0 days 1 hr. 12 min. 53 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora Listener Log File /u01/app/grid/diag/tnslsnr/rhel6/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rhel6)(PORT=1521))) Services Summary... Service "+ASM" has 1 instance(s). Instance "+ASM", status READY, has 1 handler(s) for this service... Service "orcl" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... Service "orclXDB" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... The command completed successfully以oracle用戶登錄連接數(shù)據(jù)庫(kù),查詢表空間
[oracle@rhel6 database]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Wed May 24 08:27:56 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> select * from V$TABLESPACE; TS# NAME INC BIG FLA ENC ---------- ------------------------------ --- --- --- --- 0 SYSTEM YES NO YES 1 SYSAUX YES NO YES 2 UNDOTBS1 YES NO YES 4 USERS YES NO YES 3 TEMP NO NO YES 6 EXAMPLE YES NO YES 6 rows selected.在此,Rhel Linux環(huán)境下的udev + ASM Oracle 11gR2安裝部署完成,狀態(tài)正常。
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
網(wǎng)站標(biāo)題:RHEL+Oracle11g+udev+ASM實(shí)驗(yàn)擴(kuò)展-創(chuàng)新互聯(lián)
鏈接分享:http://chinadenli.net/article20/ddisjo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站維護(hù)、搜索引擎優(yōu)化、定制網(wǎng)站、移動(dòng)網(wǎng)站建設(shè)、網(wǎng)站收錄、自適應(yīng)網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容