【正文】
w device is a character device – Character device major number 162 ? Requires more experienced administration ? Devices will be either in /dev or /dev/raw ? Device names are raw1 – 255 by convention – May need to manually create raw129 – raw255: ? ., mknod /dev/raw/raw129 c 162 129 ? Minor 0 is special and can’t be used for I/O – Implies a limit of 255 raw devices ? DB files should be symlinks to /dev/raw/raw* Process Disk file Write Read Acegene IT Co. Ltd. 25 創(chuàng)建裸設(shè)備 ? Create partitions of type ―Linux‖ (type id=83) ? Use /sbin/raw to bind raw device with a partition ? Examples: – /sbin/raw /dev/raw/raw1 /dev/sdc1 – /sbin/raw /dev/raw/raw1 8 33 ? Give oracle user ownership of raw device: – chown oracle:dba /dev/raw/raw1 ? Bindings are not persistent across reboot – Use /etc/sysconfig/rawdevices Acegene IT Co. Ltd. 26 System V Shared Memory ? Used by Oracle for the SGA – May have multiple segments if shmmax is low – Normally all segments deleted at shutdown – If instance crashes, segments may hang around ? To view existing segments: – /usr/bin/ipcs ? To manually remove a segment: – /usr/bin/ipcrm shm shm_id Acegene IT Co. Ltd. 27 Oracle Clustered Filesystem ? OCFS delivers rawlike performance with tremendous advantages in management and usability – All database related files reside on a clustered filesystem – Visible to all nodes ? Open source project sponsored by Oracle ? Supports asynchronous I/O as of ? Free to use ? Get fix for bug 2883583 – Allows cp, dd amp。 ? 包含著操作系統(tǒng)內(nèi)核及核心目錄結(jié)構(gòu)的分區(qū)是在系統(tǒng)引導(dǎo)時掛裝的,這個分區(qū)上必須存放有使系統(tǒng)進(jìn)入單用戶模式所必須的全部工具程序和配置文件,其上許多子目錄都是空的。 –這樣在我們的 /usr例子里,如果在掛裝 /dev/hda3分區(qū)之前根分區(qū)的 /usr子目錄中確實保存有文件,掛裝后那些文件就看不見了(那些文件并沒有被刪除,一旦 /dev/hda3分區(qū)被卸載,原來 /usr中的文件就又出現(xiàn)了) Acegene IT Co. Ltd. 29 使用 mount命令 ? Onetime Mounts mount [options] device directory ? 用于 mount選項: – o命令的參數(shù)如下所示 ? 下面的 mount命令把 /dev/hda3分區(qū)以只讀屬性掛裝到 /usr子目錄上: [ rootford /root ]mount o ro /dev/hda3 /usr – a 把 /etc/fstab文件(本小節(jié)后面介紹)中列出的文件系統(tǒng)都掛裝上 – t fstype 定義掛裝的文件系統(tǒng)類型。它們通常是一些與文件系統(tǒng)類型有關(guān)的選項(掛裝網(wǎng)絡(luò)文件系統(tǒng)的選項不能夠用來掛裝本地文件系統(tǒng)) /bin/mount /dev/sdb1 /oracle Acegene IT Co. Ltd. 30 使用 mount命令 ?掛載光盤 mount –t iso9660 /dev/cdrom /dir ?掛載 iso文件 (Loopback Mounts) mount o loop,ro [iso file] /[dir] mount –t iso9660 –o loop /img/ /mnt/cdrom ?掛載 samba文件 mount t smbfs o username=usr,password=pwd //host/folder /[dir] Etc/fstab: //host/folder /dir smbfs username=user,password=pwd 1 2 Mount dir ?掛載 NFS文件 mount [host]:/[dir] /[dir] Acegene IT Co. Ltd. 31 使用 mount命令 ? mount o命令的參數(shù)說明 – ro 以只讀屬性掛裝該分區(qū) – rw 以讀 寫屬性掛裝該分區(qū)(缺省值) – exec 允許二進(jìn)制代碼的執(zhí)行(缺省值) – noatime 禁止刷新 i結(jié)點上的存取時間。 –下面是這個命令的格式: ?umount [f] directory –其中的 directory是準(zhǔn)備卸載的子目錄名。 Acegene IT Co. Ltd. 33 卸載文件系統(tǒng) ? umount命令不足之處:如果文件系統(tǒng)正在使用中(也就是說有人在那個分區(qū)上打開了文件),就無法把這個文件系統(tǒng)卸載下來。如果選擇終止那些進(jìn)程的運行,一定要明白自己在做些什么。任何在這個分區(qū)上打開的進(jìn)程都將被掛起來,可能會造成數(shù)據(jù)丟失。在現(xiàn)實生活里,你可能不會總有這個奢侈之舉。 ? 這個文件包含著一個系統(tǒng)中全部已知硬盤分區(qū)的清單。 ? 下面是 /etc/fstab文件中數(shù)據(jù)項的格式,下表定義了 /etc/fstab數(shù)據(jù)項的各組成元素。 – Linux的虛擬內(nèi)存可以保存在根分區(qū)以外的另一個分區(qū)上。 –因為這個分區(qū)不需要備份或者在機器引導(dǎo)時由 fsck程序檢查,所以最后的兩個參數(shù)都設(shè)置為 0 –請注意 swap還可以被保存為一個普通的磁盤文件。這是一個特殊的文件系統(tǒng),它提供了一個到內(nèi)核參數(shù)的接口,通過這個接口可以模擬任何其他的文件系統(tǒng)。 – 最引人注目的是 /dev/kcore,它實際上就是抽取成文件的系統(tǒng)內(nèi)存映像。除非你確實知道自己在干什么,否則最好還是把 /proc中的文件留在那里別動。 – 如果你打算讓你的主機支持通過 rsh、 tel、 rlogin或者 s