Various clients can access and manipulate ASM files. Which two statements are true?
A.
The DBMS_FILE_TRANSFER.COPY_FILE procedure can move a database file from one ASM
to another ASM, but not to an operating system file system.
B.
The ASMCMD cp command can move database files from a file system to ASM, but not from
ASM to ASM.
C.
The SQL*Plus command ALTER DISKGROUP orcl MOVE ‘+DATA/orcl/example01.dbf’ to
‘+OLDDATA/orcl/example01.dbf’ can move the example01 data file to a different diskgroup.
D.
The DBMS_FILE_TRANSFER.GET_FILE procedure reads an ASM file from a remote machine
and makes a local copy on an ASM or a file system.
E.
The ASMCMD rm command will delete ASM files and directories, but not database files on an
operating system file system.
Explanation:
DBMS_FILE_TRANSFERCOPY_FILE Procedure
This procedure reads a file from a source directory and creates a copy of it in a destination
directory. The source and destination directories can both be in a local file system, or both be in an
Automatic Storage Management (ASM) disk group, or between local file system and ASM with
copying in either direction.
You can copy any type of file to and from a local file system. However, you can copy only
database files (such as datafiles, tempfiles, controlfiles, and so on) to and from an ASM disk
group.
GET_FILE Procedure
This procedure contacts a remote database to read a remote file and then creates a copy of the
file in the local file system or ASM. The file that is copied is the source file, and the new file that
results from the copy is the destination file. The destination file is not closed until the procedure
completes successfully.
Examples
CREATE OR REPLACE DIRECTORY df AS ‘+datafile’ ;
GRANT WRITE ON DIRECTORY df TO “user”;
CREATE DIRECTORY DSK_FILES AS ”^t_work^”;
GRANT WRITE ON DIRECTORY dsk_files TO “user”;
— asumes that dbs2 link has been created and we are connected to the instance.
— dbs2 could be a loopback or point to another instance.
BEGIN
— asm file to an os file
— get an asm file from dbs1.asm/a1 to dbs2.^t_work^/oa5.dat
DBMS_FILE_TRANSFER.GET_FILE ( ‘df’ , ‘a1’ , ‘dbs1’, ‘dsk_files’ , ‘oa5.dat’ );
— os file to an os file
— get an os file from dbs1.^t_work^/a2.dat to dbs2.^t_work^/a2back.dat
DBMS_FILE_TRANSFER.GET_FILE ( ‘dsk_files’ , ‘a2.dat’ , ‘dbs1’, ‘dsk_files’ , ‘a2back.dat’ );
END ;
/
Oracle Database PL/SQL Packages and Types Reference
11g Release 2 (11.2)
ASMCMD
cp
Purpose
Enables you to copy files between Oracle ASM disk groups and between a disk group and the
operating system.
You can use the cp command to:Copy files from a disk group to the operating system
Copy files from a disk group to a disk group
Copy files from the operating system to a disk group
rm
Purpose
Deletes the specified Oracle ASM files and directories.
Oracle Automatic Storage Management Administrator’s Guide
11g Release 2 (11.2)
A is wrong. can copy to OS file system
B is wrong. can copy from remote ASM to local ASM
C is wrong. there is no alter diskgroup move
D is right.
E is right. asmcmd rm does not delete files in OS file system
So D.E. are correct