[Oracle] Raw device上Create Tablespace
[root@iphone ~]# vgdisplay vg00
--- Volume group ---
VG Name vg00
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 2
Act PV 2
VG Size 15.99 GiB
PE Size 4.00 MiB
Total PE 4094
Alloc PE / Size 512 / 2.00 GiB
Free PE / Size 3582 / 13.99 GiB
VG UUID Ui6Kbe-yuAV-KxTB-rIwc-BqQo-0nag-AvNfRF
[root@iphone ~]# pvcreate /dev/sdd
Physical volume "/dev/sdd" successfully created
[root@iphone ~]# vgextend vg00 /dev/sdd
Volume group "vg00" successfully extended
[root@iphone ~]# vgdisplay vg00
--- Volume group ---
VG Name vg00
System ID
Format lvm2
Metadata Areas 3
Metadata Sequence No 9
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 3
Act PV 3
VG Size 23.99 GiB
PE Size 4.00 MiB
Total PE 6141
Alloc PE / Size 512 / 2.00 GiB
Free PE / Size 5629 / 21.99 GiB
VG UUID Ui6Kbe-yuAV-KxTB-rIwc-BqQo-0nag-AvNfRF
[root@iphone ~]# lvcreate -L 8G vg00 -n lv01
Logical volume "lv01" created
SQL> create tablespace vgtbs datafile '/dev/vg00/lv01' size 8G;
create tablespace vgtbs datafile '/dev/vg00/lv01' size 8G
*
ERROR at line 1:
ORA-01119: error in creating database file '/dev/vg00/lv01'
ORA-27041: unable to open file
Linux-x86_64 Error: 13: Permission denied
Additional information: 1
[root@iphone ~]# cd /dev/vg00
[root@iphone vg00]# ll
total 0
lrwxrwxrwx. 1 root root 7 May 21 06:24 lv00 -> ../dm-3
lrwxrwxrwx. 1 root root 7 May 21 06:24 lv01 -> ../dm-4
[root@iphone vg00]# chown oracle:dba lv01
SQL> create tablespace vgtbs datafile '/dev/vg00/lv01' size 8G;
create tablespace vgtbs datafile '/dev/vg00/lv01' size 8G
*
ERROR at line 1:
ORA-01119: error in creating database file '/dev/vg00/lv01'
ORA-27042: not enough space on raw partition to fullfill request
Additional information: 1
SQL> create tablespace vgtbs datafile '/dev/vg00/lv01' size 8090M;
Tablespace created.
SQL> select file_name,tablespace_name,bytes/1024/1024 from dba_data_files;
FILE_NAME TABLESPACE_NAME BYTES/1024/1024
------------------------------------------------------------ ------------------------------ ---------------
/u01/oracle/oradata/yangxu/users01.dbf USERS 5
/u01/oracle/oradata/yangxu/undotbs01.dbf UNDOTBS1 90
/u01/oracle/oradata/yangxu/sysaux01.dbf SYSAUX 720
/u01/oracle/oradata/yangxu/system01.dbf SYSTEM 700
/u01/oracle/oradata/yangxu/example01.dbf EXAMPLE 100
/u01/oracle/oradata/yangxu/bu2.dbf BU2 1024
/u01/oracle/oradata/yangxu/bu2_01.dbf BU2 10240
/u01/oracle/oradata/yangxu/bu2_index.dbf BU2_INDEX 1024
/dev/vg00/lv01 VGTBS 8090
9 rows selected.
SQL> create table vgtb tablespace vgtbs as select * from all_objects;
Table created.
SQL> insert into vgtb select * from vgtb;
72554 rows created.
SQL> commit;
Commit complete.
SQL> /
Commit complete.
SQL> insert into vgtb select * from vgtb;
145108 rows created.
SQL> /
290216 rows created.
SQL> /
580432 rows created.
SQL> /
1160864 rows created.
SQL> /
2321728 rows created.
SQL> commit;
Commit complete.
SQL> select segment_name,segment_type,tablespace_name,bytes/1024/1024 from dba_segments where segment_name='VGTB';
SEGMENT_NAME SEGMENT_TYPE TABLESPACE_NAME BYTES/1024/1024
-------------------- ------------------ ------------------------------ ---------------
VGTB TABLE VGTBS 520
SQL> drop tablespace vgtbs including contents;
Tablespace dropped.
SQL> select file_name,tablespace_name from dba_data_files;
FILE_NAME TABLESPACE_NAME
------------------------------------------------------------ ------------------------------
/u01/oracle/oradata/yangxu/users01.dbf USERS
/u01/oracle/oradata/yangxu/undotbs01.dbf UNDOTBS1
/u01/oracle/oradata/yangxu/sysaux01.dbf SYSAUX
/u01/oracle/oradata/yangxu/system01.dbf SYSTEM
/u01/oracle/oradata/yangxu/example01.dbf EXAMPLE
/u01/oracle/oradata/yangxu/bu2.dbf BU2
/u01/oracle/oradata/yangxu/bu2_01.dbf BU2
/u01/oracle/oradata/yangxu/bu2_index.dbf BU2_INDEX
8 rows selected.
SQL> select * from dba_segments where segment_name='VGTB';
no rows selected
[root@iphone vg00]# cd /dev/vg00
[root@iphone vg00]# ll
total 0
lrwxrwxrwx. 1 root root 7 May 21 05:35 lv00 -> ../dm-3
lrwxrwxrwx. 1 root root 7 May 21 05:57 lv01 -> ../dm-4
--- Volume group ---
VG Name vg00
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 8
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 2
Act PV 2
VG Size 15.99 GiB
PE Size 4.00 MiB
Total PE 4094
Alloc PE / Size 512 / 2.00 GiB
Free PE / Size 3582 / 13.99 GiB
VG UUID Ui6Kbe-yuAV-KxTB-rIwc-BqQo-0nag-AvNfRF
[root@iphone ~]# pvcreate /dev/sdd
Physical volume "/dev/sdd" successfully created
[root@iphone ~]# vgextend vg00 /dev/sdd
Volume group "vg00" successfully extended
[root@iphone ~]# vgdisplay vg00
--- Volume group ---
VG Name vg00
System ID
Format lvm2
Metadata Areas 3
Metadata Sequence No 9
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 3
Act PV 3
VG Size 23.99 GiB
PE Size 4.00 MiB
Total PE 6141
Alloc PE / Size 512 / 2.00 GiB
Free PE / Size 5629 / 21.99 GiB
VG UUID Ui6Kbe-yuAV-KxTB-rIwc-BqQo-0nag-AvNfRF
[root@iphone ~]# lvcreate -L 8G vg00 -n lv01
Logical volume "lv01" created
SQL> create tablespace vgtbs datafile '/dev/vg00/lv01' size 8G;
create tablespace vgtbs datafile '/dev/vg00/lv01' size 8G
*
ERROR at line 1:
ORA-01119: error in creating database file '/dev/vg00/lv01'
ORA-27041: unable to open file
Linux-x86_64 Error: 13: Permission denied
Additional information: 1
[root@iphone ~]# cd /dev/vg00
[root@iphone vg00]# ll
total 0
lrwxrwxrwx. 1 root root 7 May 21 06:24 lv00 -> ../dm-3
lrwxrwxrwx. 1 root root 7 May 21 06:24 lv01 -> ../dm-4
[root@iphone vg00]# chown oracle:dba lv01
SQL> create tablespace vgtbs datafile '/dev/vg00/lv01' size 8G;
create tablespace vgtbs datafile '/dev/vg00/lv01' size 8G
*
ERROR at line 1:
ORA-01119: error in creating database file '/dev/vg00/lv01'
ORA-27042: not enough space on raw partition to fullfill request
Additional information: 1
SQL> create tablespace vgtbs datafile '/dev/vg00/lv01' size 8090M;
Tablespace created.
SQL> select file_name,tablespace_name,bytes/1024/1024 from dba_data_files;
FILE_NAME TABLESPACE_NAME BYTES/1024/1024
------------------------------------------------------------ ------------------------------ ---------------
/u01/oracle/oradata/yangxu/users01.dbf USERS 5
/u01/oracle/oradata/yangxu/undotbs01.dbf UNDOTBS1 90
/u01/oracle/oradata/yangxu/sysaux01.dbf SYSAUX 720
/u01/oracle/oradata/yangxu/system01.dbf SYSTEM 700
/u01/oracle/oradata/yangxu/example01.dbf EXAMPLE 100
/u01/oracle/oradata/yangxu/bu2.dbf BU2 1024
/u01/oracle/oradata/yangxu/bu2_01.dbf BU2 10240
/u01/oracle/oradata/yangxu/bu2_index.dbf BU2_INDEX 1024
/dev/vg00/lv01 VGTBS 8090
9 rows selected.
SQL> create table vgtb tablespace vgtbs as select * from all_objects;
Table created.
SQL> insert into vgtb select * from vgtb;
72554 rows created.
SQL> commit;
Commit complete.
SQL> /
Commit complete.
SQL> insert into vgtb select * from vgtb;
145108 rows created.
SQL> /
290216 rows created.
SQL> /
580432 rows created.
SQL> /
1160864 rows created.
SQL> /
2321728 rows created.
SQL> commit;
Commit complete.
SQL> select segment_name,segment_type,tablespace_name,bytes/1024/1024 from dba_segments where segment_name='VGTB';
SEGMENT_NAME SEGMENT_TYPE TABLESPACE_NAME BYTES/1024/1024
-------------------- ------------------ ------------------------------ ---------------
VGTB TABLE VGTBS 520
SQL> drop tablespace vgtbs including contents;
Tablespace dropped.
SQL> select file_name,tablespace_name from dba_data_files;
FILE_NAME TABLESPACE_NAME
------------------------------------------------------------ ------------------------------
/u01/oracle/oradata/yangxu/users01.dbf USERS
/u01/oracle/oradata/yangxu/undotbs01.dbf UNDOTBS1
/u01/oracle/oradata/yangxu/sysaux01.dbf SYSAUX
/u01/oracle/oradata/yangxu/system01.dbf SYSTEM
/u01/oracle/oradata/yangxu/example01.dbf EXAMPLE
/u01/oracle/oradata/yangxu/bu2.dbf BU2
/u01/oracle/oradata/yangxu/bu2_01.dbf BU2
/u01/oracle/oradata/yangxu/bu2_index.dbf BU2_INDEX
8 rows selected.
SQL> select * from dba_segments where segment_name='VGTB';
no rows selected
[root@iphone vg00]# cd /dev/vg00
[root@iphone vg00]# ll
total 0
lrwxrwxrwx. 1 root root 7 May 21 05:35 lv00 -> ../dm-3
lrwxrwxrwx. 1 root root 7 May 21 05:57 lv01 -> ../dm-4
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-2104233/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 建立raw device tablespace報Linux Error: 13: Permission denieddevLinuxError
- raw devicedev
- redhat linux上不用dd清空raw device可以重複使用raw device嗎RedhatLinuxdev
- 在Linux上使用raw device方式Linuxdev
- raw device, first blockdevBloC
- about raw device[zt]dev
- Raw Device vs File Systemdev
- oracle 11g expdb autoextend tablespace and create directory error;OracleError
- oracle 10g _create tablespace相關語法Oracle 10g
- oracle10g_create tablespace_測試_1Oracle
- oracle10g_create tablespace_測試_2Oracle
- How to Choose Size of Datafile on Raw Devicedev
- 【轉】配置RAW Device磁碟組dev
- CREATE TABLESPACE命令詳解
- oracle 10g_rac_create tablespace_add_datafileOracle 10g
- Oracle create tablespace 建立表空間語法詳解Oracle
- device-mapper create ioctl failed: Device or resource busydevAPPAI
- 如何遷移裸裝置raw device資料檔案到另一個raw devicedev
- CREATE TABLESPACE命令詳解(轉)
- 配置rhel4的raw device servicedev
- Redhat 下raw device建庫介紹(ZT)Redhatdev
- Oracle9i RAC (raw device) 自動開啟(rc.local) 設定Oracledev
- ASM學習筆記_配置RAW Device磁碟組ASM筆記dev
- solaris 10_raw device_建立資料庫dev資料庫
- oracle 10.2.0.3 dbca建庫報Failed to retrieve size of raw device 問題解決方法OracleAIdev
- 【Raw Device】OEL4.8裸裝置對映方法dev
- linux下如何使用raw device來建立管理asm diskLinuxdevASM
- 聊聊Oracle可傳輸表空間(Transportable Tablespace)(上)Oracle
- 網友整理的一份Oracle10g RAC for all-version Linux -- raw deviceOracleLinuxdev
- 資料庫審計(create/alter/drop table、user、tablespace)資料庫
- 詳解oracle使用者建立(create user)(上)Oracle
- create directory in OracleOracle
- Oracle OCP(48):UNDO TABLESPACEOracle
- Oracle Table and tablespace CompressOracle
- Red Hat Enterprise Linux AS 5.3 下配置裸裝置(raw device)Linuxdev
- [Oracle] 檢視tablespace的使用率(Including temp tablespace)Oracle
- [Oracle Script] check tablespace usage infoOracle
- [Oracle Script] check temp tablespace usageOracle