asm 的管理

sundayhe發表於2010-11-03

1、看asm是否還有剩餘空間;
%export ORACLE_SID=+ASM2 --定義例項名
% asmcmd
ASMCMD> lsdg --使用lsdg 檢視Free_MB這一列
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED EXTERN N 512 4096 1048576 8448 3182 0 3182 0 DG_ARCH/
MOUNTED EXTERN N 512 4096 1048576 41472 39642 0 39642 0 DG_DATA/
DISMOUNTED N 512 4096 0 0 0 0 0 0 DG_FLASH/
MOUNTED EXTERN N 512 4096 1048576 4608 4142 0 4142 0 DG_FR/
2、加資料檔案;
%export ORACLE_SID=+ASM2
+ASM (ASM instance)
SQL> select file_number , sum(bytes)/(1024*1024) from v$asm_file group by file_number;
FILE_NUMBER SUM(BYTES)/(1024*1024)
----------- ----------------------
256 360.007813
257 35.0078125
258 450.007813
261 .002441406
262 150.007813
263 23.0078125
264 10.0004883
265 5.0078125
266 10.0004883
267 10.0004883
268 2.2109375
%export ORACLE_SID=racdb2
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DG_DATA/racdb/datafile/system.259.697032449
+DG_DATA/racdb/datafile/sysaux.260.697032467
+DG_DATA/racdb/datafile/undotbs1.261.697032477
+DG_DATA/racdb/datafile/undotbs2.263.697032511
+DG_DATA/racdb/datafile/users.264.697032523
+DG_DATA/racdb/datafile/tbs_seagull.268.697652457
SQL> alter tablespace UNDOTBS2 add datafile '+DG_DATA' size 10M; --在DG上增加資料檔案
Tablespace altered.
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DG_DATA/racdb/datafile/system.259.697032449
+DG_DATA/racdb/datafile/sysaux.260.697032467
+DG_DATA/racdb/datafile/undotbs1.261.697032477
+DG_DATA/racdb/datafile/undotbs2.263.697032511
+DG_DATA/racdb/datafile/users.264.697032523
+DG_DATA/racdb/datafile/tbs_seagull.268.697652457
+DG_DATA/racdb/datafile/undotbs2.269.700055781 --新加的資料檔案
7 rows selected.
SQL>
3、怎樣往asm磁碟組新增disk,劃好裸盤,分配許可權。
%export ORACLE_SID=+ASM2
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED EXTERN N 512 4096 1048576 8448 3182 0 3182 0 DG_ARCH/
MOUNTED EXTERN N 512 4096 1048576 41472 39631 0 39631 0 DG_DATA/
DISMOUNTED N 512 4096 0 0 0 0 0 0 DG_FLASH/
MOUNTED EXTERN N 512 4096 1048576 4608 4142 0 4142 0 DG_FR/
ASMCMD> exit
$sqlplus ' /as sysdba'
SQL> alter diskgroup DG_DATA add disk '/dev/r11g_asmdisk10';
SQL>select name, path, mode_status, state, disk_number from v$asm_disk;
NAME
------------------------------------------------------------
PATH
--------------------------------------------------------------------------------
MODE_STATUS STATE DISK_NUMBER
-------------- ---------------- -----------
/dev/r11g_asmdisk10
ONLINE NORMAL 4


[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9479798/viewspace-1040810/,如需轉載,請註明出處,否則將追究法律責任。

相關文章