Migrate data files between ASM disk groups

Source: Internet
Author: User
In archive mode, you may need to migrate some data from one disk group to another. In this case, we can use the command ldquo; BACKUPASCOPYrdquo;

In archive mode, you may need to migrate some data from one disk group to another. In this case, we can use the command ldquo; backup as COPYrdquo;

In archive mode, you may need to migrate some data from one disk group to another. In this case, we can use the "backup as copy" command to move the data file to the new disk group. Then, run the "set newname" and "SWITCH" commands to change the file name of the data file in the control file.

Archivelog mode:

Migrate the DATA file "+ DATA/orcl/datafile/users.261.689589837" from the disk group DATA to USERDATA.

1. connect to the target database using RMAN

$ Rman

RMAN> connect target sys @ orcl

Target database Password: XXXXXXXXX

Connected to target database: ORCL (DBID = 1217369048)

2. View data files in the database

RMAN> report schema;

Report of database schema for database with db_unique_name ORCL

List of Permanent Datafiles

======================================

File Size (MB) Tablespace RB segs Datafile Name

---------------------------------------------------------

1 740 SYSTEM *** + DATA/orcl/datafile/system.258.689589737

2 570 SYSAUX *** + DATA/orcl/datafile/sysaux.259.689589785

3 55 UNDOTBS1 *** + DATA/orcl/datafile/undotbs1.260.689589831

4 5 USERS *** + DATA/orcl/datafile/users.261.689589837

List of Temporary Files

======================================

File Size (MB) Tablespace Maxsize (MB) Tempfile Name

---------------------------------------------------------

1 20 TEMP 32767 + DATA/orcl/tempfile/temp.262.689589851

3. Back up data to the new disk group USERDATA

RMAN> BACKUP AS COPY

DATAFILE "+ DATA/orcl/datafile/users.261.689589837"

FORMAT "+ USERDATA ";

You can also use the file number to specify the corresponding data file, for example:

BACKUP AS COPY

DATAFILE 4

FORMAT "+ USERDATA ";

4. OFFLINE

RMAN> SQL "ALTER DATABASE DATAFILE

''+ DATA/orcl/datafile/users.261.689589837'' OFFLINE ";

5. Modify the control file to direct the data file to the backup of the new disk group

RMAN> switch datafile "+ DATA/orcl/datafile/users.261.689589837" to copy;

6. Restore new data files

RMAN> recover datafile "+ USERDATA/orcl/datafile/users.256.689682663 ";

7. Upload the new data file online

RMAN> SQL "ALTER DATABASE DATAFILE

"+ USERDATA/orcl/datafile/users.256.689682663" ONLINE ";

8. Delete the old data file

RMAN> delete datafilecopy "+ DATA/orcl/datafile/users.261.689589837 ";

Recommended reading:

How to change the password of ASM sys

How to copy data files in ASM to the Operating System

Restoration After all Oracle 11g rac asm disks are lost

Oracle 11g from entry to proficient in PDF + CD source code

Installing Oracle 11g R2 using RHEL6 ASM

Oracle 10g manual creation of the ASM Database

Solutions to various problems after installing Oracle 11gR2 in Ubuntu 12.04 (amd64)

How to change the sys password of Oracle 10g ASM

,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.