11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 9 ■ STORAGE MANAGEMENT 399sys@rac1.+ASM:+DATA/DBA<strong>11</strong>g1/datafile/xxxEnter password: *********source +DATA/DBA<strong>11</strong>g/DATAFILE/DOCS_D1.289.6319146<strong>11</strong>target +DATA/DBA<strong>11</strong>g1/datafile/xxxcopying file(s)...file, +DATA/dba<strong>11</strong>g1/datafile/xxx, copy committed.The syntax for the remote ASM diskgroup copy is as follows:cp [srcfile] username@..:The username can be any username in the ASM instance that has the sysasm privilege.Notice the dot (.) notation between the hostname and the ASM instance. The port assignmentis optional if the LISTENER is not listening on port 1521. The last delimiter is a colon (:) followedby the fully qualified directory or file name. Note that the target ASM instance must be registeredwith the LISTENER for the remote copy between ASM diskgroups to work.You can verify on the remote ASM instance that the copied file exists:ASMCMD> pwd+DATA/DBA<strong>11</strong>G1/DATAFILEASMCMD> ls -l xxxType Redund Striped Time Sys NameN xxx => +DATA/ASMTESTING/DATAFILE/TESTING.278.6326<strong>11</strong>175You will also notice that the xxx file is created as an alias, and the actual file resides in the+DATA/ASMTESTING/DATAFILE directory. Because we specified the fully qualified file name, OMFwill create an alias.Another important point to note is that the -f option does not work with aliases. In thefollowing example, we attempt to overwrite an existing alias, which results in an ORA-15005 error:ASMCMD [+DATA/DBA<strong>11</strong>g/DATAFILE] > cp –f+DATA/DBA<strong>11</strong>g/DATAFILE/DOCS_D1.289.6319146<strong>11</strong>sys@rac1.+ASM:+DATA/DBA<strong>11</strong>g1/datafile/docs_d1.dbfEnter password: *********errorsource +DATA/DBA<strong>11</strong>g/DATAFILE/DOCS_D1.289.6319146<strong>11</strong>target +DATA/DBA<strong>11</strong>g1/datafile/docs_d1.dbfASMCMD-08015: can not create file->'+DATA/DBA<strong>11</strong>g1/datafile/docs_d1.dbf'ORA-15056: additional error messageORA-17502: ksfdcre:4 Failed to create file +DATA/dba<strong>11</strong>g1/datafile/docs_d1.dbfORA-15005: name "dba<strong>11</strong>g1/datafile/docs_d1.dbf" is already used by an existing aliasORA-06512: at "SYS.X$DBMS_DISKGROUP", line 142ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute)ASMCMD-08016: copy source->'+DATA/DBA<strong>11</strong>g/DATAFILE/DOCS_D1.289.6319146<strong>11</strong>'and target->'+DATA/DBA<strong>11</strong>g1/datafile/docs_d1.dbf' failedContinuing with the cp examples, this is how to perform a datafile copy from one directoryto another directory on the local ASM instance:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!