Home » RDBMS Server » Server Administration » Moving Data Between Datafiles / Drooping Datafile
Moving Data Between Datafiles / Drooping Datafile [message #146334] Wed, 09 November 2005 23:01 Go to next message
weekend79
Messages: 198
Registered: April 2005
Location: Islamabad
Senior Member

Hi

1. I want to move all data of a datafile to another datafile. (How to locate objects and how to move)?

2. How to drop a datafile cleanly?

Wishes
Jawad

Re: Moving Data Between Datafiles / Drooping Datafile [message #146357 is a reply to message #146334] Thu, 10 November 2005 00:42 Go to previous messageGo to next message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member


--> How to locate objects and how to move?

you can identify the objects in that datafile by the following query

Quote:

SQL> select segment_name, file_name from
dba_extents ext, dba_data_files dbf
where ext.file_id =dbf.file_id
and dbf.file_id= your_file_id;


And now create another tablespace and move these objects to the new tablespace

Quote:

SQL> Alter object object_name move tablespace tablespace_name;


And the other way is to

export old tablespace and import the data into new tablespace.

regards,
tarun
Re: Moving Data Between Datafiles / Drooping Datafile [message #146392 is a reply to message #146334] Thu, 10 November 2005 02:53 Go to previous messageGo to next message
nmacdannald
Messages: 460
Registered: July 2005
Location: Stockton, California - US...
Senior Member
I think doing that invalidates the indexes, views, PK's, and any functions/procedures/packages that are dependant to the moved object, if I remember correctly. No big thing if you are ready for it. There is a script in $ORACLE_HOME/rdbms/admin to recompile all invalid objects. I think it is named utlprp.sql and run as sysdba.
Re: Moving Data Between Datafiles / Drooping Datafile [message #146399 is a reply to message #146392] Thu, 10 November 2005 03:54 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
UTLPRP will not rebuild your indexes etc!. It is meant for system objects.
Re: Moving Data Between Datafiles / Drooping Datafile [message #146407 is a reply to message #146399] Thu, 10 November 2005 04:29 Go to previous messageGo to next message
nmacdannald
Messages: 460
Registered: July 2005
Location: Stockton, California - US...
Senior Member
No Message Body
Re: Moving Data Between Datafiles / Drooping Datafile [message #146408 is a reply to message #146334] Thu, 10 November 2005 04:29 Go to previous message
nmacdannald
Messages: 460
Registered: July 2005
Location: Stockton, California - US...
Senior Member
Thanks!
Previous Topic: how to check the used space in datafile
Next Topic: Multiple Tablespace in a Application
Goto Forum:
  


Current Time: Fri Jan 10 12:23:55 CST 2025