asm的一些基本操作
建立diskgroup[@more@]
Diskgroup created.
SQL> create diskgroup flash external redundancy disk 'ORCL:FLASH01','ORCL:FLASH02';
Diskgroup created.
新增磁碟
SQL> alter diskgroup flash add disk 'ORCL:FLASH03';
Diskgroup altered.
Diskgroup altered.
刪除磁碟
SQL> alter diskgroup flash drop disk flash03;
Diskgroup altered.
Diskgroup altered.
刪除磁碟組
SQL> drop diskgroup flash;
Diskgroup dropped.
Diskgroup dropped.
SQL> create diskgroup flash normal redundancy failgroup fg1 disk 'ORCL:FLASH01' failgroup fg2 disk 'ORCL:FLASH02';
Diskgroup created.
Diskgroup created.
===============================================================
SQL> select group_number,name,state,total_mb,free_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB FREE_MB
------------ ------------------------------ ----------- ---------- ----------
1 DATA MOUNTED 6134 4605
2 FLASH MOUNTED 6132 5977
GROUP_NUMBER NAME STATE TOTAL_MB FREE_MB
------------ ------------------------------ ----------- ---------- ----------
1 DATA MOUNTED 6134 4605
2 FLASH MOUNTED 6132 5977
SQL> alter diskgroup flash dismount;
Diskgroup altered.
SQL> select group_number,name,state,total_mb,free_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB FREE_MB
------------ ------------------------------ ----------- ---------- ----------
1 DATA MOUNTED 6134 4605
0 FLASH DISMOUNTED 0 0
Diskgroup altered.
SQL> select group_number,name,state,total_mb,free_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB FREE_MB
------------ ------------------------------ ----------- ---------- ----------
1 DATA MOUNTED 6134 4605
0 FLASH DISMOUNTED 0 0
SQL> alter diskgroup flash mount;
Diskgroup altered.
SQL> select group_number,name,state,total_mb,free_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB FREE_MB
------------ ------------------------------ ----------- ---------- ----------
1 DATA MOUNTED 6134 4605
2 FLASH MOUNTED 6132 5977
Diskgroup altered.
SQL> select group_number,name,state,total_mb,free_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB FREE_MB
------------ ------------------------------ ----------- ---------- ----------
1 DATA MOUNTED 6134 4605
2 FLASH MOUNTED 6132 5977
===============================================================
create directory ,或者可以直接在asmcmd中直接使用mkdir新增目錄
SQL> alter diskgroup flash add directory '+flash/test1';
Diskgroup altered.
SQL> alter diskgroup flash rename directory '+flash/test1' to '+flash/test2';
Diskgroup altered.
SQL> alter diskgroup flash drop directory '+flash/test2';
Diskgroup altered.
Diskgroup altered.
SQL> alter diskgroup flash rename directory '+flash/test1' to '+flash/test2';
Diskgroup altered.
SQL> alter diskgroup flash drop directory '+flash/test2';
Diskgroup altered.
==============================================================
管理別名
SQL> alter diskgroup data add alias '+data/asm/current.ctl' for '+data/asm/controlfile/Current.260.801073901';
Diskgroup altered.
Diskgroup altered.
SQL> alter diskgroup data rename alias '+data/asm/current.ctl' to '+data/asm/current_control.ctl';
Diskgroup altered.
Diskgroup altered.
SQL> alter diskgroup data drop alias '+data/asm/current_control.ctl';
Diskgroup altered.
Diskgroup altered.
SQL> select * from v$asm_alias;
..........................................
============================================================
刪除磁碟組中的檔案
SQL> alter diskgroup data drop file '+data/asm/datafile/userssss';
Diskgroup altered.
Diskgroup altered.
===========================================================
asm中的檔名
asm中的檔案建立均由系統自動命名
+diskgroupname/dbname/file_type/file_type_tag.file.incarnation
diskgroupname 磁碟組名
dbname 資料庫名
file_type 建立的檔案型別
file_type_tag 檔案型別的標籤
file.incarnation 檔案序號+incarnation
SQL> alter tablespace temp add tempfile '+data/asm/tempfile/temp02.dbf' size 10m;
Tablespace altered.
Tablespace altered.
SQL> alter tablespace temp add tempfile '+data' size 10m;
Tablespace altered.
Tablespace altered.
ASMCMD> pwd
+data/asm/tempfile
ASMCMD> ls -l
Type Redund Striped Time Sys Name
TEMPFILE UNPROT COARSE JAN 29 15:00:00 Y TEMP.264.801073935
TEMPFILE UNPROT COARSE JAN 30 13:00:00 Y TEMP.275.806074409
TEMPFILE UNPROT COARSE JAN 30 13:00:00 Y TEMP.276.806075175
TEMPFILE UNPROT COARSE JAN 30 13:00:00 Y TEMP.277.806075277
N temp02.dbf => +DATA/ASM/TEMPFILE/TEMP.276.806075175
+data/asm/tempfile
ASMCMD> ls -l
Type Redund Striped Time Sys Name
TEMPFILE UNPROT COARSE JAN 29 15:00:00 Y TEMP.264.801073935
TEMPFILE UNPROT COARSE JAN 30 13:00:00 Y TEMP.275.806074409
TEMPFILE UNPROT COARSE JAN 30 13:00:00 Y TEMP.276.806075175
TEMPFILE UNPROT COARSE JAN 30 13:00:00 Y TEMP.277.806075277
N temp02.dbf => +DATA/ASM/TEMPFILE/TEMP.276.806075175
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-1060179/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL對錶和庫的一些基本操作MySql
- 關於ASM的一些理論ASM
- 非常詳細地Hive的基本操作和一些注意事項Hive
- Go 操作 Redis 的基本操作GoRedis
- Docker的基本操作Docker
- MySQL的基本操作MySql
- git的基本操作Git
- ASM磁碟組更換磁碟的操作方法ASM
- 陣列的基本操作陣列
- Vim命令的基本操作
- Numpy的基本操作(五)
- Hive表的基本操作Hive
- JS — 物件的基本操作JS物件
- Spring Boot的基本操作Spring Boot
- Docker映象的基本操作Docker
- Hbase shell的基本操作
- react的基本操作(1)React
- ASM磁碟組擴容操作文件ASM
- JQuery的一些基本知識jQuery
- redis基本操作Redis
- VSCode基本操作VSCode
- Docker基本操作Docker
- ElasticSearch基本操作Elasticsearch
- ElasticSearch - 基本操作Elasticsearch
- candance 基本操作
- svn基本操作
- oracle基本操作Oracle
- Hash基本操作
- linux基本操作Linux
- python基本操作Python
- FFMPEG基本操作
- dos 基本操作
- 基本操作題
- Laravel 基本操作Laravel
- HBase 基本操作
- MongoDB基本操作MongoDB
- webpack 基本操作Web
- Git基本操作Git
- mongo基本操作Go