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 Device Driver] wifi adb 使用方法LinuxdevWiFi
- 翻譯:Linux and the Device TreeLinuxdev
- RedHat 5.6_x86_64 + ASM + RAW+ OracRedhatASM
- SciTech-OS-Linux-Device Driver: 英文原版電子書“Linux Device Drivers, Third Edition”Linuxdev
- Structure of Linux Kernel Device Driver(Part II)StructLinuxdev
- Camera Raw中文Raw增效ACR數位相機Raw圖片編輯
- RAW影像處理工具——RAW Power for MacMac
- RAW影像處理工具:RAW Power MacMac
- RAW Power for Mac(RAW影像處理軟體)Mac
- Camera Raw15 for mac(PS Raw增效工具)Mac
- 執行時報錯RuntimeError: expected device cpu but got device cuda:0ErrordevGo
- Camera Raw 14 Mac(Raw格式影像ps外掛)Mac
- Mac上RAW影像處理軟體Mac
- Adobe Camera Raw
- As 除錯 no target device found除錯dev
- kubernetes container device interface (CDI)AIdev
- Waiting for target device to come onlineAIdev
- RAW影像處理工具:RAW Power for mac中文版Mac
- Mac強大的raw影像處理軟體:RAW PowerMac
- JavaScript String.raw()JavaScript
- Powershell and Windows RAW SOCKETWindows
- 瞭解Linux系統中的Device Mapper機制:使用者空間LinuxdevAPP
- iOS Device ID 的前世今生iOSdev
- XDS: Cross-Device Scripting AttacksROSdev
- gpg: signing failed: Inappropriate ioctl for deviceAIAPPdev
- 優秀的RAW影像處理工具:RAW Power mac中文版Mac
- Camera Raw 15 for mac 15.2中文版,PS Raw增效工具Mac
- ps/lr濾鏡raw影像編輯器:ON1 Photo RAW 2022
- 淺談 iOS Device ID 的修改iOSdev
- Android Studio: /dev/kvm device permission deniedAndroiddev
- Error: Connection activation failed: Device not managed by NetworkManagerErrorAIdev
- raw 裸裝置資料檔案更改其他raw裸裝置位置
- ON1 Photo RAW 2022 for Mac(ps/lr濾鏡raw影像編輯器)Mac
- 關於 SAP UI5 Device API 的使用介紹UIdevAPI
- 微軟釋出Raw Image Extension:win10系統使用者可輕鬆訪問RAW格式微軟Win10
- win10 如何檢視raw檔案 win10 如何檢視rawWin10
- VMware - 與 Device/Credential Guard 不相容dev
- The following instances are in the device manifest but not specified in framework compatibility matrix:devFramework
- 沒有磁碟空間 No space left on devicedev