Move or change the name of the data file


If these changes are going to your systems primarily LIVE [ID 115424.1] numbered "How to Rename or Move Datafiles and Logfiles" Oracle support documentation will be useful to you.

Method 1 - Database open "datafile transport" (ONLINE)

First, connect to the database as sysdba

sqlplus / as sysdba


SQL> alter tablespace ANAR_INDX  offline;


cp ANAR_INDX2.dbf /export/t1505/oradata/ANTEST


SQL> alter tablespace ANAR_INDX  rename datafile '/export/t1502/oradata/ANTEST/ANAR_INDX2.dbf' to '/export/t1505/oradata/ANTEST/ANAR_INDX2.dbf';


SQL> alter tablespace ANAR_INDX  online;


Method 2 - The database data file is closed transport (ONLINE)

First, connect to the database as sysdba

sqlplus / as sysdba


I will close the database.

SQL> Shutdown immediate;


I'll open the database in mount mode.

SQL> alter database mount;


Then


cp ANAR_INDX2.dbf /export/t1505/oradata/ANTEST


SQL> alter database rename file '/export/t1502/oradata/ANTEST/ANAR_INDX2.dbf' to '/export/t1505/oradata/ANTEST/ANAR_INDX2.dbf';

Now I can open the database.

SQL> alter database open

Leave a Reply

Fill in your details below or click an icon to log in:

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

%d bloggers like this: