中国青基会
RSS
热门关键字:  None  linux+moodle安装  mac  rhel5  199
当前位置 : Nixsky>UNIX>SCO UNIX>列表

SCO5+informix7准备数据库裸设备空间

来源: 作者: 时间:2007-04-22 点击:
SCO5+informix7

准备数据库空间(裸设备)
 
1.fdisk 划分磁盘disk分区
# fdisk

       1. Display Partition Table
       2. Use Entire Disk for UNIX
       3. Use Rest of Disk for UNIX
       4. Create UNIX Partition
       5. Activate Partition
       6. Delete Partition
       7. Create Partition

Enter your choice or 'q' to quit: 1

Current Hard Disk Drive: /dev/rhd00

       +-----------+----------+----------+---------+---------+---------+
       | Partition    | Status     | Type      |     Start |        End |     Size |
       +-----------+----------+----------+---------+---------+---------+
       | 1             | Active      | UNIX      |          1 |   130031 |  130031 |
       | 2             | Inactive    | UNIX      |  130032 |   166001 |   35970 |
       +-----------+----------+----------+---------+---------+---------+

Total disk size: 166260 tracks (256 reserved for masterboot and diagnostics)

Press <Return> to continue

创建UNIX分区,选择“4”(Create UNIX Partition)
注意:
start,end,size的数字单位是track
硬盘参数有柱面Cylinder、磁道Head、扇区Sector 
cylinder*head=track
track*sector=block
1block=512b
c*h*s*512=硬盘大小(b) /1024=硬盘大小(kb) /1024=硬盘大小(Mb) 
柱面*柱头*扇区=块   1block=512b

Partition大小(MB)= PartitionSize(tracks) * 硬盘总容量(MB)/ Total disk tracks 

把硬盘想象成:一个从里到外层层铁皮裹住的圆柱体,一层铁皮就是1个柱面;再把铁皮想象成一圈圈上下积压在一起的小圆铁丝环,一圈铁丝环就是1个磁道;再把铁丝环想象成1节节焊在一起的铁条,一小节铁条就是1个扇区

开机信息:/var/adm/messages
device    address    vector  dma   comment
---------------------------------------------------------------------------
%disk  0x01F0-0x01F7  14     -     type=W0 unit=0 cyls=9506 hds=255 secs=63

2.divvy划分文件系统filesystem分区
# divvy –V /dev/rhd02   
注: rhd02——第一块(0)硬盘(rhd)第二分区(2),对应上面的Partition2

Please enter the number of file systems you want this area
to be divided into, or press <Return> to get the default of 17 file system(s)

+-------------------+------------+--------+---+-------------+------------+
| Name                  | Type          | New FS | # |    First Block |   Last Block |
+-------------------+------------+-----  -+---+-------------+------------+
| dbspace01           | NON FS         |  no    | 0 |                 0|        199999|
| dbspace02           | NON FS         |  no    | 1 |         200000|        399999|
| dbspace03           | NON FS         |  no    | 2 |         400000|        599999|
| dbspace04           | NON FS         |  no    | 3 |         600000|        799999|
| dbspace05           | NON FS         |  no    | 4 |         800000|        999999|
|                           | NOT USED     |  no    | 5 |                 -|                -|
|                           | NOT USED     |  no    | 6 |                 -|                -|
| d1027all              | WHOLE DISK   |  no    | 7 |                 0|       1133054|
+-------------------+------------+------  +---+-------------+------------+
1132488 1K blocks for divisions, 567 1K blocks reserved for the system

n[ame]       Name or rename a division.
c[reate]     Create a new file system on this division.
t[ype]       Select or change filesystem type on new filesystems.
p[revent]    Prevent a new file system from being created on this division.
s[tart]      Start a division on a different block.
e[nd]        End a division on a different block.
r[estore]    Restore the original division table.
Enter your choice or q to quit:

# divvy –m /dev/rhd03 
同理第1块硬盘第3分区

备注:
(1)、通常采用的方式是Raw Device,也称“裸设备”,就是在安装Unix磁盘时,用divvy命令在磁盘分区中建立一块Non FS 分区,对此分区的大小预先要估算好(7chunk*2,000,000k=14,000,000k)。Online系统对“裸设备”的管理比Unix文件 系统的管理效率高很多。 
(2)、为系统准备磁盘空间时,必须首先设立正确的权限,并且建议为原始设备建立连接,并且每个chunk不得大于2G。在/dev目录下,自动产生dbspace01-dbspace10; rdbspace01-rdbspace10 的10个区。
(3)、dbspace**修改权限、属性
# chown –R informix:informix *dbspace*
# chmod 660 *dbspace*
注:在/dev下 ,可以像文件一样操作dbspace,如rm dbspace02

3.建立符号连接(symbolic links)
PS:便于管理数据库空间
不同于硬连接(只能在文件系统内)

语法:ln [ -s ] [ -f ] sourcefile ... targetdirectory
-s        create symbolic links
-f        existing,unlinked targetfile 
# mkdir /dbspace
# cd dbspace 
# ln –s /dev/dbspace01 rootdbs
# ln –s /dev/dbspace02 tempdbs
# ln –s /dev/dbspace03 logdbs
# ln –s /dev/dbspace04 chunk01
……

配置informix数据库空间时,既可以使用“真实地址”如/dev/dbspace01,又可以使用“连接地址”如/dbspace/rootdbs
最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册