Renaming datafile

Renaming datafile when the database is shut down


-- shut down database

SQL> shutdown immediate;

SQL> !mv "/gold/GLP/db/oradata/GOLDPROD/cenprod_data_03.dbf " /gold/GLP/db/oradata/GOLDPROD/cenproddata03.dbf

SQL> !mv /gold/GLP/db/oradata/GOLDPROD/cenprod_data_02.dbf  /gold/GLP/db/oradata/GOLDPROD/cenproddata02.dbf

SQL> !mv /gold/GLP/db/oradata/GOLDPROD/cenprod_idx_02.dbf /gold/GLP/db/oradata/GOLDPROD/cenprodidx02.dbf

SQL> startup mount;
ORACLE instance started.

Total System Global Area 8589934592 bytes
Fixed Size                  2110136 bytes
Variable Size            1006636360 bytes
Database Buffers         7566524416 bytes
Redo Buffers               14663680 bytes
Database mounted.
SQL> alter database rename file '/gold/GLP/db/oradata/GOLDPROD/cenprod_data_03.dbf ' to '/gold/GLP/db/oradata/GOLDPROD/cenproddata03.dbf';

Database altered.

SQL> alter database rename file '/gold/GLP/db/oradata/GOLDPROD/cenprod_data_02.dbf' to '/gold/GLP/db/oradata/GOLDPROD/cenproddata02.dbf';

Database altered.

SQL>  alter database rename file '/gold/GLP/db/oradata/GOLDPROD/cenprod_idx_02.dbf' to '/gold/GLP/db/oradata/GOLDPROD/cenprodidx02.dbf';

Database altered.

SQL> alter database open;

Database altered.

Advertisements
Tags: ,

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: