issues in copy datafile from filesystem to ASM

All posts relating to Oracle database administration.

Moderator: Tim...

issues in copy datafile from filesystem to ASM

Postby sivakumarocp » Thu Oct 25, 2012 2:48 am

Hi Tim,

Inorder to move a datafile from filesystem to ASM which command we need to use in 10g & 11g ASM

either
copy datafile <file_id> to '<diskgroup_name>'; followed by switch datafile <file_id> to copy;
or
backup as copy datafile <file_id> format '<diskgroup_name>'; followed by switch datafile <file_id> to copy;

which one should i use on both 10g and 11g ASM.

what is the difference between above two commands.
Regards
Sivakumar.A
www.sivakumardba.com
sivakumarocp
Advisor
 
Posts: 256
Joined: Sat Jun 27, 2009 3:53 am
Location: India

Re: issues in copy datafile from filesystem to ASM

Postby Tim... » Thu Oct 25, 2012 10:03 am

Hi.

You should use BACKUP AS COPY because the straight COPY syntax was deprecated in 10g:

http://docs.oracle.com/cd/B28359_01/bac ... tm#i633623

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17933
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: issues in copy datafile from filesystem to ASM

Postby sivakumarocp » Thu Oct 25, 2012 10:10 am

you mean, inorder to restore files from filesystem to ASM using BACKUP AS COPY command is preferred right.

also would like to know when will use COPY command.
Regards
Sivakumar.A
www.sivakumardba.com
sivakumarocp
Advisor
 
Posts: 256
Joined: Sat Jun 27, 2009 3:53 am
Location: India

Re: issues in copy datafile from filesystem to ASM

Postby Tim... » Thu Oct 25, 2012 10:15 am

Hi.

You should never use the RMAN COPY command because it was deprecated in 10g, as I said before. It is an old syntax that Oracle don't want you to use. In a future version it will probably be removed completely. That is what deprecated means.

Imagine COPY never existed and you only copied files using BACKUP AS COPY... They do the same thing, but one is a deprecated syntax.

BACKUP AS COPY is nothing to do with a restore. It is a backup operation. You can use it to move files from ASM to a filesystem, or a filesystem to ASM as follows.

- Use BACKUP AS COPY to create a new copy of the file in the new location.
- SWITCH to use the new file.
- Recover the copy (if necessary).
- Get rid of the original file, unless you are keeping it as a backup.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17933
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK


Return to Oracle Database Administration

Who is online

Users browsing this forum: No registered users and 1 guest

cron