Linux新建裸设备,linux下使用裸设备创建oracle表空间

62e50291a81fc54b507f33cb80033297.gif linux下使用裸设备创建oracle表空间

(4页)

3e6c9d207da02cb1a894c9bed73fd333.gif

本资源提供全文预览,点击全文预览即可全文预览,如果喜欢文档就下载吧,查找使用更方便哦!

14.90 积分

Linux下使用裸设备创建oracle表空间 Linux下使用裸设备创建oracle表空间1. 环境n 系统环境[root@node1 ~]# uname –aLinux node1 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686 i386 GNU/Linux   [root@node1 ~]# more /etc/redhat-release Red Hat Enterprise Linux Server release 5.5 (Tikanga)[root@node1 ~]# n oracle环境SQL> select * from v$version;BANNEROracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionPL/SQL Release 11.2.0.1.0 - ProductionCORE    11.2.0.1.0      ProductionTNS for Linux: Version 11.2.0.1.0 - ProductionNLSRTL Version 11.2.0.1.0 – Production2. 查看磁盘[root@node1 ~]# fdisk -lDisk /dev/sda: 21.4 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sda1   *           1          13      104391   83  Linux/dev/sda2              14        2610    20860402+  8e  Linux LVMDisk /dev/sdb: 21.4 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdb1               1        2610    20964793+  83  LinuxDisk /dev/sdc: 8589 MB, 8589934592 bytes255 heads, 63 sectors/track, 1044 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDisk /dev/sdc doesn't contain a valid partition table3. 给/dev/sdc 划分一个1g的分区  用作裸设备[root@node1 ~]# fdisk /dev/sdcDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel. Changes will remain in memory only,until you decide to write them. After that, of course, the previouscontent won't be recoverable.The number of cylinders for this disk is set to 1044.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)Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)Command (m for help): mCommand 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): nCommand action   e   extended   p   primary partition (1-4)pPartition number (1-4): 1First cylinder (1-1044, default 1): Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044): +1024MCommand (m for help): pDisk /dev/sdc: 8589 MB, 8589934592 bytes255 heads, 63 sectors/track, 1044 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes   Device Boot      Start         End      Blocks   Id  System/dev/sdc1               1         125     1004031   83  LinuxCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.4. 修改/etc/udev/rules.d/60-raw.rules 文件    [root@node1 ~]# vi /etc/udev/rules.d/60-raw.rules # Enter raw device bindings here.## An example would be:#   ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"# to bind /dev/raw/raw1 to /dev/sda, or#   ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"# to bind /dev/raw/raw2 to the device with major 8, minor 1.ACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw1 %N"ACTION=="add", KERNEL=="sdc2", RUN+="/bin/raw /dev/raw/raw2 %N"ACTION=="add", ENV{MAJOR}=="3", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw1 %M %m"ACTION=="add", ENV{MAJOR}=="7", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"5. 启动裸设备[root@node1 ~]# start_udevStarting udev:                                             [  OK  ][root@node1 ~]# 6. 修改裸设备的权限                        [root@node1 ~]# raw -qa/dev/raw/raw1:  bound to major 8, minor 33/dev/raw/raw2:  bound to major 8, minor 34[root@node1 ~]# cd /dev/raw[root@node1 raw]# ls -ltotal 0crw------- 1 root root 162, 1 Apr  7 18:03 raw1crw------- 1 root root 162, 2 Apr  7 18:03 raw2[root@node1 raw]# chown oracle:oinstall raw1[root@node1 raw]# chown oracle:oinstall raw2[root@node1 raw]# chmod 775 raw1 raw2[root@node1 raw]# ls -ltotal 0crwxrwxr-x 1 oracle oinstall 162, 1 Apr  7 18:03 raw1crwxrwxr-x 1 oracle oinstall 162, 2 Apr  7 18:03 raw27. 查看裸设备的可用空间                               [root@node1 raw]# blockdev --getsize /dev/raw/raw12008062[root@node1 raw]# blockdev --getsize /dev/raw/raw220081252008125*512/1024/1024=980M8. 在oracle中添加裸设备为数据文件的表空间SQL> create tablespace tbs_raw datafile'/dev/raw/raw1' size 950m;Tablespace created. 第 4 页 关 键 词: linux 使用 设备 创建 oracle 空间

524d6daf746efaa52c3c71bbfe7ba172.gif  天天文库所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值