12c官方不支持裸设备,功能上依旧支持

联系:手机/微信(+86 17813235971) QQ(107644445)

标题:12c官方不支持裸设备,功能上依旧支持

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

根据官方描述:Announcement of DeSupport of using RAW devices in Oracle Database Version 12.1 (Doc ID 578455.1),从12.1开始oracle 彻底放弃了数据文件对raw的支持,但是我测试结果证明依旧可以使用(本测试只是证明功能上可以使用,不能说官方支持,稳定性和遭遇bug情况未知),在条件允许情况下,不建议使用该方式.
block设备测试

[root@localhost ~]# chown oracle:oinstall /dev/sdf
[root@localhost ~]# ls -l /dev/sdf
brw-rw---- 1 oracle oinstall 8, 80 Apr  2 19:28 /dev/sdf
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Sun Apr 2 19:34:22 2017
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
    CON_ID
----------
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
         0
PL/SQL Release 12.2.0.1.0 - Production
         0
CORE    12.2.0.1.0      Production
         0
TNS for Linux: Version 12.2.0.1.0 - Production
         0
NLSRTL Version 12.2.0.1.0 - Production
         0
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA/XFFDB/DATAFILE/system.257.938465955
+DATA/XFFDB/DATAFILE/sysaux.258.938465989
+DATA/XFFDB/DATAFILE/undotbs1.259.938466005
+DATA/XFFDB/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/system.271.938466083
+DATA/XFFDB/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/sysaux.270.938466083
+DATA/XFFDB/DATAFILE/users.260.938466007
+DATA/XFFDB/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/undotbs1.272.938466083
+DATA/XFFDB/4A93528C587D82CEE055000000000001/DATAFILE/system.276.938466401
+DATA/XFFDB/4A93528C587D82CEE055000000000001/DATAFILE/sysaux.277.938466401
+DATA/XFFDB/4A93528C587D82CEE055000000000001/DATAFILE/undotbs1.275.938466399
+DATA/XFFDB/4A93528C587D82CEE055000000000001/DATAFILE/users.279.938466427
11 rows selected.
SQL> create tablespace test datafile '/dev/sdf' size 10M autoextend on;
Tablespace created.
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA/XFFDB/DATAFILE/system.257.938465955
+DATA/XFFDB/DATAFILE/sysaux.258.938465989
+DATA/XFFDB/DATAFILE/undotbs1.259.938466005
+DATA/XFFDB/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/system.271.938466083
+DATA/XFFDB/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/sysaux.270.938466083
+DATA/XFFDB/DATAFILE/users.260.938466007
+DATA/XFFDB/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/undotbs1.272.938466083
+DATA/XFFDB/4A93528C587D82CEE055000000000001/DATAFILE/system.276.938466401
+DATA/XFFDB/4A93528C587D82CEE055000000000001/DATAFILE/sysaux.277.938466401
+DATA/XFFDB/4A93528C587D82CEE055000000000001/DATAFILE/undotbs1.275.938466399
+DATA/XFFDB/4A93528C587D82CEE055000000000001/DATAFILE/users.279.938466427
/dev/sdf
12 rows selected.
SQL>  select file# from v$datafile where name like '%sdf%';
     FILE#
----------
        13
SQL> select rfile#,file#,name from v$datafile where file#=13;
    RFILE#      FILE# NAME
---------- ---------- ------------------------------
        13         13 /dev/sdf
SQL> create table t_xifenfei tablespace test as
  2  select * from dba_objects;
Table created.
SQL> select count(*) from t_xifenfei;
  COUNT(*)
----------
     72660
SQL> select file_id,extent_id,blocks from dba_extents where segment_name='T_XIFENFEI';
   FILE_ID  EXTENT_ID     BLOCKS
---------- ---------- ----------
        13          0          8
        13          1          8
        13          2          8
        13          3          8
        13          4          8
        13          5          8
        13          6          8
        13          7          8
        13          8          8
        13          9          8
        13         10          8
        13         11          8
        13         12          8
        13         13          8
        13         14          8
        13         15          8
        13         16        128
        13         17        128
        13         18        128
        13         19        128
        13         20        128
        13         21        128
        13         22        128
        13         23        128
        13         24        128
        13         25        128
        13         26        128
27 rows selected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 2432696320 bytes
Fixed Size                  8795664 bytes
Variable Size             654313968 bytes
Database Buffers         1761607680 bytes
Redo Buffers                7979008 bytes
Database mounted.
Database opened.
SQL> select count(*) from t_xifenfei;
  COUNT(*)
----------
     72660
