• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            旅途

            如果想飛得高,就該把地平線忘掉

            linux創(chuàng)建裸設(shè)備和oracle使用裸設(shè)備

            1.裸設(shè)備:

            未分區(qū)的硬盤(獨立的),未被格式化的分區(qū)(包括主分區(qū)和邏輯分區(qū))

            2.測試,創(chuàng)建裸設(shè)備

            -bash-3.00# fdisk -l

            Disk /dev/sda: 160.0 GB, 160000000000 bytes
            255 heads, 63 sectors/track, 19452 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        7662    61440592+  83  Linux
            /dev/sda3            7663       14036    51199155   83  Linux
            /dev/sda4           14037       19452    43504020    5  Extended
            /dev/sda5           14037       14673     5116671   83  Linux
            /dev/sda6           14674       15310     5116671   83  Linux
            /dev/sda7           15311       15947     5116671   83  Linux
            /dev/sda8           15948       16339     3148708+  83  Linux
            /dev/sda9           16340       16466     1020096   83  Linux
            /dev/sda10          16467       19016    20482843+  83  Linux
            /dev/sda11          19017       19079      506016   83  Linux
            /dev/sda12          19080       19141      497983+  83  Linux
            -bash-3.00# fdisk /dev/sda

            The number of cylinders for this disk is set to 19452.
            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): n
            First cylinder (19142-19452, default 19142):
            Using default value 19142
            Last cylinder or +size or +sizeM or +sizeK (19142-19452, default 19452): +512M

            Command (m for help): w
            The partition table has been altered!

            Calling ioctl() to re-read partition table.

            WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
            The kernel still uses the old table.
            The new table will be used at the next reboot.
            Syncing disks.

            -bash-3.00# reboot

            Broadcast message from root (pts/2) (Sun Nov  2 21:54:12 2008):

            The system is going down for reboot NOW!

            -bash-3.00# raw /dev/raw/raw3 /dev/sda13
            /dev/raw/raw3:  bound to major 8, minor 13

            3.修改屬主和權(quán)限

            -bash-3.00# chown oracle10:oracle10 /dev/raw/raw3
            -bash-3.00# chmod 777 /dev/raw/raw3
            -bash-3.00# ls -l /dev/raw/raw3
            crwxrwxrwx  1 oracle10 oracle10 162, 3 Nov  2 21:59 /dev/raw/raw3

            4.oracle添加裸設(shè)備為數(shù)據(jù)文件(或redo log)

            SQL> alter tablespace space_test add datafile '/dev/raw/raw3' size 400M;
            Tablespace altered.

            SQL> select name from v$datafile;

            NAME
            ------------------------------------------------------------------------------------------------------------------------------------------------------
            /work/oracle10/oracle/oradata/oracle10/system01.dbf
            /work/oracle10/oracle/oradata/oracle10/space_test.dbf
            /work/oracle10/oracle/oradata/oracle10/sysaux01.dbf
            /work/oracle10/oracle/oradata/oracle10/users01.dbf
            /work/oracle10/oracle/oradata/oracle10/example01.dbf
            /work/oracle10/oracle/oradata/oracle10/dsgtest_part.dbf
            /work/oracle10/oracle/oradata/oracle10/dsgtest_part_01.dbf
            /work/oracle10/oracle/oradata/oracle10/undotbs02.db
            /dev/raw/raw3

            9 rows selected.

            SQL>

            證明裸設(shè)備和文件系統(tǒng)可以共存。

            日志文件同理也可以創(chuàng)建,同時可以創(chuàng)建這樣形式的裸設(shè)備日志文件

            SQL> select member from v$logfile;

            MEMBER
            ------------------------------------------------------------------------------------------------------------------------------------------------------
            /work/oracle10/oracle/oradata/oracle10/redo03.log
            /work/oracle10/oracle/oradata/oracle10/redo02.log
            /work/oracle10/oracle/oradata/oracle10/redo01.log
            /work/oracle10/oracle/oradata/oracle10/redo04

            SQL> !ls -l /work/oracle10/oracle/oradata/oracle10/redo04
            lrwxrwxrwx  1 root root 13 Nov  2 18:43 /work/oracle10/oracle/oradata/oracle10/redo04 -> /dev/raw/raw1

            4.插曲:

            1.reboot之后發(fā)現(xiàn)找不到/dev/raw/raw3,修改/etc/sysconfig/rawdevices

            添加:

            # Applications needing raw device access should open regular
            # block devices with O_DIRECT.
            # raw device bindings
            # format:  <rawdev> <major> <minor>
            #          <rawdev> <blockdev>
            # example: /dev/raw/raw1 /dev/sda1
            #          /dev/raw/raw2 8 5
            /dev/raw/raw3 /dev/sda13

            2.reboot之后提示找不到剛創(chuàng)建的裸設(shè)備形式的數(shù)據(jù)文件,查看裸設(shè)備掛載的塊設(shè)備,發(fā)現(xiàn)權(quán)限被改成root,修改成oracle10:oracle10之后,數(shù)據(jù)庫就可以open了

            vi /etc/udev/permissions.d/50-udev.permissions

            # raw devices
            ram*:root:disk:0660
            raw/*:oracle10:oracle10:0777

            再重啟,權(quán)限就沒問題了

            5.思考

            查資料發(fā)現(xiàn)linux的裸設(shè)備需要指到一個塊設(shè)備上(/dev/raw/raw*),而unix并不需要這一步

            裸設(shè)備是一種字符設(shè)備(character device),不需要操作系統(tǒng)緩沖就可以直接讀寫,可以提高效率

            另一種是塊設(shè)備(block device),需要操作系統(tǒng)緩沖,可以mount文件系統(tǒng)

            ls -l /dev/sd*

            brw-rw----  1 root disk 8, 11 Nov  3  2008 /dev/sda11
            brw-rw----  1 root disk 8, 12 Nov  3  2008 /dev/sda12
            brw-rw----  1 root disk 8, 13 Nov  3  2008 /dev/sda13

            [oracle10@rhel4 dev]$ ls -l /dev/raw/*
            crwxrwxrwx  1 oracle10 oracle10 162, 1 Nov  2 22:31 /dev/raw/raw1
            crwxrwxrwx  1 oracle10 oracle10 162, 3 Nov  2 22:31 /dev/raw/raw3

            我的理解是,linux本身把為未格式化的分區(qū)當(dāng)作塊設(shè)備,然后通過連接(raw /dev/raw/raw3 /dev/sda13),當(dāng)成c設(shè)備來用,而unix不需要這一步,直接就是字符設(shè)備,這個不確定~

            posted on 2009-09-30 00:20 旅途 閱讀(2890) 評論(0)  編輯 收藏 引用 所屬分類: LINUX基礎(chǔ)、管理

            奇米影视7777久久精品| 久久久精品国产亚洲成人满18免费网站| 草草久久久无码国产专区| 久久精品国产亚洲Aⅴ香蕉| 香蕉99久久国产综合精品宅男自| 亚洲天堂久久久| 69国产成人综合久久精品| 国产精品成人精品久久久| 久久亚洲精品国产亚洲老地址| 久久人人妻人人爽人人爽| 国产亚洲美女精品久久久| 婷婷伊人久久大香线蕉AV| 久久国产一片免费观看| 久久亚洲私人国产精品| 久久久久无码专区亚洲av| 久久精品国产亚洲av水果派| 久久亚洲视频| 精品国产青草久久久久福利 | 久久成人永久免费播放| 99精品国产99久久久久久97| 久久久精品日本一区二区三区 | 亚洲国产精品人久久| 少妇久久久久久被弄到高潮 | 99久久www免费人成精品| 久久久久久久波多野结衣高潮| 久久国产精品-久久精品| 无码人妻久久一区二区三区免费丨| 91久久精品无码一区二区毛片| 久久亚洲日韩精品一区二区三区| 色婷婷狠狠久久综合五月| 大香网伊人久久综合网2020| 久久se精品一区精品二区| 久久久久亚洲AV无码麻豆| 亚洲国产精品无码久久一线| 久久伊人五月丁香狠狠色| 尹人香蕉久久99天天拍| 天天综合久久一二三区| 亚洲国产综合久久天堂 | 综合久久给合久久狠狠狠97色| 久久久久无码专区亚洲av| 久久亚洲精品无码播放|