【原创  转载请注明作者】
【如有问题请联系[email protected]  欢迎指教】OS环境hp ux 11.31
数据库oracle rac 10.2.0.4如何定位一个数据库表在物理上的存储位置如果数据库中的某张表非常的繁忙,而它在物理上只存储在阵列的一个盘上,那么必然导致io瓶颈(对于已经实现了条带化存储的数据库当然不存在这种情况):阵列上的某个磁盘非常的繁忙,而其它的磁盘都处于空闲状态。如何定位热点的块和表,暂且不在本文的讨论范围内。定位出来了表在物理上的存储位置后,可以经过适当的io调整,缓解热表块的io问题。整个过程只需要两步:
1. 找出表所对应的数据文件
SQL> SELECT FILE_ID,FILE_NAME FROM Dba_Data_Files df WHERE EXISTS
  2  (SELECT 1 FROM
  3     (SELECT distinct(dbms_rowid.rowid_relative_fno(ROWID)) file_id FROM ARC_C_ACCT) t
  4    WHERE t.file_id = df.file_id );
  
 
   FILE_ID FILE_NAME
---------- --------------------------------------------------------------------------------
         8 /dev/vgepm/rlvdat1_32G
         9 /dev/vgepm/rlvdat2_32G
        10 /dev/vgepm/rlvdat3_32G
        39 /dev/vgepm/rlvdat12_8G
        51 /dev/vgepm/rlvdat23_8G2. 在操作系统上根据文件名去找对应的物理磁盘
pmljrdb1#[/]lvdisplay -v /dev/vgepm/lvdat1_32G
--- Logical volumes ---
LV Name                     /dev/vgepm/lvdat1_32G
VG Name                     /dev/vgepm
LV Permission               read/write   
LV Status                   available/syncd           
Mirror copies               0            
Consistency Recovery        NOMWC               
Schedule                    parallel     
LV Size (Mbytes)            32768           
Current LE                  256       
Allocated PE                256         
Stripes                     0       
Stripe Size (Kbytes)        0                   
Bad block                   on           
Allocation                  strict                    
IO Timeout (Seconds)        default                --- Distribution of logical volume ---
   PV Name                 LE on PV  PE on PV  
   /dev/dsk/c2t0d1         256       256          --- Logical extents ---
   LE    PV1                     PE1   Status 1 
   00000 /dev/dsk/c2t0d1         01228 current  
   00001 /dev/dsk/c2t0d1         01229 current  
   00002 /dev/dsk/c2t0d1         01230 current  
   00003 /dev/dsk/c2t0d1         01231 current  
   00004 /dev/dsk/c2t0d1         01232 current  
   00005 /dev/dsk/c2t0d1         01233 current  
   00006 /dev/dsk/c2t0d1         01234 current  
   00007 /dev/dsk/c2t0d1         01235 current  
   00008 /dev/dsk/c2t0d1         01236 current  
   00009 /dev/dsk/c2t0d1         01237 current  
   00010 /dev/dsk/c2t0d1         01238 current  
   00011 /dev/dsk/c2t0d1         01239 current  
   00012 /dev/dsk/c2t0d1         01240 current  
   00013 /dev/dsk/c2t0d1         01241 current  
   00014 /dev/dsk/c2t0d1         01242 current  
   00015 /dev/dsk/c2t0d1         01243 current     ......

解决方案 »

  1.   

    楼主,
        首先,找出数据库中库对应在表空间的物理位置。。select tablespace_name,status,contents from dba_tablespaces;找出数据库对应的表空间在对应找数据文件.select file_name,byte,autoextensible from dba_data_files where tablespace_name='表空间名';这样就能找出某个数据库的某个表空间对应的某个数据文件--》这样在继续找他所对应的表的物理位置..不知道,这个流程是否正确
      

  2.   

    sorry,我的方法错啦!! 应该使用dba_data_files