redhat linux上不用dd清空raw device可以重複使用raw device嗎
測試目標:
如何清空lvm的lv,並讓oracle再次使用
顯示lv邏輯卷
[root@rhel5 ~]# lvdisplay /dev/vg2/lv2
--- Logical volume ---
LV Name /dev/vg2/lv2
VG Name vg2
LV UUID WMs2Xf-dZ7f-mUyc-OHnh-C50U-DvAc-I7TZBU
LV Write Access read/write
LV Status available
# open 1
LV Size 52.00 MB --邏輯卷大小為52m
Current LE 13
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
[root@rhel5 ~]# ls -l /dev/nu*
crw-rw-rw- 1 root root 1, 3 Jun 24 01:44 /dev/null
---清空lv
[root@rhel5 ~]# dd if=/dev/null f=/dev/vg2/lv2
0+0 records in
0+0 records out
0 bytes (0 B) copied, 4.1775e-05 seconds, 0.0 kB/s
[root@rhel5 ~]# su - oracle
-bash-3.2$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 24 06:20:41 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> col file_name for a50
SQL> set linesize 300
SQL> select tablespace_name,file_name,bytes/1024/1024 as curmb,increment_by from dba_data_files;
TABLESPACE_NAME FILE_NAME CURMB INCREMENT_BY
------------------------------ -------------------------------------------------- ---------- ------------
SYSTEM /oracle/app/oracle/oradata/zxy/system01.dbf 700 1
SYSAUX /oracle/app/oracle/oradata/zxy/sysaux01.dbf 600 1280
UNDOTBS1 /oracle/app/oracle/oradata/zxy/undotbs01.dbf 1080 640
USERS /oracle/app/oracle/oradata/zxy/users01.dbf 235 160
---裸裝置不能完全分配給oracle使用
SQL> create tablespace tbs_raw datafile '/dev/vg2/lv2' size 52m;
create tablespace tbs_raw datafile '/dev/vg2/lv2' size 52m
*
ERROR at line 1:
ORA-01119: error in creating database file '/dev/vg2/lv2'
ORA-27042: not enough space on raw partition to fullfill request
Additional information: 1
SQL> create tablespace tbs_raw datafile '/dev/vg2/lv2' size 51m;
Tablespace created.
---在裸裝置表空間建表並插入資料
SQL> create table t_raw(a int) tablespace tbs_raw;
Table created.
SQL> insert into t_raw values(1);
1 row created.
SQL> insert into t_raw values(3);
1 row created.
SQL> commit;
Commit complete.
---如果在已使用的資料檔案上建表空間會報錯
SQL> create tablespace tbs_exist datafile '/dev/vg2/lv2' size 50m;
create tablespace tbs_exist datafile '/dev/vg2/lv2' size 50m
*
ERROR at line 1:
ORA-01537: cannot add file '/dev/vg2/lv2' - file already part of database
---如何不清空裸裝置再次使用裸裝置會報錯嗎
SQL> drop tablespace tbs_raw including contents and datafiles;
Tablespace dropped.
---不清空裸裝置也可以正常再次使用裸裝置
SQL> create tablespace tbs_reuse datafile '/dev/vg2/lv2' size 10m;
Tablespace created.
SQL> create table t_raw(a int) tablespace tbs_reuse;
Table created.
SQL> insert into t_raw values(1);
1 row created.
SQL> commit;
Commit complete.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-764677/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 在Linux上使用raw device方式Linuxdev
- raw devicedev
- [Oracle] Raw device上Create TablespaceOracledev
- Redhat 下raw device建庫介紹(ZT)Redhatdev
- raw device, first blockdevBloC
- about raw device[zt]dev
- Raw Device vs File Systemdev
- How to Choose Size of Datafile on Raw Devicedev
- 【轉】配置RAW Device磁碟組dev
- 如何遷移裸裝置raw device資料檔案到另一個raw devicedev
- linux下如何使用raw device來建立管理asm diskLinuxdevASM
- 建立raw device tablespace報Linux Error: 13: Permission denieddevLinuxError
- 配置rhel4的raw device servicedev
- ASM學習筆記_配置RAW Device磁碟組ASM筆記dev
- solaris 10_raw device_建立資料庫dev資料庫
- 【Raw Device】OEL4.8裸裝置對映方法dev
- Red Hat Enterprise Linux AS 5.3 下配置裸裝置(raw device)Linuxdev
- 網友整理的一份Oracle10g RAC for all-version Linux -- raw deviceOracleLinuxdev
- Oracle9i RAC (raw device) 自動開啟(rc.local) 設定Oracledev
- redhat5 raw 的管理Redhat
- oracle 10.2.0.3 dbca建庫報Failed to retrieve size of raw device 問題解決方法OracleAIdev
- Linux Raw DevicesLinuxdev
- Redhat 5 中裸裝置(raw) 的配置Redhat
- Error:The specified shared raw partition /dev/raw/raw1...Errordev
- 翻譯:Linux and the Device TreeLinuxdev
- linux下raw與基於lvm的raw的用法LinuxLVM
- RedHat 5.6_x86_64 + ASM + RAW+ OracRedhatASM
- [轉]RedHat 5中裸裝置(raw)的配置Redhat
- [Linux Device Driver] wifi adb 使用方法LinuxdevWiFi
- wrap devicedev
- device dirverdev
- platform devicePlatformdev
- RAW影像處理工具——RAW Power for MacMac
- RAW影像處理工具:RAW Power MacMac
- device-mapper create ioctl failed: Device or resource busydevAPPAI
- RAW Power for Mac(RAW影像處理軟體)Mac
- No space left on devicedev
- Mac上RAW影像處理軟體Mac