SQL>
SQL> set pages 100
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA/XFFDB/DATAFILE/system.257.938465955
+DATA/XFFDB/DATAFILE/sysaux.258.938465989
+DATA/XFFDB/DATAFILE/undotbs1.259.938466005
+DATA/XFFDB/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/system.271.938466083
+DATA/XFFDB/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/sysaux.270.938466083
+DATA/XFFDB/DATAFILE/users.260.938466007
+DATA/XFFDB/4700A987085B3DFAE05387E5E50A8C7B/DATAFILE/undotbs1.272.938466083
+DATA/XFFDB/4A93528C587D82CEE055000000000001/DATAFILE/system.276.938466401
+DATA/XFFDB/4A93528C587D82CEE055000000000001/DATAFILE/sysaux.277.938466401
+DATA/XFFDB/4A93528C587D82CEE055000000000001/DATAFILE/undotbs1.275.938466399
+DATA/XFFDB/4A93528C587D82CEE055000000000001/DATAFILE/users.279.938466427
/dev/sdf
12 rows selected.

lvm设备测试

[root@localhost ~]# pvcreate /dev/sdf
  Physical volume "/dev/sdf" successfully created.
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# vgcreate vgxff /dev/sdf
  Volume group "vgxff" successfully created
[root@localhost ~]# lvcreate -L 512M -n data01 vgxff
  Logical volume "data01" created.
[root@localhost ~]# lvcreate -L 512M -n data02 vgxff
  Logical volume "data02" created.
[root@localhost ~]# lvcreate -L 512M -n data03 vgxff
  Logical volume "data03" created.
[root@localhost ~]# lvdisplay vgxff
  --- Logical volume ---
  LV Path                /dev/vgxff/data01
  LV Name                data01
  VG Name                vgxff
  LV UUID                c9PowB-11OX-sjcF-fZLe-5vha-xV4x-ITRflH
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2017-04-02 19:46:17 -0400
  LV Status              available
  # open                 0
  LV Size                512.00 MiB
  Current LE             128
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           251:2
  --- Logical volume ---
  LV Path                /dev/vgxff/data02
  LV Name                data02
  VG Name                vgxff
  LV UUID                vvMbWB-tale-twTH-hg4k-Kcwh-3I8e-neOnEk
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2017-04-02 19:46:21 -0400
  LV Status              available
  # open                 0
  LV Size                512.00 MiB
  Current LE             128
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           251:3
  --- Logical volume ---
  LV Path                /dev/vgxff/data03
  LV Name                data03
  VG Name                vgxff
  LV UUID                DDz3M1-cVX0-NAJb-3rlK-DkYt-eSQG-xna8ew
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2017-04-02 19:46:25 -0400
  LV Status              available
  # open                 0
  LV Size                512.00 MiB
  Current LE             128
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           251:4
[root@localhost ~]# cd /dev/vgxff/
[root@localhost vgxff]# ls -ltr
total 0
lrwxrwxrwx 1 root root 7 Apr  2 19:46 data01 -> ../dm-2
lrwxrwxrwx 1 root root 7 Apr  2 19:46 data02 -> ../dm-3
lrwxrwxrwx 1 root root 7 Apr  2 19:46 data03 -> ../dm-4
[root@localhost vgxff]# cd /dev/mapper/
[root@localhost mapper]# ls -ltr
total 0
crw------- 1 root root 10, 236 Apr  2 19:28 control
lrwxrwxrwx 1 root root       7 Apr  2 19:28 ol-swap -> ../dm-1
lrwxrwxrwx 1 root root       7 Apr  2 19:28 ol-root -> ../dm-0
lrwxrwxrwx 1 root root       7 Apr  2 19:46 vgxff-data01 -> ../dm-2
lrwxrwxrwx 1 root root       7 Apr  2 19:46 vgxff-data02 -> ../dm-3
lrwxrwxrwx 1 root root       7 Apr  2 19:46 vgxff-data03 -> ../dm-4
[root@localhost mapper]# ls -l /dev/dm*
brw-rw---- 1 root disk 251, 0 Apr  2 19:28 /dev/dm-0
brw-rw---- 1 root disk 251, 1 Apr  2 19:28 /dev/dm-1
brw-rw---- 1 root disk 251, 2 Apr  2 19:46 /dev/dm-2
brw-rw---- 1 root disk 251, 3 Apr  2 19:46 /dev/dm-3
brw-rw---- 1 root disk 251, 4 Apr  2 19:46 /dev/dm-4
[root@localhost mapper]# chown oracle:oinstall /dev/dm-[2-4]
[root@localhost mapper]# ls -l /dev/dm*
brw-rw---- 1 root   disk     251, 0 Apr  2 19:28 /dev/dm-0
brw-rw---- 1 root   disk     251, 1 Apr  2 19:28 /dev/dm-1
brw-rw---- 1 oracle oinstall 251, 2 Apr  2 19:46 /dev/dm-2
brw-rw---- 1 oracle oinstall 251, 3 Apr  2 19:46 /dev/dm-3
brw-rw---- 1 oracle oinstall 251, 4 Apr  2 19:46 /dev/dm-4
[root@localhost mapper]#
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Sun Apr 2 19:50:47 2017
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> create tablespace lvtbs datafile '/dev/mapper/vgxff-data01' size 450M;
Tablespace created.
SQL> alter tablespace lvtbs add datafile '/dev/mapper/vgxff-data02' size 450M;
Tablespace altered.
SQL> alter tablespace lvtbs add datafile '/dev/mapper/vgxff-data03' size 450M;
Tablespace altered.
SQL> select rfile#,file#,name from v$datafile where name like '%mapper%';
    RFILE#      FILE# NAME
