You are administering a database stored in Automatic Storage management (ASM). The
files are stored in the DATA disk group. You execute the following command:
SQL > ALTER DISKGROUP data ADD ALIAS ‘+data/prod/myfile.dbf’ FOR ‘+data/prod/myfile.dbf’
What is the result?
A. The file ‘+data.231.54769’ is physically relocated to ‘+data/prod’ and renamed as ‘myfile.dbf’.
B. The file ‘+data.231.54769’ is renamed as ‘myfile.dbf’, and copied to ‘+data/prod’.
C. The file ‘+data.231.54769’ remains in the same location and a synonym 'myfile.dbf' is created.
D. The file ‘myfile.dbf’ is created in ‘+data/prod’ and the reference to ‘+data.231.54769’ in the data dictionary removed.
Answer: C
答案解析
Use this clause to create an alias name for an Oracle ASM filename. The alias_name
consists of the full directory path and the alias itself.
别名就是外号,比如说当系统自动产生的名称太过复杂不怎么好记,DBA可以通过别名,为它创建一个简单化的名称,而又不会对其现有名称造成任何影响。ASM中创建别名是通过alter diskgroup的alias子句实现,支持增加/修改/删除等多项操作。V$ASM_ALIAS视图中可以查询到当前实例中创建的别名。
例如,增加别名:
files are stored in the DATA disk group. You execute the following command:
SQL > ALTER DISKGROUP data ADD ALIAS ‘+data/prod/myfile.dbf’ FOR ‘+data/prod/myfile.dbf’
What is the result?
A. The file ‘+data.231.54769’ is physically relocated to ‘+data/prod’ and renamed as ‘myfile.dbf’.
B. The file ‘+data.231.54769’ is renamed as ‘myfile.dbf’, and copied to ‘+data/prod’.
C. The file ‘+data.231.54769’ remains in the same location and a synonym 'myfile.dbf' is created.
D. The file ‘myfile.dbf’ is created in ‘+data/prod’ and the reference to ‘+data.231.54769’ in the data dictionary removed.
Answer: C
答案解析
Use this clause to create an alias name for an Oracle ASM filename. The alias_name
consists of the full directory path and the alias itself.
别名就是外号,比如说当系统自动产生的名称太过复杂不怎么好记,DBA可以通过别名,为它创建一个简单化的名称,而又不会对其现有名称造成任何影响。ASM中创建别名是通过alter diskgroup的alias子句实现,支持增加/修改/删除等多项操作。V$ASM_ALIAS视图中可以查询到当前实例中创建的别名。
例如,增加别名:
09:10:23 sys@kiwi> select name from v$datafile;
NAME
----------------------------------------------------------------------------------------------------------------------------------
+DATA/KIWI/DATAFILE/system.258.906850731
+DATA/KIWI/DATAFILE/test.268.906861531
+DATA/KIWI/DATAFILE/sysaux.257.906850669
+DATA/KIWI/DATAFILE/undotbs1.260.906850807
+DATA/KIWI/DATAFILE/example.266.906850863
+DATA/KIWI/DATAFILE/users.259.906850807
09:10:45 idle> alter diskgroup data add alias '+DATA/KIWI/DATAFILE/test.dbf' for '+DATA/KIWI/DATAFILE/test.268.906861531';
ASMCMD> ls -l
Type Redund Striped Time Sys Name
DATAFILE UNPROT COARSE MAR 29 03:00:00 Y EXAMPLE.266.906850863
DATAFILE UNPROT COARSE MAR 29 03:00:00 Y SYSAUX.257.906850669
DATAFILE UNPROT COARSE MAR 29 03:00:00 Y SYSTEM.258.906850731
DATAFILE UNPROT COARSE MAR 29 03:00:00 Y TEST.268.906861531
DATAFILE UNPROT COARSE MAR 29 03:00:00 Y UNDOTBS1.260.906850807
DATAFILE UNPROT COARSE MAR 29 03:00:00 Y USERS.259.906850807
DATAFILE UNPROT COARSE MAR 29 03:00:00 N test.dbf => +DATA/KIWI/DATAFILE/TEST.268.906861531