System environment:
CentOS Release 6.7 (Final)
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit
Operation Process:
1. When you add a data file or create a tablespace, you specify the path as a single-node local
Sql> alter tablespace users add datafile '/home/oracle/test.dbf ' size 4m;
Tablespace altered.
Sql>
Set Line 180
Col file_name for A60
Col Tablespace_name for A15
Select File_name,file_id,online_status,tablespace_name from Dba_data_files;
file_namefile_id Online_ Tablespace_name
------------------------------------------------------------ ---------- ------- ---------------
+data/devdb/datafile/users.259.936769201 4 Onlineusers
+data/devdb/datafile/undotbs1.258.936769201 3 ONLINEUNDOTBS1
+data/devdb/datafile/sysaux.257.936769199 2 Onlinesysaux
+data/devdb/datafile/system.256.936769199 1 Systemsystem
+data/devdb/datafile/example.265.936769441 5 Onlineexample
/HOME/ORACLE/TEST.DBF 6 Onlineusers
6 rows selected.
2. Clean off RAC2,RAC1
Srvctl Stop database-d XXX
3. Launch the RAC1 mount status
sql> startup Mount;
4. Copy the data file via the Rman CP command
Node1-> Rman Target/
Connected to target Database:devdb (dbid=841499351, not open)
rman> copy datafile '/home/oracle/test.dbf ' to ' +data ';
Starting backup at 2017/09/17 02:13:03
Using target database control file instead of recovery catalog
Allocated Channel:ora_disk_1
Channel ora_disk_1:sid=36 INSTANCE=DEVDB1 Device Type=disk
Channel ora_disk_1:starting datafile Copy
Input datafile file number=00006 name=/home/oracle/test.dbf
Output file name=+data/devdb/datafile/users.273.954900787 tag=tag20170917t021305 recid=3 stamp=954900786
Channel ora_disk_1:datafile copy complete, elapsed time:00:00:01
Finished backup at 2017/09/17 02:13:07
Starting Control File and SPFILE autobackup at 2017/09/17 02:13:07
Piece handle=+flash/devdb/autobackup/2017_09_17/s_954900552.304.954900789 Comment=none
Finished Control File and SPFILE autobackup at 2017/09/17 02:13:10
5. Find the ASM file name for the/HOME/ORACLE/TEST.DBF mapping in ASM
Asmcmd> CD Data/devdb/datafile
asmcmd> pwd
+data/devdb/datafile
Asmcmd> Ls-lt user*
Type redund striped Time Sys Name
datafile Unprot Coarse SEP 03:00:00 Y users.273.954900787
datafile Unprot Coarse SEP 03:00:00 Y users.259.936769201
Description: The/home/oracle/test.dbf corresponds to the USERS table space, so this is user*
6. Boot database to mount state in Sqlplus, rename data file
sql> ALTER DATABASE rename file '/home/oracle/test.dbf ' to ' +data/devdb/datafile/users.273.954900787 ';
7. Start the RAC1,RAC2
#RAC1
sql> ALTER DATABASE open;
Database altered.
Sql>
#RAC2
Sql> startup;
Attached: System Data File Migration step (process description):
1. Stop DB.
2. Move the datafile using Asmcmd.
3. Mount the DB.
4. Rename the datafile.
5. Open the DB.
6. On all RAC nodes still need to bounce the database because it's SYSTEM tablespace, otherwise you'll keep getti Ng errors ORA-01516 or original error ora-01157:cannot identify/lock data file.
Oracle's RAC local data files migrated to ASM