Migrate ORACLE11G test data files to other disk groups

Source: Internet
Author: User

Migrate the ORACLE11G test data file to another disk group and log on to the oracle instance to migrate the data file in the users tablespace from the DATA1 disk group to the DATA2 disk group.

[Oracle @ IDM ~] $ Sqlplus/as sysdbaSQL * Plus: Release 11.2.0.3.0 Production on Thu Aug 22 08:19:24 2013 Copyright (c) 1982,201 1, Oracle. all rights reserved. connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit ProductionWith the Partitioning, Automatic Storage Management, OLAP, data Miningand Real Application Testing optionsSQL> SQL> set lines 200SQL> col FILE_NAME for a70SQL> select tablespace_name, file_name from dba_data_files; TABLESPACE_NAME FILE_NAME-------------------------------------------------------------------USERS + DATA1/alice/datafile/users + DATA1/alice/datafile/users + DATA1/alice/datafile/users + DATA1/alice/datafile/system.256.109111081example + DATA1/alice/datafile /example.265.20.111171 enable database archiving, SQL> archive log list; database log mode Archive ModeAutomatic archival EnabledArchive destination/u03/archive/aliceOldest online log sequence 4 Next log sequence to archive 6 Current log sequence 6 we want to migrate users tablespace data files to the DATA2 disk group, all data files that make users tablespaces offline. SQL> alter database datafile '+ DATA1/alice/datafile/users.259.20.111081' offline; Database altered. SQL> 8. use rman to migrate data files in the user tablespace to the DATA2 disk group, and update the control file [oracle @ IDM alice] $ rlwrap rman target/Recovery Manager: release 11.2.0.3.0-Production on Thu Aug 22 08:28:11 2013 Copyright (c) 1982,201 1, Oracle and/or its affiliates. all rights reserved. connected to target database: ALICE (DBID = 1806834031) RMAN> copy datafile '+ DATA1/alice/datafile/users.259.20.111081' to '+ DATA2 '; starting backup at 22-AUG-13using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID = 192 device type = DISKchannel ORA_DISK_1: starting datafile copyinput datafile file number = 00004 name = + DATA1/alice/datafile/users.259.109111081output file name = + DATA2/alice/datafile/users.256.109113711 tag = pairecid = 2 STAMP = 824113712 channel ORA_DISK_1: datafile copy complete, elapsed time: 00: 00: 01 Finished backup at 22-AUG-13RMAN> run {2> set newname for datafile '+ DATA1/alice/datafile/users.259.20.111081' to '+ DATA2/alice/datafile/users.256.116113711 '; 3> switch datafile all; 4 >}executing command: SET NEWNAMEdatafile 4 switched to datafile copyinput datafile copy RECID = 2 STAMP = 824113712 file name = + DATA2/alice/datafile/users.256.20.113711rman> 9. log on to the Oracle instance. The online data file [root @ rh2 rules. d] #/sbin/udevcontrol reload_rulesSQL> SELECT FILE_NAME FROM DBA_DATA_FILES; FILE_NAME alias + DATA2/alice/datafile/users.256.109113711 + DATA1/alice/datafile/example + DATA1/alice/datafile/example + DATA1/alice/datafile/system.256.109111081 + DATA1/alice/datafile /example.265.20.111171sql> recover datafile '+ DATA2/alice/datafile/users.256.109113711 '; media recovery complete. SQL> alter database datafile '+ DATA2/alice/datafile/users.256.20.113711' online 2; Database alteredSQL>

 


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.