Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> ASM directory path info from ASM instance
Hi,
Version 10.1.0.3
OS Linux
RAC, Standard Edition
ASM
The plan is to get rid of files I'm not using inside ASM with something like...(rather than re-create the ASM disks)...
ORACLE_SID=+ASM
sqlplus / as sysdba;
ALTER DISKGROUP dgroup1 DROP FILE '+dgroup1/payroll/compensation.dbf';
I plan to do this in a recovery scenario and may not have the client instance available.
2) I have looked in these without success:
v$asm_diskgroup v$asm_client v$asm_disk v$asm_file v$asm_template v$asm_alias v$asm_operation
3) The closest I get is the alias name (v$asm_alias) without directory path, with the following query, but need the full directory info, e.g.
-- col group_number heading 'GR|NO' format 99 col file_number heading 'FILE|NO' format 9999 col redundancy format a6 noprint col striped format a6 noprint -- select a.group_number, a.file_number, a.compound_index, a.incarnation, a.block_size, a.blocks, a.bytes/(1024*1024) mbytes, a.space/(1024*1024) mspace, a.type, a.redundancy, a.striped, a.creation_date, a.modification_date, b.name from v$asm_file a, v$asm_alias b where a.type != 'ARCHIVELOG' -- avoid for readability and a.group_number = b.group_number and a.file_number = b.file_number and a.incarnation = b.file_incarnation order by a.type, a.file_number; -- GR FILE BL NO NO SZ BLOCKS MBYTES MSPACE TYPE NAME --- ----- ------- ---------- ------ ------ -------------- -------------------- 1 260 16384 587 9 16 CONTROLFILE Current.260.3 1 261 16384 587 9 16 CONTROLFILE Current.261.3 1 256 8192 56321 440 442 DATAFILE SYSTEM.256.1 1 257 8192 35841 280 281 DATAFILE SYSAUX.257.1 1 258 8192 3841 30 31 DATAFILE UNDOTBS1.258.1 1 259 8192 641 5 6 DATAFILE USERS.259.1 1 269 8192 19201 150 151 DATAFILE EXAMPLE.269.1 1 262 512 20481 10 16 ONLINELOG group_1.262.1 1 263 512 20481 10 16 ONLINELOG group_1.263.1 1 264 512 20481 10 16 ONLINELOG group_2.264.1 1 265 512 20481 10 16 ONLINELOG group_2.265.1 1 266 512 20481 10 16 ONLINELOG group_3.266.1 1 267 512 20481 10 16 ONLINELOG group_3.267.1 1 270 512 7 0 1 PARAMETERFILE spfile.270.1 1 270 512 7 0 1 PARAMETERFILE spfilecald.ora 1 268 8192 2561 20 21 TEMPFILE TEMP.268.1 16 rows selected. 4) The test with/without full directory path: -- without full directory path: SQL> ALTER DISKGROUP CALD_DGDATA DROP FILE 'delme_file01'; ALTER DISKGROUP CALD_DGDATA DROP FILE 'delme_file01' * ERROR at line 1: ORA-15032: not all alterations performed ORA-15052: ASM file name 'delme_file01' is not in diskgroup "CALD_DGDATA" -- with full directory path: SQL> ALTER DISKGROUP CALD_DGDATA DROP FILE '+CALD_DGDATA/cald/datafile/delme_file01'; Diskgroup altered. 5) Another way is through the ASM client instance, but I was wondering if it could be done with just the ASM instance. Client instance query (partial): SELECT NAME FROM V$DATAFILE UNION ALL SELECT MEMBER FROM V$LOGFILE UNION ALL SELECT NAME FROM V$CONTROLFILE UNION ALL SELECT NAME FROM V$TEMPFILE UNION ALL SELECT NAME FROM V$ARCHIVED_LOG; -- NAME --------------------------------------------------------------------------------Received on Mon Mar 28 2005 - 18:13:46 CST
+CALD_DGDATA/cald/datafile/system.256.1
+CALD_DGDATA/cald/datafile/undotbs1.258.1
+CALD_DGDATA/cald/datafile/sysaux.257.1
+CALD_DGDATA/cald/datafile/users.259.1
+CALD_DGDATA/cald/datafile/example.269.1
+CALD_DGDATA/cald/datafile/delme_file01
+CALD_DGDATA/cald/onlinelog/group_3.266.1
+CALD_DGDATA/cald/onlinelog/group_3.267.1
+CALD_DGDATA/cald/onlinelog/group_2.264.1
+CALD_DGDATA/cald/onlinelog/group_2.265.1
+CALD_DGDATA/cald/onlinelog/group_1.262.1
+CALD_DGDATA/cald/onlinelog/group_1.263.1
+CALD_DGDATA/cald/controlfile/current.261.3
+CALD_DGDATA/cald/controlfile/current.260.3
+CALD_DGDATA/cald/tempfile/temp.268.1
+CALD_DGDATA/cald//1_6_553697915.dbf
+CALD_DGDATA/cald//1_7_553697915.dbf
+CALD_DGDATA/cald//1_8_553697915.dbf
+CALD_DGDATA/cald//1_9_553697915.dbf
... Regards, Mike Thomas -- http://www.freelists.org/webpage/oracle-l