Unix Technical Forum

How to copy a tablespace?

This is a discussion on How to copy a tablespace? within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi! I want to move a tablespace from one instance to another, they have different names. Ex: user test_user ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 10:07 AM
Einar
 
Posts: n/a
Default How to copy a tablespace?

Hi!

I want to move a tablespace from one instance to another, they have
different names.

Ex: user test_user with tablespace test_user_data, want to move this to user
prod_user with tablespace prod_user_data.
Is it possible with exp - imp ?

Have in mind that I'm a newbie, maybe this is a stupid question ;-)

Thanks for all help!

Einar


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 10:07 AM
frank.van.bortel@gmail.com
 
Posts: n/a
Default Re: How to copy a tablespace?

You cannot move tablespaces, as a tablespace is a logical unit.
It comprises of datafiles - the physical implementation of tablespace.
And users do not own tablespaces, so moving a tablespace from user to
user is nonsense. You Grant users the prvilege to access objects,
possibly stored in that tablespace.

Look at transportable tablespaces - yet you cannot rename them.
Transportable ts uses exp/imp for the metadata only; you physically
copy the datafile(s), belonging to the tablespace.
As you indicate you are new in this field, I'd like to advise you call
in your DBA to archieve this.
Using exp/imp without transportable tablespaces reuires to find out
what objects are stored in that tablespace, and name them all in the
tables=(...) section of your export command. Then use imp fromuser=a
touser=b

Next time, just (have 'em) name the ts user_data on both instances...

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 10:07 AM
DA Morgan
 
Posts: n/a
Default Re: How to copy a tablespace?

frank.van.bortel@gmail.com wrote:

> Look at transportable tablespaces - yet you cannot rename them.


Perhaps I have misunderstood your intent in saying this but:

ALTER TABLESPACE users RENAME TO user_data;

Works just fine in 10gR2.
--
Daniel A. Morgan
http://www.psoug.org
damorgan@x.washington.edu
(replace x with u to respond)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-08-2008, 10:07 AM
Frank van Bortel
 
Posts: n/a
Default Re: How to copy a tablespace?

DA Morgan wrote:
> frank.van.bortel@gmail.com wrote:
>
>> Look at transportable tablespaces - yet you cannot rename them.

>
> Perhaps I have misunderstood your intent in saying this but:
>
> ALTER TABLESPACE users RENAME TO user_data;
>
> Works just fine in 10gR2.


For starters, I assumed things. I apologize for that.
I assumed the OP had a user_test_data TS on one instance,
and user_prod_data on another, and wanted to copy
user_test_data over to user_prod_data.

That is not going to work; for starters, you already
have user_prod_data!
Also, there is the issue of grants on objects within
the TS - these won't be the same!

Bad choice of words, and too hasty.
--
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:23 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com