I prepared below steps one by one how can rename the datafiles in ASM database with RAC environment. Below are the steps is implemented in production environment.
\*-------OLD FILES LOCATION--------*/
+PRODDATA2/prod/datafiles/a_media220.dbf => +PRODDATA2/prod/DATAFILE/APPS_TS_MEDIA.271.909047637
\*-------FILES LOCATIONS WITH NEW NAMES ------*/
+PRODDATA2/prod/datafiles/a_media231.dbf
\*---------ACTION PLAN------------*/
1. SQL>Alter database datafile '+PRODDATA2/prod/datafiles/a_media220.dbf' offline;
2. RMAN>copy datafile '+PRODDATA2/prod/datafiles/a_media220.dbf' to '+PRODDATA2/prod/datafiles/a_media231.dbf';
Go to asmcmd and verify the datafile
3. SQL>Alter Database rename file '+PRODDATA2/prod/datafiles/a_media220.dbf' to '+PRODDATA2/prod/datafiles/a_media231.dbf';
4. RMAN>switch Datafile '+PRODDATA2/prod/datafiles/a_media231.dbf' to copy;
5. SQL>recover datafile '+PRODDATA2/prod/datafiles/a_media231.dbf';
6. SQL>Alter database datafile '+PRODDATA2/prod/datafiles/a_media231.dbf' online;
7. SQL>select * from dba_data_files where file_name='+PRODDATA2/prod/datafiles/a_media231.dbf';
*********************************************************************************
Note: Make sure the OLD file name before removing.
7. Remove OLD file from +PRODDATA2 Group.
Connect with Grid user in ASM to perform below activity.
ASMCMD> ls -l -----> Check the file which exits in ASM
ASMCMD> pwd
+PRODDATA2/prod/datafiles
ASMCMD> rm a_media220.dbf /*.... Remove OLD datafiles...*/
ASMCMD> ls
8. Bounced the RAC Database if it required.
$srvctl stop database -d PROD
*********************************************************************************
\*-------OLD FILES LOCATION--------*/
+PRODDATA2/prod/datafiles/a_media220.dbf => +PRODDATA2/prod/DATAFILE/APPS_TS_MEDIA.271.909047637
\*-------FILES LOCATIONS WITH NEW NAMES ------*/
+PRODDATA2/prod/datafiles/a_media231.dbf
\*---------ACTION PLAN------------*/
1. SQL>Alter database datafile '+PRODDATA2/prod/datafiles/a_media220.dbf' offline;
2. RMAN>copy datafile '+PRODDATA2/prod/datafiles/a_media220.dbf' to '+PRODDATA2/prod/datafiles/a_media231.dbf';
Go to asmcmd and verify the datafile
3. SQL>Alter Database rename file '+PRODDATA2/prod/datafiles/a_media220.dbf' to '+PRODDATA2/prod/datafiles/a_media231.dbf';
4. RMAN>switch Datafile '+PRODDATA2/prod/datafiles/a_media231.dbf' to copy;
5. SQL>recover datafile '+PRODDATA2/prod/datafiles/a_media231.dbf';
6. SQL>Alter database datafile '+PRODDATA2/prod/datafiles/a_media231.dbf' online;
7. SQL>select * from dba_data_files where file_name='+PRODDATA2/prod/datafiles/a_media231.dbf';
*********************************************************************************
Note: Make sure the OLD file name before removing.
7. Remove OLD file from +PRODDATA2 Group.
Connect with Grid user in ASM to perform below activity.
ASMCMD> ls -l -----> Check the file which exits in ASM
ASMCMD> pwd
+PRODDATA2/prod/datafiles
ASMCMD> rm a_media220.dbf /*.... Remove OLD datafiles...*/
ASMCMD> ls
8. Bounced the RAC Database if it required.
$srvctl stop database -d PROD
*********************************************************************************
No comments:
Post a Comment