Applies To:
Oracle database-enterprise edition-version 10.2.0.1 and later
Information in this document applies to any platform.
Symptoms
User add datafile for RAC DataBase in the local node
Sql> alter tablespace system add datafile ' FRA ' SIZE 250M autoextend on NEXT 50M MAXSIZE Unlimited;
Then when he query Dba_data_files
Ora-01157:cannot identify/lock data file 66-see DBWR trace file
Ora-01110:data file: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/fra '
CHANGES
Datafiles add to System tablespace by mistake in the local Node instead of shared diskgroup
Cause
This is expected as it's RAC DB and it suppose to create the new datafile on the shared disk No on the local node
When the user add data file using sql> alter TABLESPACE system add datafile ' FRA ' SIZE 250M autoextend on NEXT 50M MAXSIZE Unlimited;
Its add the datafile in the default OMG location db_create_file_dest
Sql> Show Parameter Db_create_file_dest
NAME TYPE VALUE
This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/
------------------------------------ ----------- ------------------------------
Db_create_file_dest string
And when it is Null the default locaion $OH/dbs
SOLUTION
-Open The DB in Mount state
-Copy the created datafile to the shared Disk Group
Please note that the DB must is in the archive mode.
rman> copy datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/fra ' to ' +fra ';
Starting backup at 06-jan-14
Using target database control file instead of recovery catalog
Allocated Channel:ora_disk_1
Channel ora_disk_1:sid=8 INSTANCE=TESTDB12 Device Type=disk
Channel ora_disk_1:starting datafile Copy
Input datafile file number=00066 Name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/fra
Output file name=+fra/testdb1/datafile/system.284.836141149 tag=tag20140106t132548 recid=1 STAMP=836141162
Channel ora_disk_1:datafile copy complete, elapsed time:00:00:15
Finished backup at 06-jan-14
-Using SQL PLUS Rename the datafile to the New location
Sql>alter database Rename file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/fra ' to ' +fra/testdb1/datafile/ System.284.836141149 ';
-Open the DB
Sql> alter DATABSE Open;
-Remove the old file
$ rm/u01/app/oracle/product/11.2.0/dbhome_1/dbs/fra