Switch datafile datafilespec to copy ; what this does ?

1) SWITCH DATAFILE datafileSpec;
2) SWITCH DATAFILE datafileSpec TO COPY;
^^
I cant understand the difference in the above 2 commands teIs there a difference in the above 2 commands.
The description in DOC is :
DATAFILE datafileSpec TO COPY :      Specifies the datafile that you wish to rename. As with DATABASE TO COPY, specifies to switch this datafile to the latest image copy.
When would the 2nd option be preferred over the 1st ?

The basic difference is that switch datafile datafileSpec can not be run outsize a run block whereas "SWITCH DATAFILE datafileSpec TO COPY";
perfectly does. More over "SWITCH DATAFILE datafileSpec" can not be use barely.
consolidaterac1@oracle $ rman target /
Recovery Manager: Release 11.1.0.6.0 - Production on Mon May 18 09:03:27 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: X4540 (DBID=1568043037)
RMAN> copy datafile 1 to '+DATA';
Starting backup at 18-MAY-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=292 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/x4540/datafile/system.256.685477569
output file name=+DATA/x4540/datafile/system.370.687171837 tag=TAG20090518T090350 RECID=392 STAMP=687171858
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
Finished backup at 18-MAY-09
RMAN> startup mount force;
Oracle instance started
database mounted
Total System Global Area 2058981376 bytes
Fixed Size 1300968 bytes
Variable Size 553649688 bytes
Database Buffers 1493172224 bytes
Redo Buffers 10858496 bytes
RMAN> switch datafile 1 to copy;
datafile 1 switched to datafile copy "+DATA/x4540/datafile/system.370.687171837"
RMAN> recover datafile 1 ;
Starting recover at 18-MAY-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=314 device type=DISK
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 18-MAY-09
RMAN> alter database open;
database opened
RMAN> copy datafile 1 to '+DATA';
Starting backup at 18-MAY-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=314 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/x4540/datafile/system.370.687171837
output file name=+DATA/x4540/datafile/system.369.687172089 tag=TAG20090518T090802 RECID=394 STAMP=687172107
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:26
Finished backup at 18-MAY-09
RMAN> startup mount force;
Oracle instance started
database mounted
Total System Global Area 2058981376 bytes
Fixed Size 1300968 bytes
Variable Size 553649688 bytes
Database Buffers 1493172224 bytes
Redo Buffers 10858496 bytes
RMAN> switch datafile 1;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "comma, to"
RMAN-01007: at line 1 column 18 file: standard input
RMAN> run{
2> switch datafile 1;
3> }
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of switch command at 05/18/2009 09:09:41
RMAN-06039: SET NEWNAME command has not been issued for datafile 1
RMAN> copy datafile 20 to '+DATA';
Starting backup at 18-MAY-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00020 name=+DATA/x4540/datafile/academy.327.685962083
output file name=+DATA/x4540/datafile/academy_bts.368.687172365 tag=TAG20090518T091237 RECID=396 STAMP=687172384
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
Finished backup at 18-MAY-09
RMAN> sql 'alter database datafile 20 offline';
sql statement: alter database datafile 20 offline
RMAN> run{
2> switch datafile 20 to datafilecopy '+DATA/x4540/datafile/academy_bts.368.687172365';
3> }
datafile 20 switched to datafile copy
input datafile copy RECID=396 STAMP=687172384 file name=+DATA/x4540/datafile/academy_bts.368.687172365
RMAN> recover datafile 20;
Starting recover at 18-MAY-09
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 18-MAY-09
RMAN> sql 'alter database datafile 20 online';
sql statement: alter database datafile 20 online
RMAN> copy datafile 20 to '+DATA';
Starting backup at 18-MAY-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00020 name=+DATA/x4540/datafile/academy_bts.368.687172365
output file name=+DATA/x4540/datafile/academy_bts.367.687172763 tag=TAG20090518T091915 RECID=398 STAMP=687172779
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
Finished backup at 18-MAY-09
RMAN> sql 'alter database datafile 20 offline';
sql statement: alter database datafile 20 offline
RMAN> run{
2> set newname for datafile 20 to '+DATA/x4540/datafile/academy_bts.367.687172763';
3> switch datafile 20;
4> }
executing command: SET NEWNAME
datafile 20 switched to datafile copy
input datafile copy RECID=398 STAMP=687172779 file name=+DATA/x4540/datafile/academy_bts.367.687172763
RMAN> recover datafile 20;
Starting recover at 18-MAY-09
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 18-MAY-09
RMAN> sql 'alter database datafile 20 online';
sql statement: alter database datafile 20 online
For more refer to
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta061.htm "Restrictions and Usage Notes" section.
Regards,
HS