---------- ---------- --------------------------------------------------
        14         14 /dev/mapper/vgxff-data01
        15         15 /dev/mapper/vgxff-data02
        16         16 /dev/mapper/vgxff-data03
SQL> create table lv12c tablespace lvtbs as
  2  select * from dba_objects;
Table created.
SQL> select count(*) from lv12c;
  COUNT(*)
----------
     72660
SQL> select file_id,extent_id,blocks from dba_extents where segment_name='LV12C';
   FILE_ID  EXTENT_ID     BLOCKS
---------- ---------- ----------
        14          0          8
        14          1          8
        14          2          8
        14          3          8
        14          4          8
        14          5          8
        14          6          8
        14          7          8
        14          8          8
        14          9          8
        14         10          8
        14         11          8
        14         12          8
        14         13          8
        14         14          8
        14         15          8
        14         18        128
        14         21        128
        14         24        128
        15         17        128
        15         20        128
        15         23        128
        15         26        128
        16         16        128
        16         19        128
        16         22        128
        16         25        128
27 rows selected.
SQL> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 2432696320 bytes
Fixed Size                  8795664 bytes
Variable Size             654313968 bytes
Database Buffers         1761607680 bytes
Redo Buffers                7979008 bytes
Database mounted.
Database opened.
SQL>  select count(*) from lv12c;
  COUNT(*)
----------
     72660

raw设备测试

[root@localhost ~]# raw /dev/raw/raw1 /dev/sdf
/dev/raw/raw1:  bound to major 8, minor 80
[root@localhost ~]# ls -l /dev/raw/raw1
crw-rw---- 1 root disk 162, 1 Apr  4 04:00 /dev/raw/raw1
[root@localhost ~]# chown oracle:oinstall /dev/raw/raw1
[root@localhost ~]# ls -l /dev/raw/raw1
crw-rw---- 1 oracle oinstall 162, 1 Apr  4 04:00 /dev/raw/raw1
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Tue Apr 4 04:01:42 2017
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> create tablespace rawtbs datafile '/dev/raw/raw1' size 128M autoextend on;
Tablespace created.
SQL>  select rfile#,file#,name from v$datafile where name like '%raw%';
    RFILE#      FILE#
---------- ----------
NAME
--------------------------------------------------------------------------------
        17         17
/dev/raw/raw1
SQL>  create table t_xifenfei_raw tablespace rawtbs
  2  as select * from dba_objects;
Table created.
SQL> select count(*) from t_xifenfei_raw ;
  COUNT(*)
----------
     72660
SQL> select file_id,extent_id,blocks from dba_extents where segment_name='T_XIFENFEI_RAW';
   FILE_ID  EXTENT_ID     BLOCKS
---------- ---------- ----------
        17          0          8
        17          1          8
        17          2          8
        17          3          8
        17          4          8
        17          5          8
        17          6          8
        17          7          8
        17          8          8
        17          9          8
        17         10          8
        17         11          8
        17         12          8
        17         13          8
        17         14          8
        17         15          8
        17         16        128
        17         17        128
        17         18        128
        17         19        128
        17         20        128
        17         21        128
        17         22        128
        17         23        128
        17         24        128
        17         25        128
        17         26        128
27 rows selected.

从这里这里测试结果看,对于linux的block/raw/lvm设备依旧均可以在功能上做数据文件使用(稳定性和是否有其他bug未知).但没有出现mos中描述的直接报错,在条件允许的情况下,尽可能不要使用直接使用裸设备方式.
在12.2的administrator文档中出现明显描述:
12C-RAW2
Direct use of raw or block devices is not supported. You can only use raw or block devices under Oracle ASM.

发表评论

邮箱地址不会被公开。 必填项已用*标注

20 − 7 =