STEP BY STEP RENAME DATAFILE

 

Suppose to rename datafileDATA201009.dbftodatafileDATA201009_02.dbf

Step 1: Check path of datafile on tablespace

In the command below, we can detect the datafile with the same name but different paths, which determine what should rename datafile, avoid mistakes

SELECT file_name, tablespace_name

FROM dba_data_files

WHERE FILE_NAME like ‘%DATA201009.dbf%’;

Step 2 :Offline tablespacecontaining thehave datafile which rename

altertablespace“DATA201009” offline immediate;

Step 3 : Login operating system by user oracle or administrator to copy datafile to new location.

–         Use parameter -i in commandcp to datafile in path2 not overwrite

–         You should check path2 before execute.

cp-i path1/DATA201009.dbf path2/DATA201009_02.dbf

Step 4 : Rename datafile.

altertablespaceDATA201009 rename datafile‘/u02/oradata/DATA201009.dbf’ to ‘/u02/oradata/DATA201009_02.dbf’

Step 5 :Online tablespace.

alter tablespace“DATA201009” online ;

Step 6 :Check all datafile again in tablespace have tablespace name.

SELECT file_name, tablespace_name

FROM dba_data_files

WHERE file_nameLIKE ‘%DATA201009.dbf%’;

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s