Similar Messages

  • Anyone know what this does ?

    Hi, been checking around but have not found a similar query.... if you lightly swipe horizontally across the home key without pressing it, the apps icons all move to the bottom of the screen leaving the top of the screen with only the wallpaper... or have I missed something very obvious.. iphone 6+
    TH

    It's called reachability - it is intended to allow 1 handed use by shifting the icons at the top of the screen down so you can reach them easier. 

  • User has a "startup on login" pref that opens a file named "apple-scc-20111227-074257".  Can't find any reference to this....any idea on what this startup file does or if it can be safely removed as a login-startup item?  thanks.

    Friend has a laptop running OSX 10.6.8, with latest software update 22Jun2012.  One of the User's items to startup on Login is a file titled "
    apple-scc-20111227-074257"
    No idea what this does or where it is located.....any ideas on what it starts up and if it can be safely removed from startup items?  Thanks for any info.

    If you mouse over the item in your Login Items you should see a tool tip indicating where it is.  Alternatively right (control) click on it and a contextual menu item, Reveal in Finder will be shown which you can select to open the folder containing the item.
    By the way the 20111227 portion of that name looks like a date -- 12/27/2011.
    I'm  sure you can delete it.  Nothing major is going to happen.  But you really should find out where it is.
    If Reveal in Finder doesn't show anything it may be because the file is invisible (which might be considered somewhat suspicious).  In that case use the finder find command (command-f) and look for kind filename plus invisible.  Or just use Find any File to find it.

  • What exactly does the following do?

    i understand what this does.
    return(password);
    but what exactly does this do?
    return (password == null ? "" : password);

    got it thanks.
    is the reason for this to prevent the javabean getter
    from sending a null to a jsp file?
    for example, if the setter is not called before the
    getter, the value is null and the jsp won't like
    this.
    could you also initialize the properties of the bean
    to ""?That sounds like a reasonable explanation. Depending on the implementation, initializing to "" might work fine or it might have unintended consequences if there's anywhere that a null and an empty string are interpreted differently.

  • My hard drive crashed on my MacBook Pro crashed and I need to get my CS5 up and running on the new hard drive. I copied what I could onto an external hard drive but when I drag and drop I get directions to uninstall but the uninstall folder I have does sa

    my hard drive crashed on my MacBook Pro crashed and I need to get my CS5 up and running on the new hard drive. I copied what I could onto an external hard drive but when I drag and drop I get directions to uninstall but the uninstall folder I have does says it is an alias that is no longer present. I get error 6. I would like to get my software up and running on the laptop again please

    If you subscribed to iTunes match the songs are kept in icloud. If you didn't but you did save the actual iTunes library folder which should include the music, video, etc.  you should be able to just drag this file back to your machine in the same place and when you open iTunes it will give you a chance to identify the iTunes library folder. 
    You can test this to find out if you saved the media files or not and don't need to attach your nano to do it. 
    You are correct that once you connect the nano it will clear the existing files from it and sync it with the new iTunes library. 
    If you don't have the media files i'm not sure if/how to get them back on a windows ipod.  I have everything backed up regularly because of the horror stories I have seen & heard.

  • I'm trying to transfer music from iTunes on an old PC that uses an external storage device to a new PC (Windows 7) that will use that same external storage device.  I am also dealing with new iTunes 11.  How do I do this??  What folder does iTunes use?

    I'm trying to transfer music from iTunes on an old PC (Windows Vista Home Basic) that uses an external storage device to store the files to a new PC (Windows 7 Starter) that will use that same external storage device.  I am also dealing with the new iTunes 11.  How can I accomplish this successfully?    What folder does iTunes use to store the data in?  I've tried several things.  Home Sharing caused duplicates but not all songs or apps transfered.  It is a large library! I've tried just setting the path in the Advanced Tab of iTunes preferences of the new computer with the external drive connected the same as the path when the external drive is connected to the old computer.  This was the best solution so far but still a few artists missing and some apps. Any suggestions?

    Here are typical layouts for the iTunes folders:
    With iTunes 11 you might also have a Home Videos folder inside iTunes Media.
    In the simplest cases you copy the entire iTunes folder from <User's Music> on the source computer to <User's Music> on the target machine, install iTunes, and it "just works"TM.
    If the media folder (inside the red outline) has been split out to a separate location then you can copy the library folder (outside the red outline) as before and connect the drive holding the media so that it has exactly the same path as before. If the drive appears as D: on one system and E: on the other then the library won't be able to find the media.
    The crucial file is iTunes Library.itl - this contains a record of the tracks that have been added to the library, ratings, play counts, playlists etc.
    See also: Make a split library portable.
    tt2

  • What exactly does the global switch command line do ?

    Hello All
    Just foraging in the dark world of APP-V. I have a question which I cannot find answer for through google.
    There are powershell commands to publish an APP-V application globally. What exactly does the global switch do ?
    I understand it makes the application available to everyone on the machine for anyone who logs onto that machine.
    However in the absence of this global switch the application is still available to all users who logon to that particular machine. So what exactly is the reason for using the global switch ?
    Thanks

    Correct, the global switch makes the application accessable for all users logging on to that system.
    This feature is required for some packages, like Office. But it is ofter used for applications used by everyone, like Adobe Reader.
    However in the absence of this global switch the application is still available to all users who logon to that particular machine. So what exactly is the reason for using the global switch ?
    A package can be added to the system but until it is published a user cannot start it. They won't see any shortcuts in their startmenu/desktop/etc.
    So after you added the package to the system, it must be published to a user or globally (every user) to start it.

  • Consolidate Masters - what exactly does this do?

    Hi all
    I am a relativity new aperture user. every time i import images from my camera, they have the little arrow in the bottom corner to show they are referenced files.
    I can fix this by clicking file>consolidate masters and choose to move or copy them.
    Forgive the basic-ness of this question, but what exactly does this do? And why can't i import them so they are not referenced files?
    thanks again for your help

    I suggest you read the manual for this sort of questions, but anyway, here's a quick answer:
    -consolidate masters moves or copies your images to somewhere withing your library, making them managed instead of referenced.
    -the import dialog, when you connect a card has the option to copy the files to anywhere on your disk, to pictures or to the library (making them managed, and thus not showing the little arrow).
    For the advantages and disadvantages of either, check this forum or again, the manual.
    j

  • I can't get my project to share. A pop up screen comes up saying, "This item can't be shared while it is still referencing media on the camera". Does anyone know what this means.

    I can't get my project to share. A pop up screen comes up saying, "This item can't be shared while it is still referencing media on the camera". Does anyone know what this means. I'm confused because I don't have a camera hooked up to my computer.

    may you have directly imported clip to timeline without copying it to local drive..
    update project for links and check if missing clips are there..
    reconnect it if you have it on local drive..

  • Switch datafile to datafile copy

    Hello,
    SWITCH DATAFILE '?/dbs/tbs_1.f' TO DATAFILECOPY '?/dbs/copies/cp1.f'
    it's the line from RMAN reference docs.
    But when I try to use this command RMAN tells me about error and says, it expected "to copy"...
    Any clue?
    Thanks in advance,
    Aliq

    It has to be run inside a run { }:
    RMAN> switch datafile 6 to datafilecopy '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_demox_4kppwmyt_.dbf';
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00558: error encountered while parsing input commands
    RMAN-01009: syntax error: found "datafilecopy": expecting one of: "copy"
    RMAN-01007: at line 1 column 22 file: standard input
    RMAN> run {
    2> switch datafile 6 to datafilecopy
    3> '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_demox_4kppwmyt_.dbf';
    4> }
    datafile 6 switched to datafile copy
    input datafile copy RECID=5 STAMP=670614636 file name=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_demox_4kppwmyt_.dbfHTH
    Enrique
    PS. If your problem was solved, consider marking the question as answered.

  • Can anyone tell me what this is doing

    hey this is part of some parser code from an earlier java forum post
    http://forum.java.sun.com/thread.jspa?threadID=506162&messageID=2399163#239 9163
    i modified the code slightly to work with my program which involves its use in an applet and to solve logical equations. However i'm still uncertain as to what certain sections of the code are doing
    i know that this code evaluates the variables within the given equation, begins a for loop that does not exit until i = codeSize which is the length of the given String. However i'm not so certain as to how it achieves this. I'd like to know
    private int eval(int variableX, int variableY, int variableZ)
                    try {
                            int top = 0;
                            for (int i = 0; i < codeSize; i++)
                                    if (code[i] >= 0)
                                            stack[top++] = constants[code];
    else if (code[i] >= POWER)
    int y = stack[--top];
    int x = stack[--top];
    int ans = (int)Double.NaN;
    switch (code[i])
    case PLUS: ans = x | y; break;
    case MINUS: ans = x & y; break;
    case TIMES: ans = x & y; break;
    case DIVIDE: ans = x / y; break;
    // case POWER: ans = Math.pow(x,y); break;
    if (Double.isNaN(ans))
    return ans;
    stack[top++] = ans;
    else if (code[i] == VARIABLEX)
    stack[top++] = variableX;
    else if (code[i] == VARIABLEY)
    stack[top++] = variableY;
    else if(code[i] == VARIABLEZ)
    stack[top++] = variableZ;
    /* else {
    double x = stack[--top];
    double ans = Double.NaN;
    int d;
    d = (int) ans;
    switch (code[i])
    case SIN: ans = Math.sin(x); break;
    case COS: ans = Math.cos(x); break;
    case TAN: ans = Math.tan(x); break;
    case COT: ans = Math.cos(x)/Math.sin(x); break;
    case SEC: ans = 1.0/Math.cos(x); break;
    case CSC: ans = 1.0/Math.sin(x); break;
    case ARCSIN: if (Math.abs(x) <= 1.0) ans = Math.asin(x); break;
    case ARCCOS: if (Math.abs(x) <= 1.0) ans = Math.acos(x); break;
    case ARCTAN: ans = Math.atan(x); break;
    case EXP: ans = Math.exp(x); break;
    case LN: if (x > 0.0) ans = Math.log(x); break;
    case LOG2: if (x > 0.0) ans = Math.log(x)/Math.log(2); break;
    case LOG10: if (x > 0.0) ans = Math.log(x)/Math.log(10); break;
    case ABS: ans = Math.abs(x); break;
    case SQRT: if (x >= 0.0) ans = Math.sqrt(x); break;
    case UNARYMINUS: ans = -x; break;
    if (Double.isNaN(ans))
    return d;
    stack[top++] = d;
    catch (Exception e)
    double b = Double.NaN;
    int i = (int)b;
    return i;
    } double d2;
    if (Double.isInfinite(stack[0]))
    d2 = Double.NaN;
    int i2 = (int) d2;
    return i2;
    }else
    return stack[0];
    any help much appreciated
    cheers
    podger

    Well this is a very basic interpreter. What this piece of code does is:
    1) take an opcode from the code array, and retrieves the description for it from the constants array. This description is stored in the stack array.
    stack[top++] = constants[code];
    2) check what opcode it is
    switch (code)
    3) "execute" the opcode with simple java math operators.
    case PLUS:    ans = x | y;  break;
    case MINUS:   ans = x & y;  break;
    case TIMES:   ans = x & y;  break;
    case DIVIDE:  ans = x / y;  break;4) store the result of the opcode in the stack array, after the description of the opcode retrieved in step 1)
    stack[top++] = ans;There is also some sort of error check in there: initially the result of the opcode is "NaN", (not a number). If the opcode passed to this code is not known, the result is not added to the stack according to this piece of code:
    if (Double.isNaN(ans))
    return ans;

  • There is a pad lock symbol in the upper right corner of my screen. does anyone know what this means? it has a circle around it...

    There is a pad lock symbol in the upper right corner of my screen. does anyone know what this means? it has a circle around it...

    abigailfromwaddell wrote:
    There is a pad lock symbol in the upper right corner of my screen. does anyone know what this means? it has a circle around it...
    You have activated rotation lock. Check the little switch near the volume control.
    Stedman

  • In my macbook pro sees in the screen very wide a vertical black bar and it does not let see what this underneath that bar

    in my macbook pro sees in the screen very wide a vertical black bar and it does not let see what this underneath that bar

    Take it in for service. Your screen probably needs to be replaced.

  • Want to open Kodak Photo CD files (.PCD) in Photoshop CS5.  In CS4 i copied file "Photo CD.8BI"  from an older version into the File Format folder.  This does not work with CS5.  Any fix?

    I have several old Kodak Photo CD with PCD image files.  I am now using Photoshop CS5.  Some years ago while using Photoshop CS4 I copied a file:  "Photo CD.8BI" from an older, CS2, version to the Plug-ins/File Format folder of CS4.  This does not appear to work with CS5.  Any fix?

    It can be made to work, but you have to run the 32 bit version of Photoshop CS5, and as I recall there's an additional DLL called pcdlib32.dll that's needed from the old installation.
    See also:  Open Kodak PhotoCD files in PS CS5 - is it possible? (Win XP)
    -Noel

  • My safari keeps closing unexpectedly and when it does it tells me that it quite while using the .GameHouseBeachParty.so plugin. I have no idea what this means! Can someone please help me fix this?

    My safari keeps closing unexpectedly and when it does it tells me that it quite while using the .GameHouseBeachParty.so plugin. I have no idea what this means! Can someone please help me fix this?

    You have the Flashback trojan.
    Check out the replies in this thread for what to do;
    https://discussions.apple.com/message/18114958#18114958

Maybe you are looking for

  • Importing Safari bookmark folder to Leopard

    Hi, i just got a new mpb, and i used to use Tiger on my old one. I am trying to import my bookmark file which was located in Library in the OS to the new Leopard location: Library>Caches>Metadata>Safari. I copy and pasted from Tiger to Leopard, but t

  • In F110 the payment document is calculating discount even after the

    Hi,     I am executing F110 and in the proposal list the documents are calculating discount although the payment date is much beyond the discount allowable period. For example - We are having a payment term which says if payment is made withing 14 da

  • Generate RMAN backup Script using unix shell script

    Hello, Could somebody give me a unix shell script that would generate RMAN script based on some user defined parameters in a config file. e.g. rman.conf CHANNELS=4 USE_CATALOG=Y DEVICE='sbt_tabe' etc., many thanks, kam

  • Error during calling PL/SQL procedure

    Hi, Error occurs while calling the oracle PL/SQL procedure from Java using Callable Statement. Below is my code cs = conn.prepareCall("{call prc_ins(?, ?, ?, ?, ?, ?,?)}");                              cs.setString(1, strAryCols[11]);      cs.setStri

  • Timemachine index error messages

    I have read @Pondinis website in regards to index error messages at http://pondini.org/TM/D2.html This is for my understanding only.  What is the difference between: Waiting for index to be ready (101) and Waiting for index to be ready (100) I know h