从存储上划分磁盘扩展数据库表空间

近期扩展了一次测试库的表空间,需要从存储上划分新的磁盘。这一块平时接触的不多,所以把相关的步骤记录了下来,希望以后可以用到。

1、从ev5000上新建一个LUN,分配40G的空间

2、在目的主机上执行ioscan,使其能够找到新划的磁盘

#<[/dev/vg_db_testtd]ioscan -fnCdisk
Class     I  H/W Path       Driver   S/W State   H/W Type     Description
==========================================================================
......

disk    387  0/2/1/0/4/0.1.10.0.0.6.2  sdisk    CLAIMED     DEVICE       COMPAQ  HSV110 (C)COMPAQ

......


3、安装新添加的磁盘

#<[/dev/vg_db_testtd]insf -H 0/2/1/0/4/0.1.10.0.0.6.2

insf: Installing special files for sdisk instance 387 address 0/2/1/0/4/0.1.10.0.0.6.2

#<[/dev/vg_db_testtd]ioscan -fnH0/2/1/0/4/0.1.10.0.0.6.2
Class     I  H/W Path       Driver   S/W State   H/W Type     Description
==========================================================================
disk    387  0/2/1/0/4/0.1.10.0.0.6.2  sdisk    CLAIMED     DEVICE       COMPAQ  HSV110 (C)COMPAQ
                           /dev/dsk/c26t6d2   /dev/rdsk/c26t6d2

#<[/dev/vg_db_testtd]diskinfo /dev/rdsk/c26t6d2
SCSI describe of /dev/rdsk/c26t6d2:
             vendor: COMPAQ
         product id: HSV110 (C)COMPAQ
               type: direct access
               size: 41943040 Kbytes
   bytes per sector: 512

4、创建逻辑卷

#<[/dev/vg_db_testtd]pvcreate /dev/rdsk/c26t6d2
Physical volume "/dev/rdsk/c26t6d2" has been successfully created.

#<[/dev]mkdir vg_db_test

#<[/dev]mknod /dev/vg_db_test/group c 64 0x240000

#<[/dev]vgcreate -s 16 /dev/vg_db_test /dev/dsk/c26t6d2
Increased the number of physical extents per physical volume to 2559.
Volume group "/dev/vg_db_test" has been successfully created.
Volume Group configuration for /dev/vg_db_test has been saved in /etc/lvmconf/vg_db_test.conf

#<[/dev]vgdisplay -v vg_db_test
--- Volume groups ---
VG Name                     /dev/vg_db_test
VG Write Access             read/write    
VG Status                   available                
Max LV                      255   
Cur LV                      0     
Open LV                     0     
Max PV                      16
Cur PV                      1     
Act PV                      1
Max PE per PV               2559        
VGDA                        2  
PE Size (Mbytes)            16             
Total PE                    2559   
Alloc PE                    0      
Free PE                     2559   
Total PVG                   0       
Total Spare PVs             0             
Total Spare PVs in use      0                    


   --- Physical volumes ---
   PV Name                     /dev/dsk/c26t6d2
   PV Status                   available               
   Total PE                    2559   
   Free PE                     2559   
   Autoswitch                  On       

#<[/dev]lvcreate -L 4096 -n lv_td4g025 vg_db_test
Logical volume "/dev/vg_db_test/lv_td4g025" has been successfully created with
character device "/dev/vg_db_test/rlv_td4g025".
Logical volume "/dev/vg_db_test/lv_td4g025" has been successfully extended.
Volume Group configuration for /dev/vg_db_test has been saved in /etc/lvmconf/vg_db_test.conf

#<[/dev]vgdisplay -v vg_db_test
--- Volume groups ---
VG Name                     /dev/vg_db_test
VG Write Access             read/write    
VG Status                   available                
Max LV                      255   
Cur LV                      1     
Open LV                     1     
Max PV                      16    
Cur PV                      1     
Act PV                      1     
Max PE per PV               2559        
VGDA                        2  
PE Size (Mbytes)            16             
Total PE                    2559   
Alloc PE                    256    
Free PE                     2303   
Total PVG                   0       
Total Spare PVs             0             
Total Spare PVs in use      0                    

   --- Logical volumes ---
   LV Name                     /dev/vg_db_test/lv_td4g025
   LV Status                   available/syncd          
   LV Size (Mbytes)            4096           
   Current LE                  256      
   Allocated PE                256        
   Used PV                     1      


   --- Physical volumes ---
   PV Name                     /dev/dsk/c26t6d2
   PV Status                   available               
   Total PE                    2559   
   Free PE                     2303   
   Autoswitch                  On       

#<[/dev]lvcreate -L 4096 -n lv_td4g026 vg_db_test
Logical volume "/dev/vg_db_test/lv_td4g026" has been successfully created with
character device "/dev/vg_db_test/rlv_td4g026".
Logical volume "/dev/vg_db_test/lv_td4g026" has been successfully extended.
Volume Group configuration for /dev/vg_db_test has been saved in /etc/lvmconf/vg_db_test.conf

#<[/dev]lvcreate -L 4096 -n lv_td4g027 vg_db_test
Logical volume "/dev/vg_db_test/lv_td4g027" has been successfully created with
character device "/dev/vg_db_test/rlv_td4g027".
Logical volume "/dev/vg_db_test/lv_td4g027" has been successfully extended.
Volume Group configuration for /dev/vg_db_test has been saved in /etc/lvmconf/vg_db_test.conf

