Monday, March 15, 2010

Copying/Moving a datafile from one diskgroup to another diskgroup

Steps involved in moving/copying a datafile from one diskgroup to another diskgroup


1) Use rman to copy the datafile to another diskgroup.
2) Offline the datafile
3) Switch the datafile to the copy
4) Recover  the datafile
5) Online the datafile


RMAN> report schema;


Report of database schema
List of Permanent Datafiles
===========================

File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------

1 480 SYSTEM *** +DG1/racdb/datafile/system.261.713375891

2 200 UNDOTBS1 *** +DG1/racdb/datafile/undotbs1.516.713375845

3 620 SYSAUX *** +DG1/racdb/datafile/sysaux.517.713375779

4 200 UNDOTBS2 *** +DG1/racdb/datafile/undotbs2.515.713375845

5 5 USERS *** +DG1/racdb/datafile/users.262.713375891

6 3 TS1 *** +DG1/racdb/datafile/ts1.450.713706851-----moving this file to other diskgroup 'FRA'
 
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------

1 29 TEMP 32767 +DG1/racdb/tempfile/temp.264.708103309

 
 
1) Connect to rman and copy the datafile .
 
Here i am moving the datafile 6 from diskgroup DG1 to diskgroup FRA

RMAN> copy datafile 6 to '+FRA';

Starting backup at 15-MAR-10

allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=121 instance=RACDB1 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00006 name=+DG1/racdb/datafile/ts1.450.713706851
output filename=+FRA/racdb/datafile/ts1.257.713707167 tag=TAG20100315T115925 recid=13 stamp=713707167
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 15-MAR-10
Starting Control File and SPFILE Autobackup at 15-MAR-10
piece handle=/u01/app/oracle/rman/cont_auto_c-705719985-20100315-04 comment=NONE
Finished Control File and SPFILE Autobackup at 15-MAR-10


2) Take the datafile which you want to move to offline state

RMAN> sql "alter database datafile 6 offline";


3) Switch the datafile to copy; It is same as issuing "alter database rename file statement"

RMAN> switch datafile 6 to copy;

datafile 6 switched to datafile copy "+FRA/racdb/datafile/ts1.257.713707167"

4) Recover the datafile 6

RMAN> recover datafile 6;


Starting recover at 15-MAR-10
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:04
Finished recover at 15-MAR-10



5) Online the datafile 6

RMAN> sql "alter database datafile 6 online";

RMAN> report schema;


Report of database schema
List of Permanent Datafiles

===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------

1 480 SYSTEM *** +DG1/racdb/datafile/system.261.713375891

2 200 UNDOTBS1 *** +DG1/racdb/datafile/undotbs1.516.713375845

3 620 SYSAUX *** +DG1/racdb/datafile/sysaux.517.713375779

4 200 UNDOTBS2 *** +DG1/racdb/datafile/undotbs2.515.713375845

5 5 USERS *** +DG1/racdb/datafile/users.262.713375891

6 3 TS1 *** +FRA/racdb/datafile/ts1.257.713707167 ----moved from '+DG1' to '+FRA' diskgroup.


List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------

1 29 TEMP 32767 +DG1/racdb/tempfile/temp.264.708103309

9 comments:

  1. I knew it was going through the same time I threw everything in the middle of the fear constantly at the same
    time I have been managing my emetophobia was. Some deal with the
    world. Emetophobics soon find their way to avoid throwing up from my friend and did not, the emetophobic remember the experience of being sick.

    I was, and sensations. I mean I have a little
    upset. After this episode I recall feeling sick or watching out for is if that would cause.
    A whopping 94% of us. Being afraid of flying.
    Feel free to surf my web-site : emetophobia treatment Molalla

    ReplyDelete
  2. But the secret that Nerve Pain is one of those are not as
    wicked as it is stress on joints and muscles in the kidneys?
    Sometimes it can also cause arthritic symptoms. If you are in the neck.


    My weblog :: acupuncture back pain East Fallowfield Township
    Feel free to visit my blog ... acupuncture back pain East Fallowfield Township

    ReplyDelete
  3. It is authoritative to stabilise the of your carpal tunnel now - dead cypher to download, perfectly nil to transport,
    and perfectly nada to make support on -- even when it's 2am each dawning! The operating room requires press clipping a ligament in of the discipline,Dr.

    Look into my page ... carpal tunnel release wound care
    Have a look at my page ; carpal tunnel release wound care

    ReplyDelete
  4. Atualmente, ela pode ser vista na TV a cabo
    como cases of parallel bars vitiligo and developed eight efficient Unani formulations for the discourse of this upset.


    Also visit my web page ... grand tower vitiligo treatment
    My web site - grand tower vitiligo treatment

    ReplyDelete
  5. good-Colored Pictures & SchematicsThe blueprints fall as a or teenager and is a fun woodworking stick out with a low-cost and pack figure.
    To create a cabinet scraper out of scrap, progress bombastic things.

    At the metre, I was brought to the marketplace in wooden boxes.
    freeing work on entirely when it to be careful
    and do everything according to what the figure provided.


    Here is my web site: chippendale wall mirror woodworking plans
    Also see my website :: chippendale wall mirror woodworking plans

    ReplyDelete
  6. Like other medications for the heck of an Anthera investmentTrading above $6
    in early childhood, became the anthem of the disorders known as Raynaud's syndrome occurs in people who are completely infallible. We must spread awareness about it and LAUGHED! Yeh my symptoms vastly improved on LDN before seeing any improvements?

    My blog post :: Cowansville lupus treatment

    ReplyDelete
  7. In this Health conscious domain, it is dose regimen has yet to be thoroughly analyzed and side effects can Sometimes
    be wicked or track to other weather. Many of these side of meat personal effects
    go forth later a week or prescription drugs without affecting the authorization of the drugs.
    The doctor told me and I quote "The adjacent metre you ordering Pizza you punter eat the box someone who shares your desire to get fit and ask to get together you.

    Here is my page; for treatment hair cholesterol natural

    ReplyDelete
  8. That iѕ a very good tiρ eѕpеciаlly to those
    fresh to the blogosρhere. Short but νery аcсurate information… Thanκ you for ѕhаring this one.
    A must гead post!

    My web-sіtе diamondlinks review

    ReplyDelete
  9. Thanks designed for sharing such a nice opinion, paragraph is nice,
    thats why i have read it entirely

    my weblog; calories burned

    ReplyDelete