Redhat5.8 X64建立裸裝置
Redhat5.8 X64建立裸裝置
1) 裸裝置建立在sdb上
# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 268 2048287+ 82 Linux swap / Solaris
/dev/sda3 269 2610 18812115 83 Linux
Disk /dev/sdb: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
2) 建立分割槽
# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 1958.
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): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1958, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1958, default 1958): +1024M
//分1GB
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
3) 檢視分割槽
# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 268 2048287+ 82 Linux swap / Solaris
/dev/sda3 269 2610 18812115 83 Linux
Disk /dev/sdb: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 125 1004031 83 Linux
4) 利用分割槽建立PV
# pvcreate /dev/sdb1
Writing physical volume data to disk "/dev/sdb1"
Physical volume "/dev/sdb1" successfully created
5) 檢視PV資訊
# pvdisplay /dev/sdb1
"/dev/sdb1" is a new physical volume of "980.50 MB"
--- NEW Physical volume ---
PV Name /dev/sdb1
VG Name
PV Size 980.50 MB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID KhQgMz-onKa-6gAL-Nybp-jt59-ux7O-CItJef
6) 建立VG
# vgcreate oravg /dev/sdb1
Volume group "oravg" successfully created
檢視VG
# vgs
VG #PV #LV #SN Attr VSize VFree
oravg 1 0 0 wz--n- 980.00M 980.00M
7) 建立LV
# lvcreate -n test_lv -L 512M oravg
# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
test_lv oravg -wi-a- 512.00M
# ls -l /dev/oravg/
total 0
lrwxrwxrwx 1 root root 25 Oct 20 22:39 test_lv -> /dev/mapper/oravg-test_lv
lvremove /dev/oravg/ test_lv --刪除lv
8) 繫結裸裝置
# raw /dev/raw/raw1 /dev/mapper/oravg-test_lv
/dev/raw/raw1: bound to major 253, minor 0
--注意,之前是沒有/dev/raw目錄的,執行後會自動建立
查詢裸裝置
# raw -qa
/dev/raw/raw1: bound to major 253, minor 0
9) 給新建立的裸裝置增加許可權,以使oracle能使用
# chown -R oracle:oinstall /dev/mapper/oravg-test_lv
重啟許可權會丟失,寫到開機啟動裡
vi /etc/rc.d/rc.local
chown -R oracle:oinstall /dev/mapper/oravg-test_lv
10) 為了保證重啟後,可以掛載裸裝置,修改下面檔案,新增內容
# vi /etc/sysconfig/rawdevices
/dev/raw/raw1 /dev/mapper/oravg-test_lv
重啟裸裝置服務,檢視裝置是否存在
# /etc/init.d/rawdevices restart
Assigning devices:
/dev/raw/raw1 --> /dev/mapper/oravg-test_lv
/dev/raw/raw1: bound to major 253, minor 0
done
[root@oracle mapper]# ls -l /dev/mapper/
total 0
crw------- 1 root root 10, 60 Oct 20 22:28 control
brw-rw---- 1 oracle oinstall 253, 0 Oct 20 22:39 oravg-test_lv
11) 建立ORACLE表空間
SQL> create tablespace test datafile '/dev/mapper/oravg-test_lv';
Tablespace created.
SQL> select file_name,tablespace_name,bytes/1024/1024 MB from dba_data_files;
FILE_NAME TABLESPACE_NAME MB
----------------------------------- ------------------------------ ----------
/u01/oradata/oral/system01.dbf SYSTEM 700
/u01/oradata/oral/sysaux01.dbf SYSAUX 560
/u01/oradata/oral/undotbs01.dbf UNDOTBS1 890
/u01/oradata/oral/users01.dbf USERS 5
/dev/mapper/oravg-test_lv TEST 511.992188
-- SQL> drop tablespace test; --裸裝置上drop表空間,不需要帶including ... and ... ,否則會連裸裝置也刪除了
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26217983/viewspace-1123876/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- raw 裸裝置資料檔案更改其他raw裸裝置位置
- Linux裸裝置總結Linux
- AIX中的裸裝置AI
- Linux下基於裸裝置建立10g資料庫Linux資料庫
- linux udev裸裝置繫結Linuxdev
- DM8 使用裸裝置搭建DMRAC
- DM7使用裸裝置搭建DMRAC
- 基於裸裝置的ASM磁碟組擴容方案ASM
- rhel 7.x 使用 udev scsi rules 配置裸裝置dev
- 記錄一則AIX使用裸裝置安裝OracleRAC的問題AIOracle
- vmware + 裸裝置 + crs + oracle10g RAC搭建步驟(二):安裝linuxOracleLinux
- 字元裝置驅動——申請、建立、應用.字元
- 如何建立適合移動裝置的文件
- 建立onenet連線nb-iot產品裝置
- 利用rman copy的方法實現儲存上裸裝置資料檔案的遷移ITPUB
- vnc遠端控制軟體x64,vnc遠端控制軟體x64安裝方法,及使用教程VNC
- 深入 x64
- 封裝Detours用於Python中x64函式hook封裝Python函式Hook
- 安裝Microsoft Visual C++ 2010 x64 Redistributable 報錯ROSC++Redis
- 黑猴子的家:Windows 安裝 Navicat121 x64Windows
- 【乾貨】Ftrans資料擺渡裝置 建立安全高效數傳通道!
- 裝置地址
- 字元裝置驅動 —— 字元裝置驅動框架字元框架
- emc cx500上的基於linux的3節點rac上的裸裝置的使用和效能測試Linux
- 智慧工廠物聯網,建立裝置到雲端的可靠連線
- BootISO:從 ISO 檔案中建立一個可啟動的 USB 裝置boot
- Ubuntu 17.04 x64 安裝 Docker CE 初窺 Dockerfile 部署 NginxUbuntuDockerNginx
- x64 簡介
- 滅火器充裝裝置
- 裝置id openpolit
- 網路裝置
- 裝置適配
- Lightroom Classic 2024(LrC2024) v13.0.0.15 (x64)直裝版OOM
- 實用的 IEC61850 裝置裝置模擬器
- 如何透過裝置基站獲取裝置經緯度
- 在受限網路裸機上安裝Openshift 4.6叢集
- Pulsar本地單機(偽)叢集 (裸機安裝與docker方式安裝) 2.2.0Docker
- 裝置分配與回收
- 自帶裝置(BYOD)