建立 Oracle10g ASM 資料庫(1)

JohnTam10發表於2011-05-16
    搭建一個測試環境,能夠進行ASM的管理學習:
    Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE硬體配置

IBM Xseries 346

Xen 3.6G4G 記憶體,70G 硬碟+36G+36G硬碟2

 

軟體配置

RHEL 5.3Oracle10g for Linux 64bit

 

環境說明

  本環境使用IBM伺服器上安裝RHEL 5.364位系統,硬碟兩塊,分別為76G36G。其中76G空間為作業系統和軟體36G為第二塊硬碟分割槽作為ASM盤。

規劃方案:計劃將第二塊硬碟分為三個分割槽,各個分割槽大小相等。每個分割槽作為一個ASM盤,名稱分別為VOL1VOL2VOL3

 

安裝作業系統和oracle 10g軟體不用說了,網上大把。

 

系統分割槽:

[root@Enmo ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/sda3              63G  9.8G   50G  17% /

/dev/sda1              99M   25M   70M  26% /boot

tmpfs                 2.0G     0  2.0G   0% /dev/shm

 

磁碟分割槽情況為:

[root@Enmo ~]# fdisk -l

 

Disk /dev/sda: 73.4 GB, 73407488000 bytes

255 heads, 63 sectors/track, 8924 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          13      104391   83  Linux

/dev/sda2              14         535     4192965   82  Linux swap / Solaris

/dev/sda3             536        8924    67384642+  83  Linux

 

Disk /dev/sdb: 36.4 GB, 36401479680 bytes

64 heads, 32 sectors/track, 34715 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes

 

   Device Boot      Start         End      Blocks   Id  System

 

進行ASM盤分割槽

  根據規劃方案,對sdb盤進行分割槽格式化操作。在linux上,可以使用fdisk命令,在互動的方式下進行磁碟分割槽:

[root@Enmo ~]# fdisk /dev/sdb                 --命令方式:fdisk <進行分割槽的磁碟檔案>

 

The number of cylinders for this disk is set to 34715.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

 

Command (m for help): m           檢視以下命令方式

Command action

   a   toggle a bootable flag

   b   edit bsd disklabel

   c   toggle the dos compatibility flag

   d   delete a partition

   l   list known partition types

   m   print this menu

   n   add a new partition

   o   create a new empty DOS partition table

   p   print the partition table

   q   quit without saving changes

   s   create a new empty Sun disklabel

   t   change a partition's system id

   u   change display/entry units

   v   verify the partition table

   w   write table to disk and exit

   x   extra functionality (experts only)

 

Command (m for help): n      新建立一個分割槽

Command action 要求輸入新建主分割槽還是擴充套件分割槽,注意:一塊硬碟上只能有四個主分割槽

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1    //輸入主分割槽編號

First cylinder (1-34715, default 1): 1       //分割槽起始柱面,該硬碟可用的範圍是1-34715

Last cylinder or +size or +sizeM or +sizeK (1-34715, default 34715): 11571  //分割槽截止柱面

 

Command (m for help): m

Command action

  。。。。。。

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 2   //輸入第二個分割槽

First cylinder (11572-34715, default 11572): 11572

Last cylinder or +size or +sizeM or +sizeK (11572-34715, default 34715): 23142

 

Command (m for help): m

Command action

   。。。。。。

 

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 3  //輸入第三個分割槽

First cylinder (23143-34715, default 23143):

Using default value 23143

Last cylinder or +size or +sizeM or +sizeK (23143-34715, default 34715):

Using default value 34715

--注意:此時分割槽資訊還沒有正式寫入,要求輸入w命令後才能寫入!

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

 

檢視分割槽結果:

[root@Enmo ~]# fdisk -l

 

Disk /dev/sda: 73.4 GB, 73407488000 bytes

255 heads, 63 sectors/track, 8924 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          13      104391   83  Linux

/dev/sda2              14         535     4192965   82  Linux swap / Solaris

/dev/sda3             536        8924    67384642+  83  Linux

 

Disk /dev/sdb: 36.4 GB, 36401479680 bytes

64 heads, 32 sectors/track, 34715 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1       11571    11848688   83  Linux

/dev/sdb2           11572       23142    11848704   83  Linux

/dev/sdb3           23143       34715    11850752   83  Linux

 

分割槽建立之後,還要用特定的檔案系統格式進行分割槽格式化。

[root@Enmo ~]# mkfs.ext3/dev/sdb1

-bash: mkfs.ext3/dev/sdb1: No such file or directory

[root@Enmo ~]# mkfs.ext3 /dev/sdb1

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

1482208 inodes, 2962172 blocks

148108 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=3036676096

91 block groups

32768 blocks per group, 32768 fragments per group

16288 inodes per group

Superblock backups stored on blocks:

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

 

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 31 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

 

剩下兩個分割槽 /dev/sdb2/dev/sdb3類似。

準備好分割槽磁碟之後,就可以進行ASM驅動安裝和ASM disk配置構建了。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24582392/viewspace-695495/,如需轉載,請註明出處,否則將追究法律責任。

相關文章