姿姿霸霸~~!
          貴在堅(jiān)持!
          posts - 106,  comments - 50,  trackbacks - 0
          這兩天遇到客戶因?yàn)檎`操作,將RAC環(huán)境下的所有共享存儲(chǔ)格式化掉了,客戶只有一個(gè)最近的RMAN的0級(jí)全備(無(wú)數(shù)據(jù)文件,無(wú)控制文件,無(wú)歸檔日志,無(wú)redo日志),需要幫忙恢復(fù)。將大致的恢復(fù)過(guò)程記錄一下。

          0.恢復(fù)共享存儲(chǔ)是第一步,給存儲(chǔ)原廠打電話,原廠推是os的問(wèn)題,讓給os打電話,結(jié)果只能初始化了,最后只能恢復(fù)到被識(shí)別的狀態(tài),一切從頭開(kāi)始。

          1.因?yàn)榧很浖茄b在本地的,所以恢復(fù)rac的集群環(huán)境,只需要將ocr和vdisk重新配置一下,就可以了。可以執(zhí)行root.sh腳本來(lái)進(jìn)行重新的配置,如果中間報(bào)一個(gè)已經(jīng)被配置過(guò)的提示,那就先用dd清除ocr和vdisk的信息,并刪除相應(yīng)的目錄文件,如下:
          rm -rf /usr/tmp/.oracle /var/tmp/.oracle /tmp/.oracle /etc/oracle/* /var/opt/oracle/*  
          rm -rf /etc/init.cssd /etc/init.crs* /etc/init.evmd /etc/init.d/init.cssd /etc/init.d/init.crs  
          rm -rf /etc/init.d/init.crsd /etc/init.d/init.evmd /etc/rc3.d/K96init.crs /etc/rc3.d/S96init.crs  
          rm -rf /etc/rc.d/rc2.d/K96init.crs /etc/rc.d/rc2.d/S96init.crs

          2.恢復(fù)完集群環(huán)境之后,開(kāi)始恢復(fù)數(shù)據(jù)庫(kù)。因?yàn)樵儐?wèn)到客戶有去年年底的一個(gè)RMAN的0級(jí)全備,以及控制文件的快照沒(méi)有放到共享存儲(chǔ)上,故可以采用重建控制文件+restore備份的方法來(lái)恢復(fù)。中途遇到很多問(wèn)題,因?yàn)樗械娜罩緜浞菥诺焦蚕泶鎯?chǔ)下的,故這次恢復(fù)在recover的步驟時(shí)是沒(méi)有日志用來(lái)補(bǔ)充的。所以restore databse until 時(shí)間后,再recover,再alter database open resetlogs后,會(huì)報(bào)一個(gè)需要恢復(fù)數(shù)據(jù)文件的錯(cuò)誤提示,操作的時(shí)候運(yùn)氣不好,剛好遇到的是需要恢復(fù)datafile 1,再折騰了幾個(gè)小時(shí)候,終于發(fā)現(xiàn)按照正常的手段是行不通的.

          3.因?yàn)闆](méi)有日志,無(wú)法使得數(shù)據(jù)庫(kù)達(dá)到一致性,所以只有采取修改隱藏參數(shù)的辦法來(lái)忽略數(shù)據(jù)庫(kù)的不一致,來(lái)強(qiáng)行打開(kāi)數(shù)據(jù)庫(kù).先將數(shù)據(jù)庫(kù)打到mount狀態(tài),在做完restore,recover之后,將隱藏參數(shù)修改 alter system set "_allow_resetlogs_corruption"=true scope=spfile;再shutdown數(shù)據(jù)庫(kù),啟動(dòng)到mount狀態(tài)之后,alter database open resetlogs; resetlogs打開(kāi)數(shù)據(jù)庫(kù)后,運(yùn)氣仍然不是太好,又遇到了ORA-00600 2662號(hào)的錯(cuò)誤.

          4. 當(dāng)使用修改_allow_resetlogs_corruption ,再打開(kāi)數(shù)據(jù)庫(kù)時(shí)遇到了ORA-00600 2662號(hào)的錯(cuò)誤, 如果SCN相差不多,可以通過(guò)多次重起數(shù)據(jù)庫(kù)解決 ,但是這次遇到的SCN相差很大(通過(guò)查v$datafile和v$datafile_header的CHECKPOINT_CHANGE#來(lái)判斷),這個(gè)時(shí)候只有再修改另外一個(gè)隱藏參數(shù) _minimum_giga_scn來(lái)解決問(wèn)題._minimum_giga_scn的作用是推進(jìn)SCN號(hào),該參數(shù)值的單位是billion,也就是說(shuō)設(shè)置了該參數(shù)后,SCN號(hào)會(huì)變成XX* (1024*1024*1024) ,XX可以通過(guò)2662的幾個(gè)參數(shù)來(lái)確定. 2662后的參數(shù)[2662],[a],[b],[c],[d],[e]…[a] Current SCN WRAP,[b] Current SCN BASE,[c] dependent SCN WRAP,[d] dependent SCN BASE,[e] Where present this is the DBA where the dependent SCN came from.

          5.當(dāng)修改了2個(gè)隱藏參數(shù)之后,數(shù)據(jù)庫(kù)終于能啟動(dòng)了,但是alert日志還是會(huì)報(bào)一些600的錯(cuò)誤,暫時(shí)忽略.用exp(expdp可能會(huì)報(bào)錯(cuò))將數(shù)據(jù)全部導(dǎo)出,重建新的實(shí)例,再用imp導(dǎo)入數(shù)據(jù)到新的庫(kù)中.exp的時(shí)候需要注意一個(gè)參數(shù)compress,這個(gè)參數(shù)可以降低HWM,使的imp的時(shí)候,時(shí)間相對(duì)盡量少一些.
          posted @ 2012-04-12 00:24 xrzp 閱讀(400) | 評(píng)論 (0)編輯 收藏
          早上做個(gè)實(shí)驗(yàn),update數(shù)據(jù)的時(shí)候報(bào)錯(cuò)ora-30036:無(wú)法按8擴(kuò)展段(在還原表空間‘undotbs_new’中)

          1.查詢了一下undo表空間的使用,發(fā)現(xiàn)已經(jīng)超過(guò)了80%
          SELECT a.tablespace_name as tablespace_name,
                 to_char(b.total
          /1024/1024,999999.99as Total,
                 to_char((b.total
          -a.free)/1024/1024,999999.99as Used,
                 to_char(a.free
          /1024/1024,999999.99as Free,
                 to_char(
          round((total-free)/total,4)*100,999.99as Used_Rate
          FROM (SELECT tablespace_name, sum(bytes) free FROM DBA_FREE_SPACE GROUP BY tablespace_name) a,
               (
          SELECT tablespace_name, sum(bytes) total FROM DBA_DATA_FILES GROUP BY tablespace_name ) b
          WHERE a.tablespace_name=b.tablespace_name
            
          AND a.tablespace_name='UNDOTBS_NEW'
          ORDER BY a.tablespace_name;

          2.將undo表空間大小重新加大點(diǎn),解決問(wèn)題~
          alter database datafile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\SUREDD\UNTOTBS_NEW_01.DBF' resize 2048M;
          posted @ 2011-11-07 10:30 xrzp 閱讀(18095) | 評(píng)論 (0)編輯 收藏
          v$sqltext:存儲(chǔ)的是完整的SQL,SQL被分割
          v$sqlarea:存儲(chǔ)的SQL 和一些相關(guān)的信息,比如累計(jì)的執(zhí)行次數(shù),邏輯讀,物理讀等統(tǒng)計(jì)信息.v$sqlarea 忽略了執(zhí)行計(jì)劃等差異,只是在形式上sql文本看起來(lái)一樣.相當(dāng)于做了個(gè)聚合,是多個(gè)不同執(zhí)行計(jì)劃的sql的聚合和累計(jì)信息 
          v$sql:存儲(chǔ)的是具體的SQL 和執(zhí)行計(jì)劃相關(guān)信息,v$sqlarea 可以看做 v$sql 根據(jù) sqltext 等 做了 group by 之后的信息
          v$sql_plan:代表了具體的sql的執(zhí)行計(jì)劃,通過(guò)下面3個(gè)字段做連接(與v$sql)
          ADDRESS RAW(4),HASH_VALUE NUMBER,CHILD_NUMBER NUMBER
          posted @ 2011-11-07 00:00 xrzp 閱讀(360) | 評(píng)論 (0)編輯 收藏
          這幾天安裝oracle,檢查包的時(shí)候,發(fā)現(xiàn)一些包沒(méi)有裝上,使用rpm來(lái)裝的時(shí)候,又發(fā)現(xiàn)包的依耐性很重,所以就搭建一個(gè)本地的源,使用yum install來(lái)安裝.

          1.掛載安裝介質(zhì) 
          mount /dev/cdrom /mnt/cdrom

          如果是實(shí)體機(jī):
          mount 
          -o loop  鏡像所在目錄  掛載點(diǎn)

          2.vi /etc/yum.repos.d/server.repo
          [dange]                                        #隨意填
          name
          =red hat                                   #隨意填
          baseurl
          =file:///mnt/cdrom/RedHat/Server        #光盤掛載,Server目錄所在路徑
          enable
          =1                                       #yum開(kāi)關(guān)
          gpgcheck
          =1                                     #是否檢查密鑰
          gpgkey
          =file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release      #密鑰所在地

          3.如果安裝軟件包提示沒(méi)有key的話導(dǎo)入key
          cd /mnt/cdrom
          rpm 
          --import  RPM-GPG-KEY-redhat-release   //安裝驗(yàn)證文件,導(dǎo)入key
          yum list                                   //列出倉(cāng)庫(kù)中的所有軟件,查看yum是否搭建成功
          yum clean  
          all                             //清空yum倉(cāng)庫(kù)

          4.OK,可以直接使用yum install了
          posted @ 2011-10-20 09:22 xrzp 閱讀(421) | 評(píng)論 (0)編輯 收藏
          1.現(xiàn)象:裝clusterware,執(zhí)行第二個(gè)腳本的時(shí)候可能會(huì)報(bào)錯(cuò)
          Running vipca(silent) for configuring nodeapps
          /u01/app/oracle/crs/jdk/jre//bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory


          2. 解決方案:分別修改 $CRS_HOME/bin 目錄下的srvctl和vipca文件,在vipca文件ARGUMENTS=""行之前和srvctl文件的export LD_ASSUME_KERNEL行之后增加 unset LD_ASSUME_KERNEL 語(yǔ)句.
           修改之后再用root用戶執(zhí)行vipca就可以了.
          posted @ 2011-10-16 23:31 xrzp 閱讀(323) | 評(píng)論 (0)編輯 收藏
          Mount Options for Oracle files when used with NAS devices [ID 359515.1]

           修改時(shí)間 23-SEP-2011     類型 BULLETIN     狀態(tài) PUBLISHED 

          In this Document
            Purpose
            Scope and Application
            Mount Options for Oracle files when used with NAS devices
               RAC  
                Single Instance
            References


           

           

          Applies to:

          Oracle Server - Enterprise Edition - Version: 10.1.0.2 to 11.2.0.2 - Release: 10.1 to 11.2
          Information in this document applies to any platform.
          Oracle Clusterware, Oracle Real Application Clusters, NAS

          Purpose

          The purpose of this bulletin is to document the options with which the NAS systems should be mounted. This note does not cover the new dNFS feature that was introduced in 11g.

          Scope and Application

          This document is relevant to all environments using Oracle Clusterware & RAC. 

          Mount Options for Oracle files when used with NAS devices

          RAC  


          In the table below 
          • Binaries is the shared mount points where the Oracle Home and CRS_HOME is installed.
          • Datafiles includes Online Logs, Controlfile and Datafiles
          • nfsvers and vers are identical on those OS platforms that has nfsvers.  The ver option is an alternative to the nfsvers option. It is included for compatibility with other operating systems
          • Please note that the mount options on each of the following cells are applicable only to those type of files listed in the column heading.
          • For RMAN backup sets, image copies, and Data Pump dump files, the "NOAC" mount option should not be specified - that is because RMAN and Data Pump do not check this option and specifying this can adversely affect performance. 

          Operating System

          Mount options for    Binaries ##

          Mount options for Oracle DatafilesMount options for CRS Voting Disk and OCR
          Sun Solaris *

          rw,bg,hard,nointr,rsize=32768,
          wsize=32768,proto=tcp,noac,

          vers=3,suid

          rw,bg,hard,nointr,rsize=32768,
          wsize=32768,proto=tcp,noac,
          forcedirectio, vers=3,suid
          rw,bg,hard,nointr,rsize=32768,
          wsize=32768,proto=tcp,vers=3,
          noac,forcedirectio
          AIX (5L) **

          rw,bg,hard,nointr,rsize=32768,
          wsize=32768,proto=tcp,

          vers=3,timeo=600

          cio,rw,bg,hard,nointr,rsize=32768,
          wsize=32768,proto=tcp,noac,
          vers=3,timeo=600

          cio,rw,bg,hard,intr,rsize=32768,
          wsize=32768,tcp,noac,
          vers=3,timeo=600

          HPUX 11.23 ***  --rw,bg,vers=3,proto=tcp,noac,
          hard,nointr,timeo=600,
          rsize=32768,wsize=32768,suid
          rw,bg,vers=3,proto=tcp,noac,
          forcedirectio,hard,nointr,timeo=600,
          rsize=32768,wsize=32768,suid
          rw,bg,vers=3,proto=tcp,noac,
          forcedirectio,hard,nointr,timeo=600
          ,rsize=32768,wsize=32768,suid
          WindowsNot SupportedNot SupportedNot Supported
          Linux x86
          #
          ****

          rw,bg,hard,nointr,rsize=32768,
          wsize=32768,tcp, vers=3,
          timeo=600, actimeo=0

          rw,bg,hard,nointr,rsize=32768,
          wsize=32768,tcp,actimeo=0,
          vers=3,timeo=600

          rw,bg,hard,nointr,rsize=32768,
          wsize=32768,tcp,noac,actimeo=0,
          vers=3,timeo=600

          Linux x86-64 #
          ****
          rw,bg,hard,nointr,rsize=32768,
           wsize=32768,tcp,vers=3,
          timeo=600, actimeo=0
          rw,bg,hard,nointr,rsize=32768, 
          wsize=32768,tcp,actimeo=0, 
          vers=3,timeo=600
          rw,bg,hard,nointr,rsize=32768, 
          wsize=32768,tcp,noac,vers=3,
          timeo=600,actimeo=0
          Linux - Itaniumrw,bg,hard,nointr,rsize=32768, 
          wsize=32768,tcp,vers=3,
          timeo=600, actimeo=0
          rw,bg,hard,nointr,rsize=32768, 
          wsize=32768,tcp,actimeo=0, 
          vers=3,timeo=600
          rw,bg,hard,nointr,rsize=32768, 
          wsize=32768,tcp,noac,vers=3,
          timeo=600,actimeo=0

          * NFS mount option “forcedirectio” is required on Solaris platforms when mounting the OCR/CRS files when using Oracle 10.1.0.4 or 10.2.0.2 or later (Oracle unpublished bug 4466428) 
          ** AIX is only supported with NAS on AIX 5.3 TL04 and higher with Oracle 10.2.0.1 and later (NetApp) 
          *** NAS devices are only supported with HPUX 11.23 or higher ONLY 
          **** As per BUG 11812928, the 'intr' & 'nointr' are deprecated in OEL 5.6 kernels and up including Oracle Linux 6. It is harmless to still include it, but the "NFS: ignoring mount option: nointr" will appears. This message can be ingnored.


          # These mount options are for Linux kernels 2.6 and above for older kernels please check Note 279393.1

          Due to Unpublished bug 5856342, it is necessary to use the following init.ora parameter when using NAS with all versions of RAC on Linux (x86 & X86-64 platforms) until 10.2.0.4. This bug is fixed and included in 10.2.0.4 patchset.
          filesystemio_options = DIRECTIO

           Single Instance

           

          Operating System

          Mount options for BinariesMount options for Oracle Datafiles
          Sun Solaris *
          (8, 9, 10)

          rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,proto=tcp,suid

          rw,bg,hard,rsize=32768,wsize=32768,vers=3,[forcedirectio or llock],nointr,proto=tcp,suid
          AIX (5L) **

          rw,bg,hard,rsize=32768,wsize=32768,vers=3,intr,timeo=600,proto=tcp

          rw,bg,hard,rsize=32768,wsize=32768,vers=3,cio,intr,timeo=600,proto=tcp

          HPUX 11.23 ****rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,proto=tcp,suidrw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,proto=tcp, suid, forcedirectio
          WindowsNot SupportedNot Supported
          Linux x86
          #
          rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcprw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp,actimeo=0*
          Linux x86-64 #rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcprw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp,actimeo=0*
          Linux - Itaniumrw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcprw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,tcp

           

          * actime=0 or noac can be used


          References

          http://now.netapp.com/Knowledgebase/solutionarea.asp?id=kb7518
          http://linux.oracle.com/pls/apex/f?p=102:2:3947951439689189::NO::P2_VC_ID:424

          顯示相關(guān)信息 相關(guān)內(nèi)容


          產(chǎn)品
          • Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
          關(guān)鍵字
          CLUSTERWARE; CRS; NAS; NETAPP
          錯(cuò)誤
          KCCCHB_3; ORA-600[KCCCHB_3]

          posted @ 2011-10-16 23:16 xrzp 閱讀(1546) | 評(píng)論 (0)編輯 收藏
          1.檢查時(shí)區(qū):
          檢查/etc/sysconfig/clock設(shè)置:
          ZONE
          ="Asia/Shanghai"(Linux會(huì)拷貝/usr/share/zoneinfo/Asia/Shanghai 到/etc/locatime作為本地時(shí)區(qū),如果我們需要改變時(shí)區(qū),那么只需要修改/etc/sysconfig/clock,并且將對(duì)應(yīng)的/usr/share/zoneinfo/Asia的時(shí)區(qū)文件拷貝成/etc/localtime即可)
          UTC
          =false
          ARC
          =false

          2.安裝NTP包:
          rpm -ivh ntp-xxxxxx.rpm
          或者:
          yum install ntp

          3.編輯/etc/ntp.conf文件:
          服務(wù)端:
          server 
          127.127.1.0
          fudge 
          127.127.1.0 stratum 11
          driftfile 
          /var/lib/ntp/drift
          broadcastdelay 
          0.008
          客戶端:
          server 
          192.168.0.11 prefer #192.168.0.11為服務(wù)端的ip地址
          driftfile 
          /var/lib/ntp/drift
          broadcastdelay 
          0.008

          4.重啟ntp服務(wù):
          service ntpd restart

          5.等待5分鐘,測(cè)試客戶端更新時(shí)間:
          ntpdate 192.168.0.11 
          Oct 
          16 21:09:28 ntpdate[8316]: step time server 192.168.0.11  offset -1791.709393 sec

          6.在客戶端將更新時(shí)間加入crontab:
          (1).cp /usr/sbin/ntpdate /usr/bin/
          (
          2).crontab –e
          加入
          */1 * * * * /usr/sbin/ntpdate 192.168.0.11 ; hwclock –w

          7.加入自啟動(dòng)
          chkconfig ntpd on
          posted @ 2011-10-16 23:14 xrzp 閱讀(425) | 評(píng)論 (0)編輯 收藏

          gunzip xxx.cpio.gz

          cpio -idcmv < xxx.cpio

          posted @ 2011-10-16 23:02 xrzp 閱讀(465) | 評(píng)論 (1)編輯 收藏
          1.查看版本
          crsctl query crs softwareversion
          crsctl query crs activeversion
          2.管理
          srvctl start nodeapps -<node1 hostname> 
          srvctl start nodeapps 
          -<node2 hostname> 
          srvctl start asm 
          -<node1 hostname> 
          srvctl start asm 
          -<node2 hostname> 
          srvctl start 
          database -<database name> 
          srvctl start service 
          -<database name> -<service name> 
          crs_stat 
          -t

          srvctl stop service 
          -<database name> -<service name> 
          srvctl stop 
          database -<database name> 
          srvctl stop asm 
          -<node1 hostname> 
          srvctl stop asm 
          -<node2 hostname> 
          srvctl stop nodeapps 
          -<node1 hostname> 
          srvctl stop nodeapps 
          -<node2 hostname> 
          crs_stat 
          -
          posted @ 2011-10-16 23:01 xrzp 閱讀(265) | 評(píng)論 (0)編輯 收藏
          當(dāng)服務(wù)器沒(méi)有裝圖形化界面的時(shí)候,如不能使用xhost之類的命令,就不能使用vnc了,那這個(gè)時(shí)候可以使用xmanager來(lái)代替

          1.網(wǎng)上可以下載一個(gè)xmanager企業(yè)版,下載完后打開(kāi)Xbrowser,在help-->about Xbrowser中輸入注冊(cè)碼

          2.在服務(wù)器端
          DISPLAY=192.168.X.X:0.0
          export DISPLAY
          echo $DISPLAY

          3.使用xmanager的xshell來(lái)打開(kāi)圖形化界面.(有可能會(huì)提醒運(yùn)行一個(gè)rootpre之類的腳本)
          posted @ 2011-10-14 01:35 xrzp 閱讀(514) | 評(píng)論 (0)編輯 收藏
          在Redhat5之前通過(guò)/etc/sysconfig/rawdevices配置raw的控制文件,通過(guò)/etc/init.d/rawdevices來(lái)管理raw設(shè)備的啟動(dòng)和關(guān)閉.
          在Redhat5之后,需要編輯/etc/udev/rules.d/60-raw.rules 這個(gè)文件.
          1.假設(shè)已經(jīng)把一個(gè)硬盤新建了幾個(gè)區(qū)
          fdisk -l /dev/sdc
          /dev/sdc1
          /dev/sdc2
          /dev/sdc3

          2.修改/etc/udev/rules.d/60-raw.rules
          添加:
          ACTION=="add", KERNEL=="sdc1",RUN+="/bin/raw /dev/raw/raw1 %N"
          ACTION=="add", KERNEL=="sdc2",RUN+="/bin/raw /dev/raw/raw2 %N"
          ACTION=="add", KERNEL=="sdc3",RUN+="/bin/raw /dev/raw/raw3 %N"
          假設(shè)這個(gè)設(shè)備是給oracle用的,那再加上權(quán)限
          KERNEL=="raw[1-3]*", NAME="raw/%k" OWNER="oracle" GROUP="oinstall", MODE="0660"

          3.修改完之后重啟服務(wù)
          start_udev

          4.查看
          raw -qa 或者 ls -lrt /dev/raw/

          5.取消映射
           raw /dev/raw/rawX 0 0 
          posted @ 2011-10-14 01:28 xrzp 閱讀(453) | 評(píng)論 (0)編輯 收藏
          1.停止數(shù)據(jù)庫(kù) 
          2.停止Listener 
          3.用su或者重新登錄到root將oracle安裝目錄刪除 
          4.將/usr/bin下的文件刪除(刪除這三個(gè)文件后,Oracle就不能使用了) 
           rm /usr/local/bin/dbhome 
           rm /usr/local/bin/oraenv 
           rm /usr/local/bin/coraenv 
          5.將/etc/oratab刪除 
          6.將/etc/oraInst.loc刪除 
          7.將oracle用戶刪除(若要重新安裝,可以不刪除) 
          8.將用戶組刪除(若要重新安裝,可以不刪除)
          posted @ 2011-10-14 01:22 xrzp 閱讀(355) | 評(píng)論 (1)編輯 收藏
          做一個(gè)awr報(bào)告,在Load Profile可以查看到每秒的redo size(單位是byte),而redo log一般切換時(shí)間是1小時(shí)2-3次,按照3次來(lái)計(jì)算,就是20分鐘切換一次,所以redo log的大小就 = (redo size per second) * 60 * 20.
          如果不能做awr報(bào)告,就去查看alert日志,看日志的切換頻率,根據(jù)切換的頻率來(lái)確定redo log的大小.

          可能會(huì)用到的sql語(yǔ)句:
          select * from v$logfile;
          select * from v$log;
          alter database add logfile group x ('F:\oraredolog\REDO0x.LOG') size xxxM;
          alter database drop logfile group x;
          alter system switch logfile;
          alter system checkpoint;
          posted @ 2011-10-10 13:34 xrzp 閱讀(634) | 評(píng)論 (0)編輯 收藏
          在虛擬機(jī)上起動(dòng)系統(tǒng)的時(shí)候,每次都發(fā)現(xiàn)Sendmail服務(wù)很費(fèi)時(shí)間,決定將其關(guān)閉了,反正也沒(méi)怎么用.
          1.關(guān)閉sendmail服務(wù)
          [root@node1 ~]# /etc/rc.d/init.d/sendmail stop
          Shutting down sm-client:                                 [  OK  ]
          Shutting down sendmail:                                    [  OK  ]

          2.關(guān)閉sendmail自啟動(dòng)
          [root@node1 ~]# chkconfig sendmail off

          3.
          確認(rèn)sendmail自啟動(dòng)已被關(guān)閉
          [root@node1 ~]#  chkconfig --list sendmail
          sendmail        0:off   1:off   2:off   3:off   4:off   5:off   6:off
          posted @ 2011-10-10 11:36 xrzp 閱讀(364) | 評(píng)論 (0)編輯 收藏
          V9.7中提供了更簡(jiǎn)單易用的降低高水位標(biāo)記功能。只需要使用ALTER TABLESPACE命令就可以達(dá)到效果。同時(shí)DB2還提供了兩個(gè)表函數(shù)MON_GET_TABLESPACE和MON_GET_EXTENT_MOVEMENT_STATUS來(lái)獲取和監(jiān)控表空間以及數(shù)據(jù)塊移動(dòng)信息。

          1.MON_GET_TABLESPACE語(yǔ)法
          MON_GET_TABLESPACE--(--tbsp_name--,--member--)
          tbsp_name是表空間對(duì)象,如果是空值,則會(huì)對(duì)所有的表空間操作。member的默認(rèn)輸入是-1,指當(dāng)前成員,如果是-2,則是所有數(shù)據(jù)庫(kù)成員。這個(gè)函數(shù)的返回值說(shuō)明:
          tbsp_name:表空間名
          tbsp_type:表空間類型
          tbsp_state:表空間狀態(tài)
          tbsp_used_pages:已使用頁(yè)
          tbsp_free_pages:空閑頁(yè)
          tbsp_total_pages:總頁(yè)
          tbsp_page_top:高水位標(biāo)記頁(yè)
          reclaimble_space_enabled:值1代表可回收空間
          select * from table(MON_GET_TABLESPACE(null,-2));

          2.獲取表空間信息
          SELECT varchar(tbsp_name, 16as tbsp_name,
                 RECLAIMABLE_SPACE_ENABLED,
                 TBSP_USED_PAGES,
                 TBSP_FREE_PAGES,
                 TBSP_PAGE_TOP
            
          from TABLE(MON_GET_TABLESPACE(''-2)) AS t
           
          where t.TBSP_PAGE_TOP > t.TBSP_USED_PAGES
          該語(yǔ)句篩選出了所有高水位標(biāo)記大于已使用頁(yè)的表空間

          3.ALTER TABLESPACE 語(yǔ)法
          ALTER TABLESPACE--tablespace-name----------------------------> >----+-REDUCE--+-------------------------------+--+-----------------------------+-+ | +-| database-container-clause |-+ '-| on-db-partitions-clause |-' | | +-| all-containers-clause |-----+ | | +-MAX---------------------------+ | | +-STOP--------------------------+ | | '-integer--+---------+----------' | | +-K-------+ | | +-M-------+ | | +-G-------+ | | '-PERCENT-' | +-LOWER HIGH WATER MARK--+------+--------------------------------------------+ | '-STOP-' | '----------------------------------------------------------------------------'
          MAX參數(shù)可以指定最大限度的降低高水位標(biāo)記來(lái)釋放空間。在運(yùn)行REDUCE命令后,在數(shù)據(jù)塊移動(dòng)的過(guò)程中,也可以使用STOP參數(shù)來(lái)停止表空間移動(dòng)。如果是DMS表空間,則需要先運(yùn)行LOWER HIGH WATER MARK子句降低高水位標(biāo)記,再運(yùn)行REDUCE子句釋放表空間。如果是啟用了自動(dòng)存儲(chǔ)的表空間,直接運(yùn)行REDUCE子句即可。
          自動(dòng)存儲(chǔ)表空間
          ALTER TABLESPACE REDUCE 100 M(MAX)
          DMS 表空間
          ALTER TABLESPACE LOWER HIGH WATER MARK ALTER TABLESPACE REDUCE (ALL CONTAINERS 10 M(MAX)) 

          4.MON_GET_EXTENT_MOVEMENT_STATUS語(yǔ)法
          MON_GET_EXTENT_MOVEMENT_STATUS--(--tbsp_name--,--member--)
          tbsp_name 是表空間對(duì)象,如果是空值,則會(huì)對(duì)所有的表空間操作。member 的默認(rèn)輸入是 -1,指當(dāng)前成員,如果是 -2,則是所有數(shù)據(jù)庫(kù)成員。這個(gè)函數(shù)的返回值說(shuō)明:
          tbsp_name:表空間名
          tbsp_id:表空間id
          member:成員
          current_extent:當(dāng)前正在移動(dòng)數(shù)據(jù)塊
          last_extent:最后移動(dòng)的數(shù)據(jù)塊
          num_extents_moved:已移動(dòng)的數(shù)據(jù)塊
          num_extents_left:未移動(dòng)的數(shù)據(jù)塊
          total_move_time:總移動(dòng)時(shí)間(微秒)

          5.監(jiān)視表空間的移動(dòng)
          SELECT varchar(tbsp_name, 20as tbsp_name,
                 NUM_EXTENTS_MOVED,
                 NUM_EXTENTS_LEFT,
                 TOTAL_MOVE_TIME
            
          from TABLE(MON_GET_EXTENT_MOVEMENT_STATUS('TBS1'-2)) AS t

          6.驗(yàn)證高水位標(biāo)記的降低
          SELECT varchar(tbsp_name, 16as tbsp_name,
                 BSP_USED_PAGES,
                 TBSP_FREE_PAGES,
                 TBSP_PAGE_TOP
            
          from TABLE(MON_GET_TABLESPACE('TBS1'-2)) AS t
          posted @ 2011-10-08 10:20 xrzp 閱讀(2949) | 評(píng)論 (1)編輯 收藏
          1.查看表空間信息
          使用list tablespaces show detail
          需要關(guān)注的幾個(gè)參數(shù)
          Tablespace ID:db2dart工具需要以這個(gè)ID作為參數(shù)
          表的類型:只有DMS管理的表空間才有HWM的標(biāo)記屬性
          Used pages和High water mark:如果相等,說(shuō)明高水位標(biāo)記下沒(méi)有空閑頁(yè)可以被釋放
          2.查看HWM標(biāo)記信息
          使用db2dart dbname /DHWM /TSI tbsid
          3.降低高水位標(biāo)記建議
          使用db2dart dbname /LHWM /TSI tbsid /NP 0
          posted @ 2011-10-08 09:52 xrzp 閱讀(348) | 評(píng)論 (0)編輯 收藏
          1.對(duì)索引結(jié)構(gòu)進(jìn)行統(tǒng)計(jì)
          1.1analyze index indexname validate structure
          聯(lián)機(jī)文檔的原文:Specify VALIDATE STRUCTURE to validate the structure of the analyzed object. 
          The statistics collected by this clause are not used by the Oracle Database optimizer, as are statistics collected by the COMPUTE STATISTICS and ESTIMATE STATISTICS clauses.
          For an index, Oracle Database verifies the integrity of each data block in the index and checks for block corruption. This clause does not confirm that each row in the table has an index entry or that each index entry points to a row in the table. You can perform these operations by validating the structure of the table with the CASCADE clause.
          這個(gè)命令主要是用來(lái)分析索引的數(shù)據(jù)塊是否有壞塊,以及根據(jù)分析得到的數(shù)據(jù)(存放在index_stats)來(lái)判斷索引是否需要重新建立。
          1.2 validate structure有二中模式:online, offline, 默認(rèn)是offline模式。
          聯(lián)機(jī)文檔原文:
          Specify ONLINE to enable Oracle Database to run the validation while DML operations are ongoing within the object. The database reduces the amount of validation performed to allow for concurrency.
          Specify OFFLINE, to maximize the amount of validation performed. This setting prevents INSERT, UPDATE, and DELETE statements from concurrently accessing the object during validation but allows queries. This is the default.
          Restriction on ONLINE
          You cannot specify ONLINE when analyzing a cluster or index.
          Note:
          When you validate the structure of an object ONLINE, Oracle Database does not collect any statistics, as it does when you validate the structure of the object OFFLINE.
          以offline模式分析時(shí),會(huì)對(duì)表加一個(gè)4級(jí)別的鎖(表共享),對(duì)run系統(tǒng)可能造成一定的影響。
          而online模式則沒(méi)有表lock的影響,但當(dāng)以online模式分析時(shí), 在視圖index_stats沒(méi)有統(tǒng)計(jì)信息。
          2.對(duì)索引狀態(tài)進(jìn)行統(tǒng)計(jì)
          analyze index indexname compute statistics
          聯(lián)機(jī)文檔原文:
          COMPUTE STATISTICS instructs Oracle Database to compute exact statistics about the analyzed object and store them in the data dictionary. When you analyze a table, both table and column statistics are collected.
          Both computed and estimated statistics are used by the Oracle Database optimizer to choose the execution plan for SQL statements that access analyzed objects. These statistics may also be useful to application developers who write such statements.
          Column statistics appear in the data dictionary views USER_TAB_COLUMNS, ALL_TAB_COLUMNS, and DBA_TAB_COLUMNS. Histograms appear in the data dictionary views USER_TAB_HISTOGRAMS, DBA_TAB_HISTOGRAMS, and ALL_TAB_HISTOGRAMS; USER_PART_HISTOGRAMS, DBA_PART_HISTOGRAMS, and ALL_PART_HISTOGRAMS; and USER_SUBPART_HISTOGRAMS, DBA_SUBPART_HISTOGRAMS, and ALL_SUBPART_HISTOGRAMS.
          總的來(lái)說(shuō),compute statistics是用來(lái)統(tǒng)計(jì)index的分析信息,來(lái)為CBO服務(wù)的。9i之后推薦使用dbms_stats。
          ps:
          for table的統(tǒng)計(jì)信息存在于視圖:user_tables 、all_tables、dba_tables
          for all indexes的統(tǒng)計(jì)信息存在于視圖: user_indexes 、all_indexes、dba_indexes
          for all columns的統(tǒng)計(jì)信息存在于試圖:user_tab_columns、all_tab_columns、dba_tab_columns
          3.一些sample
          3.1使用validate structure分析一個(gè)索引是否需要重建
          (1)analyze index index_name validate structure;
          (2)select t.del_lf_rows_len /t.lf_blk_len from index_stats t where t.name = &index_name;
          (3)如果結(jié)果大于20%,index就需要被rebuild了。
          4.對(duì)于分區(qū)表,建議使用DBMS_STATS,而不是使用Analyze語(yǔ)句。
          (1)可以并行進(jìn)行,對(duì)多個(gè)用戶,多個(gè)Table
          (2)可以得到整個(gè)分區(qū)表的數(shù)據(jù)和單個(gè)分區(qū)的數(shù)據(jù)。
          (3)可以在不同級(jí)別上Compute Statistics:?jiǎn)蝹€(gè)分區(qū),子分區(qū),全表,所有分區(qū)
          (4)可以導(dǎo)出統(tǒng)計(jì)信息
          (5)可以用戶自動(dòng)收集統(tǒng)計(jì)信息
          5.DBMS_STATS的缺點(diǎn)
          (1)不能Validate Structure
          (2)不能收集CHAINED ROWS, 不能收集CLUSTER TABLE的信息,這兩個(gè)仍舊需要使用Analyze語(yǔ)句。
          (3)DBMS_STATS 默認(rèn)不對(duì)索引進(jìn)行Analyze,因?yàn)槟J(rèn)Cascade是False,需要手工指定為True
          6.對(duì)于oracle 9里面的External Table,Analyze不能使用,只能使用DBMS_STATS來(lái)收集信息。
          posted @ 2011-09-13 10:31 xrzp 閱讀(381) | 評(píng)論 (0)編輯 收藏
          事務(wù)隔離級(jí)別:一個(gè)事務(wù)對(duì)數(shù)據(jù)庫(kù)的修改與并行的另一個(gè)事務(wù)的隔離程度。
          兩個(gè)并發(fā)事務(wù)同時(shí)訪問(wèn)數(shù)據(jù)庫(kù)表相同的行時(shí),可能存在以下三個(gè)問(wèn)題:
          1、幻想讀:事務(wù)T1讀取一條指定where條件的語(yǔ)句,返回結(jié)果集。此時(shí)事務(wù)T2插入一行新記錄,恰好滿足T1的where條件。然后T1使用相同的條件再次查詢,結(jié)果集中可以看到T2插入的記錄,這條新紀(jì)錄就是幻想。
          2、不可重復(fù)讀取:事務(wù)T1讀取一行記錄,緊接著事務(wù)T2修改了T1剛剛讀取的記錄,然后T1再次查詢,發(fā)現(xiàn)與第一次讀取的記錄不同,這稱為不可重復(fù)讀。
          3、臟讀:事務(wù)T1更新了一行記錄,還未提交所做的修改,這個(gè)T2讀取了更新后的數(shù)據(jù),然后T1執(zhí)行回滾操作,取消剛才的修改,所以T2所讀取的行就無(wú)效,也就是臟數(shù)據(jù)。
          為了處理這些問(wèn)題,SQL標(biāo)準(zhǔn)定義了以下幾種事務(wù)隔離級(jí)別

          Oracle數(shù)據(jù)庫(kù)支持READ COMMITTED 和 SERIALIZABLE這兩種事務(wù)隔離級(jí)別。Oracle不支持臟讀。

          SQL標(biāo)準(zhǔn)所定義的默認(rèn)事務(wù)隔離級(jí)別是SERIALIZABLE,但是Oracle 默認(rèn)使用的是READ COMMITTED 設(shè)置隔離級(jí)別使用
          SET TRANSACTION ISOLATION LEVEL
          [READ UNCOMMITTED|READ COMMITTED|REPEATABLE READ|SERIALIZABLE]
          posted @ 2011-08-15 12:03 xrzp 閱讀(325) | 評(píng)論 (0)編輯 收藏
          1.概念設(shè)計(jì):對(duì)用戶要求描述的現(xiàn)實(shí)世界(可能是一個(gè)工廠、一個(gè)商場(chǎng)或者一個(gè)學(xué)校等),通過(guò)對(duì)其中住處的分類、聚集和概括,建立抽象的概念數(shù)據(jù)模型。這個(gè)概念模型應(yīng)反映現(xiàn)實(shí)世界各部門的信息結(jié)構(gòu)、信息流動(dòng)情況、信息間的互相制約關(guān)系以及各部門對(duì)信息儲(chǔ)存、查詢和加工的要求等。所建立的模型應(yīng)避開(kāi)數(shù)據(jù)庫(kù)在計(jì)算機(jī)上的具體實(shí)現(xiàn)細(xì)節(jié),用一種抽象的形式表示出來(lái)。以擴(kuò)充的實(shí)體—(E-R模型)聯(lián)系模型方法為例,第一步先明確現(xiàn)實(shí)世界各部門所含的各種實(shí)體及其屬性、實(shí)體間的聯(lián)系以及對(duì)信息的制約條件等,從而給出各部門內(nèi)所用信息的局部描述(在數(shù)據(jù)庫(kù)中稱為用戶的局部視圖)。第二步再將前面得到的多個(gè)用戶的局部視圖集成為一個(gè)全局視圖,即用戶要描述的現(xiàn)實(shí)世界的概念數(shù)據(jù)模型。   

          2.邏輯設(shè)計(jì):主要工作是將現(xiàn)實(shí)世界的概念數(shù)據(jù)模型設(shè)計(jì)成數(shù)據(jù)庫(kù)的一種邏輯模式,即適應(yīng)于某種特定數(shù)據(jù)庫(kù)管理系統(tǒng)所支持的邏輯數(shù)據(jù)模式。與此同時(shí),可能還需為各種數(shù)據(jù)處理應(yīng)用領(lǐng)域產(chǎn)生相應(yīng)的邏輯子模式。這一步設(shè)計(jì)的結(jié)果就是所謂“邏輯數(shù)據(jù)庫(kù)”。

          3.物理設(shè)計(jì):
          根據(jù)特定數(shù)據(jù)庫(kù)管理系統(tǒng)所提供的多種存儲(chǔ)結(jié)構(gòu)和存取方法等依賴于具體計(jì)算機(jī)結(jié)構(gòu)的各項(xiàng)物理設(shè)計(jì)措施,對(duì)具體的應(yīng)用任務(wù)選定最合適的物理存儲(chǔ)結(jié)構(gòu)(包括文件類型、索引結(jié)構(gòu)和數(shù)據(jù)的存放次序與位邏輯等)、存取方法和存取路徑等。這一步設(shè)計(jì)的結(jié)果就是所謂“物理數(shù)據(jù)庫(kù)”。

          4.三者關(guān)系:由上到下,先要概念設(shè)計(jì),接著邏輯設(shè)計(jì),再是物理設(shè)計(jì),一級(jí)一級(jí)設(shè)計(jì)。
          posted @ 2011-08-03 00:28 xrzp 閱讀(356) | 評(píng)論 (0)編輯 收藏
          直接alter index xxx rebuild tablespace xxx 不得行.
          要醬紫,移動(dòng)表的時(shí)候順帶一起移動(dòng):
           ALTER TABLE 表名 MOVE
            TABLESPACE 新表空間
            LOB (字段名) STORE 
          AS 
            (TABLESPACE 新表空間  );
          posted @ 2011-07-13 15:02 xrzp 閱讀(315) | 評(píng)論 (0)編輯 收藏
          1.報(bào)錯(cuò):

          Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/OraInstall2011-07-06_03-14-36PM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
                  at java.lang.ClassLoader$NativeLibrary.load(Native Method)
                  at java.lang.ClassLoader.loadLibrary0(Unknown Source)
                  at java.lang.ClassLoader.loadLibrary(Unknown Source)
                  at java.lang.Runtime.loadLibrary0(Unknown Source)
                  at java.lang.System.loadLibrary(Unknown Source)
                  at sun.security.action.LoadLibraryAction.run(Unknown Source)
                  at java.security.AccessController.doPrivileged(Native Method)
                  at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
                  at sun.awt.DebugHelper.
          <clinit>(Unknown Source)
                  at java.awt.Component.
          <clinit>(Unknown Source)

          2.出錯(cuò)原因:缺少系統(tǒng)安裝包:rpm -ivh libXp-1.0.0-8.i386.rpm
          posted @ 2011-07-06 15:26 xrzp 閱讀(293) | 評(píng)論 (0)編輯 收藏
               摘要: oracle讀取數(shù)據(jù)的最小單位是塊.oracle讀取數(shù)據(jù)的最大限制取決于OS和oracle對(duì)多塊讀I/O的限制(db_file_multiblock_read_count).物理上來(lái)說(shuō),一個(gè)sql讀取某個(gè)記錄,得將記錄讀取到DB Cache中,然后才能從中或者,這個(gè)稱為物理讀.如果這個(gè)數(shù)據(jù)已經(jīng)存在于DB Cache中,那么前臺(tái)進(jìn)程可以直接沖DB Cache中讀取數(shù)據(jù),這個(gè)稱謂邏輯讀.邏輯上來(lái)說(shuō),有...  閱讀全文
          posted @ 2011-06-12 01:23 xrzp 閱讀(185) | 評(píng)論 (0)編輯 收藏
          1.查看隱藏參數(shù)
          腳本1:
          SELECT x.ksppinm NAME, y.ksppstvl VALUE, x.ksppdesc describ
          FROM SYS.x$ksppi x, SYS.x$ksppcv y
          WHERE x.inst_id = USERENV ('Instance')
          AND y.inst_id = USERENV ('Instance')
          AND x.indx = y.indx
          AND x.ksppinm LIKE '%&par%'
          腳本2:
          select
          x.ksppinm name,
          y.ksppstvl value,
          y.ksppstdf isdefault,
          decode(bitand(y.ksppstvf,
          7),1,'MODIFIED',4,'SYSTEM_MOD','FALSE') ismod,
          decode(bitand(y.ksppstvf,
          2),2,'TRUE','FALSE') isadj
          from
          sys.x$ksppi x,
          sys.x$ksppcv y
          where
          x.inst_id 
          = userenv('Instance'and
          y.inst_id 
          = userenv('Instance'and
          x.indx 
          = y.indx and 
          x.ksppinm 
          like '%_&par%'
          order by 
          translate(x.ksppinm,
          '_','')

          2.Oracle通過(guò)一個(gè)內(nèi)部參數(shù)_small_table_threshold來(lái)定義大表和小表的界限.缺省情況下該參數(shù)等于2%的數(shù)量,如果表的buffer大小小于這個(gè)參數(shù)的定義,則oracle認(rèn)為它是小表,反之為大表.
          select (db_cache_size/塊size)*0.02 from dual
          posted @ 2011-06-11 20:44 xrzp 閱讀(304) | 評(píng)論 (0)編輯 收藏
          SELECT d.VALUE || '/' || LOWER(RTRIM(i.INSTANCE, CHR(0))) || '_ora_' ||
                     p.spid 
          || '.trc' trace_file_name
                
          FROM (SELECT p.spid
                        
          FROM v$mystat m, v$session s, v$process p
                       
          WHERE m.statistic# = 1
                         
          AND s.SID = m.SID
                         
          AND p.addr = s.paddr) p,
                     (
          SELECT t.INSTANCE
                        
          FROM v$thread t, v$parameter v
                       
          WHERE v.NAME = 'thread'
                         
          AND (v.VALUE = 0 OR t.thread# = TO_NUMBER(v.VALUE))) i,
                     (
          SELECT VALUE FROM v$parameter WHERE NAME = 'user_dump_dest') d
          posted @ 2011-06-11 19:38 xrzp 閱讀(191) | 評(píng)論 (0)編輯 收藏
          在配置o2cb驅(qū)動(dòng)的時(shí)候,一個(gè)節(jié)點(diǎn)配置的時(shí)候報(bào)錯(cuò):Cluster ocfs2 created
          o2cb_ctl: Internal logic failure while adding node rac1
          且它的狀態(tài)始終為offline
          [root@rac1 ~]# /etc/init.d/o2cb configure
          Configuring the O2CB driver.

          This will configure the on-boot properties of the O2CB driver.
          The following questions will determine whether the driver is loaded on
          boot.  The current values will be shown in brackets ('[]').  Hitting
          <ENTER> without typing an answer will keep that current value.  Ctrl-C
          will abort.

          Load O2CB driver on boot (y/n) [y]: y
          Cluster to start on boot (Enter "none" to clear) [ocfs2]: 
          Specify heartbeat dead threshold (>=7) [61]: 
          Specify network idle timeout in ms (>=5000) [30000]: 
          Specify network keepalive delay in ms (>=1000) [2000]: 
          Specify network reconnect delay in ms (>=2000) [2000]: 
          Writing O2CB configuration: OK
          Loading module "configfs": OK
          Mounting configfs filesystem at /config: OK
          Loading module "ocfs2_nodemanager": OK
          Loading module "ocfs2_dlm": OK
          Loading module "ocfs2_dlmfs": OK
          Mounting ocfs2_dlmfs filesystem at /dlm: OK
          Starting O2CB cluster ocfs2: Failed
          Cluster ocfs2 created
          o2cb_ctl: Internal logic failure while adding node rac1

          Stopping O2CB cluster ocfs2: OK
          [root@rac1 ~]# /etc/init.d/o2cb status
          Module "configfs": Loaded
          Filesystem "configfs": Mounted
          Module "ocfs2_nodemanager": Loaded
          Module "ocfs2_dlm": Loaded
          Module "ocfs2_dlmfs": Loaded
          Filesystem "ocfs2_dlmfs": Mounted
          Checking O2CB cluster ocfs2: Offline
          [root@rac1 ~]# /etc/init.d/o2cb status
          Module "configfs": Loaded
          Filesystem "configfs": Mounted
          Module "ocfs2_nodemanager": Loaded
          Module "ocfs2_dlm": Loaded
          Module "ocfs2_dlmfs": Loaded
          Filesystem "ocfs2_dlmfs": Mounted
          Checking O2CB cluster ocfs2: Offline

          仔細(xì)檢查了之后發(fā)現(xiàn),這個(gè)節(jié)點(diǎn)改名字的時(shí)候是用的hostname rac2去改的,還需要更改/etc/sysconfig/network 
          改完之后再重新配置
          [root@rac2 ~]# /etc/init.d/o2cb unload
          Unmounting ocfs2_dlmfs filesystem: OK
          Unloading module "ocfs2_dlmfs": OK
          Unmounting configfs filesystem: OK
          Unloading module "configfs": OK
          [root@rac2 ~]# /etc/init.d/o2cb configure
          Configuring the O2CB driver.

          This will configure the on-boot properties of the O2CB driver.
          The following questions will determine whether the driver is loaded on
          boot.  The current values will be shown in brackets ('[]').  Hitting
          <ENTER> without typing an answer will keep that current value.  Ctrl-C
          will abort.

          Load O2CB driver on boot (y/n) [y]: 
          Cluster to start on boot (Enter "none" to clear) [ocfs2]: 
          Specify heartbeat dead threshold (>=7) [61]: 
          Specify network idle timeout in ms (>=5000) [30000]: 
          Specify network keepalive delay in ms (>=1000) [2000]: 
          Specify network reconnect delay in ms (>=2000) [2000]: 
          Writing O2CB configuration: OK
          Loading module "configfs": OK
          Mounting configfs filesystem at /config: OK
          Loading module "ocfs2_nodemanager": OK
          Loading module "ocfs2_dlm": OK
          Loading module "ocfs2_dlmfs": OK
          Mounting ocfs2_dlmfs filesystem at /dlm: OK
          Starting O2CB cluster ocfs2: OK
          [root@rac2 ~]# 
          [root@rac2 ~]# /etc/init.d/o2cb status
          Module "configfs": Loaded
          Filesystem "configfs": Mounted
          Module "ocfs2_nodemanager": Loaded
          Module "ocfs2_dlm": Loaded
          Module "ocfs2_dlmfs": Loaded
          Filesystem "ocfs2_dlmfs": Mounted
          Checking O2CB cluster ocfs2: Online
            Heartbeat dead threshold: 61
            Network idle timeout: 30000
            Network keepalive delay: 2000
            Network reconnect delay: 2000
          Checking O2CB heartbeat: Not active
          [root@rac2 ~]# /etc/init.d/o2cb status
          Module "configfs": Loaded
          Filesystem "configfs": Mounted
          Module "ocfs2_nodemanager": Loaded
          Module "ocfs2_dlm": Loaded
          Module "ocfs2_dlmfs": Loaded
          Filesystem "ocfs2_dlmfs": Mounted
          Checking O2CB cluster ocfs2: Online
            Heartbeat dead threshold: 61
            Network idle timeout: 30000
            Network keepalive delay: 2000
            Network reconnect delay: 2000
          Checking O2CB heartbeat: Not active

          在最后一行顯示Checking O2CB heartbeat: Not active O2CB 心跳當(dāng)前沒(méi)有活動(dòng),因?yàn)槲募到y(tǒng)還沒(méi)有掛載,掛載之后就會(huì)變成active 
          [root@rac2 ~]#  mount -t ocfs2 -o datavolume,nointr /dev/sdb1 /ocfs2
          [root@rac2 ~]# /etc/init.d/o2cb status
          Module "configfs": Loaded
          Filesystem "configfs": Mounted
          Module "ocfs2_nodemanager": Loaded
          Module "ocfs2_dlm": Loaded
          Module "ocfs2_dlmfs": Loaded
          Filesystem "ocfs2_dlmfs": Mounted
          Checking O2CB cluster ocfs2: Online
            Heartbeat dead threshold: 61
            Network idle timeout: 30000
            Network keepalive delay: 2000
            Network reconnect delay: 2000
          Checking O2CB heartbeat: Active

          posted @ 2011-06-06 20:58 xrzp 閱讀(2614) | 評(píng)論 (0)編輯 收藏
          安裝clusterware之前做一個(gè)檢查,./runcluvfy.sh stage -pre crsinst -n rac1,遇到反饋錯(cuò)誤
          ERROR:
          User equivalence unavailable on all the nodes.
          Verification cannot proceed.

          網(wǎng)上查了下,解決方法如下
          root@rac1 # mkdir -p /usr/local/bin
          root@rac1 # ln -s -f /usr/bin/ssh /usr/local/bin/ssh
          root@rac1 # ln -s -f /usr/bin/scp /usr/local/bin/scp
          在oracle用戶下:
          $ exec /usr/bin/ssh-agent $SHELL
          $ /usr/bin/ssh-add

          再執(zhí)行./runcluvfy.sh stage -pre crsinst -n rac1,rac2,就能正常檢查了
          [oracle@rac1 cluvfy]$ ./runcluvfy.sh stage -pre crsinst -n rac1,rac2

          Performing pre-checks for cluster services setup 

          Checking node reachability
          Node reachability check passed from node "rac1".


          Checking user equivalence
          User equivalence check passed for user "oracle".

          Checking administrative privileges
          User existence check passed for "oracle".
          Group existence check passed for "oinstall".
          Membership check for user "oracle" in group "oinstall" [as Primary] passed.

          Administrative privileges check passed.

          Checking node connectivity

          Node connectivity check passed for subnet "172.16.0.0" with node(s) rac2,rac1.

          WARNING: 
          Make sure IP address "10.10.10.51" is up and is a valid IP address on node "rac1".
          Node connectivity check failed for subnet "10.10.10.0".

          Suitable interfaces for the private interconnect on subnet "172.16.0.0":
          rac2 eth0:172.16.40.52
          rac1 eth0:172.16.40.51

          ERROR: 
          Could not find a suitable set of interfaces for VIPs.

          Node connectivity check failed.


          Checking system requirements for 'crs'
          Total memory check passed.
          Free disk space check passed.
          Swap space check passed.
          System architecture check passed.
          Kernel version check passed.
          Package existence check passed for "make-3.79".
          Package existence check passed for "binutils-2.14".
          Package existence check passed for "gcc-3.2".
          Package existence check passed for "glibc-2.3.2-95.27".
          Package existence check passed for "compat-db-4.0.14-5".
          Package existence check failed for "compat-gcc-7.3-2.96.128".
          Check failed on nodes: 
                  rac2,rac1
          Package existence check failed for "compat-gcc-c++-7.3-2.96.128".
          Check failed on nodes: 
                  rac2,rac1
          Package existence check failed for "compat-libstdc++-7.3-2.96.128".
          Check failed on nodes: 
                  rac2,rac1
          Package existence check failed for "compat-libstdc++-devel-7.3-2.96.128".
          Check failed on nodes: 
                  rac2,rac1
          Package existence check passed for "openmotif-2.2.3".
          Package existence check passed for "setarch-1.3-1".
          Group existence check passed for "dba".
          Group existence check passed for "oinstall".
          User existence check passed for "nobody".

          System requirement failed for 'crs'

          Pre-check for cluster services setup was unsuccessful on all the nodes. 

          posted @ 2011-06-06 20:03 xrzp 閱讀(3209) | 評(píng)論 (0)編輯 收藏

          <2011年6月>
          2930311234
          567891011
          12131415161718
          19202122232425
          262728293012
          3456789

          常用鏈接

          留言簿(4)

          隨筆分類

          隨筆檔案

          好友的blog

          搜索

          •  

          積分與排名

          • 積分 - 117461
          • 排名 - 500

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 乌拉特中旗| 扶绥县| 临汾市| 武宣县| 怀远县| 闽清县| 隆子县| 台安县| 高密市| 浪卡子县| 疏附县| 兴安盟| 青冈县| 福建省| 文登市| 临海市| 卫辉市| 三门峡市| 高邮市| 龙胜| 德钦县| 湖口县| 论坛| 益阳市| 屏山县| 双城市| 三江| 溆浦县| 长治县| 五华县| 玛沁县| 望都县| 张家港市| 类乌齐县| 繁昌县| 来凤县| 于田县| 怀来县| 巩义市| 蚌埠市| 云和县|