#<[/dev]lvcreate -L 4096 -n lv_td4g028 vg_db_test
Logical volume "/dev/vg_db_test/lv_td4g028" has been successfully created with
character device "/dev/vg_db_test/rlv_td4g028".
Logical volume "/dev/vg_db_test/lv_td4g028" has been successfully extended.
Volume Group configuration for /dev/vg_db_test has been saved in /etc/lvmconf/vg_db_test.conf

#<[/dev]lvcreate -L 4096 -n lv_td4g029 vg_db_test
Logical volume "/dev/vg_db_test/lv_td4g029" has been successfully created with
character device "/dev/vg_db_test/rlv_td4g029".
Logical volume "/dev/vg_db_test/lv_td4g029" has been successfully extended.
Volume Group configuration for /dev/vg_db_test has been saved in /etc/lvmconf/vg_db_test.conf

#<[/dev]lvcreate -L 4096 -n lv_td4g030 vg_db_test
Logical volume "/dev/vg_db_test/lv_td4g030" has been successfully created with
character device "/dev/vg_db_test/rlv_td4g030".
Logical volume "/dev/vg_db_test/lv_td4g030" has been successfully extended.
Volume Group configuration for /dev/vg_db_test has been saved in /etc/lvmconf/vg_db_test.conf

#<[/dev/vg_db_testtd]cd ../vg_db_test

#<[/dev/vg_db_test]chown oracle:dba r*
#<[/dev/vg_db_test]ll
total 0
crw-rw-rw-   1 root       sys         64 0x240000 May 26 14:46 group
brw-r-----   1 root       sys         64 0x240001 May 26 14:48 lv_td4g025
brw-r-----   1 root       sys         64 0x240002 May 26 14:49 lv_td4g026
brw-r-----   1 root       sys         64 0x240003 May 26 14:49 lv_td4g027
brw-r-----   1 root       sys         64 0x240004 May 26 14:49 lv_td4g028
brw-r-----   1 root       sys         64 0x240005 May 26 14:49 lv_td4g029
brw-r-----   1 root       sys         64 0x240006 May 26 14:49 lv_td4g030
crw-r-----   1 oracle     dba         64 0x240001 May 26 14:48 rlv_td4g025
crw-r-----   1 oracle     dba         64 0x240002 May 26 14:49 rlv_td4g026
crw-r-----   1 oracle     dba         64 0x240003 May 26 14:49 rlv_td4g027
crw-r-----   1 oracle     dba         64 0x240004 May 26 14:49 rlv_td4g028
crw-r-----   1 oracle     dba         64 0x240005 May 26 14:49 rlv_td4g029
crw-r-----   1 oracle     dba         64 0x240006 May 26 14:49 rlv_td4g030

#<[/dev/vg_db_test]su - oracle
(c)Copyright 1983-2000 Hewlett-Packard Co.,  All Rights Reserved.
(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California
(c)Copyright 1980, 1984, 1986 Novell, Inc.
(c)Copyright 1986-1992 Sun Microsystems, Inc.
(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology
(c)Copyright 1989-1993  The Open Software Foundation, Inc.
(c)Copyright 1986 Digital Equipment Corp.
(c)Copyright 1990 Motorola, Inc.
(c)Copyright 1990, 1991, 1992 Cornell University
(c)Copyright 1989-1991 The University of Maryland
(c)Copyright 1988 Carnegie Mellon University
(c)Copyright 1991-2000 Mentat Inc.
(c)Copyright 1996 Morning Star Technologies, Inc.
(c)Copyright 1996 Progressive Systems, Inc.
(c)Copyright 1991-2000 Isogon Corporation, All Rights Reserved.


                           RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the U.S. Government is subject to
restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
Technical Data and Computer Software clause in DFARS 252.227-7013.

                           Hewlett-Packard Company
                           3000 Hanover Street
                           Palo Alto, CA 94304 U.S.A.

Rights for non-DOD U.S. Government Departments and Agencies are as set
forth in FAR 52.227-19(c)(1,2).
tjtest(oracle):/oracle >  sqlplus '/as sysdba'

SQL*Plus: Release 9.2.0.5.0 - Production on Mon May 26 14:52:17 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.5.0 - Production

SQL> alter tablespace TEST_ZHJS_LIST_MYTF
  2  add datafile '/dev/vg_db_test/rlv_td4g026' size 2047m reuse;

Tablespace altered.

SQL> alter tablespace TEST_ZHJS_LIST_CTJS
  2  add datafile '/dev/vg_db_test/rlv_td4g025' size 4095m reuse;

Tablespace altered.

SQL> alter tablespace TEST_ZHJS_LIST_WJJS
  2  add datafile '/dev/vg_db_test/rlv_td4g027' size 4095m,
  3       '/dev/vg_db_test/rlv_td4g028' size 4095m reuse;

Tablespace altered.

SQL> alter tablespace TEST_ZHJS_LIST_WNTF
  2  add datafile '/dev/vg_db_test/rlv_td4g029' size 4095m reuse,
  3       '/dev/vg_db_test/rlv_td4g030' size 4095m reuse;

Tablespace altered.

SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production
With the Partitioning option
JServer Release 9.2.0.5.0 - Production

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值