Go Back   Rhinocerus > Newsgroup > Newsgroup comp.databases.oracle.server

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 06-08-2007, 05:00 AM
jms.news@gmail.com
Guest
 
Posts: n/a
Default Transportable tablespaces within the same database

Instead of transporting a tablespace between 2 databases .... can one
transport the tablespace to the same database to essentially "restore"
a tablespace to the state when the datafiles were copied ?

e.g.: Assuming I have only one user that owns objects in the
tablespace(s):

1) alter tablespace ts1 read_only;
alter tablespace ts2 read_only;

2) EXP TRANSPORT_TABLESPACE=y TABLESPACES=(ts1,ts2)
TRIGGERS=y CONSTRAINTS=n GRANTS=n FILE=tsexpdat.dmp

3) Copy the datafiles of tablespaces ts1 and ts2 to a different
location.

4) Drop all objects owned by user

5) IMP TRANSPORT_TABLESPACE=y FILE=tsexpdat.dmp
DATAFILES=('/db/datafile1,'/db/datafile2')
TABLESPACES=(ts1,ts2) TTS_OWNERS=(joe)

6) ALTER TABLESPACE ts1 READ WRITE
ALTER TABLESPACE ts2 READ WRITE

Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 06-08-2007, 11:12 AM
Shakespeare
Guest
 
Posts: n/a
Default Re: Transportable tablespaces within the same database


<jms.news@gmail.com> schreef in bericht
news:1181278817.166749.65340@i13g2000prf.googlegro ups.com...
> Instead of transporting a tablespace between 2 databases .... can one
> transport the tablespace to the same database to essentially "restore"
> a tablespace to the state when the datafiles were copied ?
>
> e.g.: Assuming I have only one user that owns objects in the
> tablespace(s):
>
> 1) alter tablespace ts1 read_only;
> alter tablespace ts2 read_only;
>
> 2) EXP TRANSPORT_TABLESPACE=y TABLESPACES=(ts1,ts2)
> TRIGGERS=y CONSTRAINTS=n GRANTS=n FILE=tsexpdat.dmp
>
> 3) Copy the datafiles of tablespaces ts1 and ts2 to a different
> location.
>
> 4) Drop all objects owned by user
>
> 5) IMP TRANSPORT_TABLESPACE=y FILE=tsexpdat.dmp
> DATAFILES=('/db/datafile1,'/db/datafile2')
> TABLESPACES=(ts1,ts2) TTS_OWNERS=(joe)
>
> 6) ALTER TABLESPACE ts1 READ WRITE
> ALTER TABLESPACE ts2 READ WRITE
>


Yes one can!


Reply With Quote
  #3 (permalink)  
Old 06-08-2007, 03:37 PM
Michel Cadot
Guest
 
Posts: n/a
Default Re: Transportable tablespaces within the same database


<jms.news@gmail.com> a écrit dans le message de news: 1181278817.166749.65340@i13g2000prf.googlegroups.c om...
| Instead of transporting a tablespace between 2 databases .... can one
| transport the tablespace to the same database to essentially "restore"
| a tablespace to the state when the datafiles were copied ?
|
| e.g.: Assuming I have only one user that owns objects in the
| tablespace(s):
|
| 1) alter tablespace ts1 read_only;
| alter tablespace ts2 read_only;
|
| 2) EXP TRANSPORT_TABLESPACE=y TABLESPACES=(ts1,ts2)
| TRIGGERS=y CONSTRAINTS=n GRANTS=n FILE=tsexpdat.dmp
|
| 3) Copy the datafiles of tablespaces ts1 and ts2 to a different
| location.
|
| 4) Drop all objects owned by user
|
| 5) IMP TRANSPORT_TABLESPACE=y FILE=tsexpdat.dmp
| DATAFILES=('/db/datafile1,'/db/datafile2')
| TABLESPACES=(ts1,ts2) TTS_OWNERS=(joe)
|
| 6) ALTER TABLESPACE ts1 READ WRITE
| ALTER TABLESPACE ts2 READ WRITE
|

And the purpose is?

Regards
Michel Cadot


Reply With Quote
  #4 (permalink)  
Old 06-09-2007, 04:31 AM
J
Guest
 
Posts: n/a
Default Re: Transportable tablespaces within the same database

"Michel Cadot" <micadot{at}altern{dot}org> wrote:

>
> <jms.news@gmail.com> a écrit dans le message de news:
> 1181278817.166749.65340@i13g2000prf.googlegroups.c om...
> | Instead of transporting a tablespace between 2 databases .... can one
> | transport the tablespace to the same database to essentially "restore"
> | a tablespace to the state when the datafiles were copied ?
> |
> | e.g.: Assuming I have only one user that owns objects in the
> | tablespace(s):
> |
>
> And the purpose is?


You did not read the first part of the post ? The OP says to "restore" a
tablespace to the state when the datafiles were copied.

>
> Regards
> Michel Cadot



Reply With Quote
  #5 (permalink)  
Old 06-09-2007, 05:12 AM
Michel Cadot
Guest
 
Posts: n/a
Default Re: Transportable tablespaces within the same database


"J" <noone@noone.org> a écrit dans le message de news: 466a2d19$0$17156$afc38c87@news.optusnet.com.au...
| "Michel Cadot" <micadot{at}altern{dot}org> wrote:
|
| >
| > <jms.news@gmail.com> a crit dans le message de news:
| > 1181278817.166749.65340@i13g2000prf.googlegroups.c om...
| > | Instead of transporting a tablespace between 2 databases .... can one
| > | transport the tablespace to the same database to essentially "restore"
| > | a tablespace to the state when the datafiles were copied ?
| > |
| > | e.g.: Assuming I have only one user that owns objects in the
| > | tablespace(s):
| > |
| >
| > And the purpose is?
|
| You did not read the first part of the post ? The OP says to "restore" a
| tablespace to the state when the datafiles were copied.

I meant what is the purpose to use TTS instead of "rename".

|
| >
| > Regards
| > Michel Cadot
|
|


Reply With Quote
  #6 (permalink)  
Old 06-12-2007, 12:54 AM
jms.news@gmail.com
Guest
 
Posts: n/a
Default Re: Transportable tablespaces within the same database

On Jun 9, 3:12 pm, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
> "J" <noone@noone.org> a écrit dans le message denews: 466a2d19$0$17156$afc38c87@news.optusnet.com.au...
> | "Michel Cadot" <micadot{at}altern{dot}org> wrote:
> |
> | >
> | > <jms.news@gmail.com> a crit dans le message de news:
> | > 1181278817.166749.65340@i13g2000prf.googlegroups.c om...
> | > | Instead of transporting a tablespace between 2 databases .... can one
> | > | transport the tablespace to the same database to essentially "restore"
> | > | a tablespace to the state when the datafiles were copied ?
> | > |
> | > | e.g.: Assuming I have only one user that owns objects in the
> | > | tablespace(s):
> | > |
> | >
> | > And the purpose is?
> |
> | You did not read the first part of the post ? The OP says to "restore" a
> | tablespace to the state when the datafiles were copied.
>
> I meant what is the purpose to use TTS instead of "rename".



1) Tablespace rename only works with Oracle10g.

2) Even if I was using 10g, you still have to use a transportable
tablespace, dont you ?

jms

Reply With Quote
  #7 (permalink)  
Old 06-12-2007, 11:46 PM
jms.news@gmail.com
Guest
 
Posts: n/a
Default Re: Transportable tablespaces within the same database

On Jun 12, 10:54 am, "jms.n...@gmail.com" <jms.n...@gmail.com> wrote:
> On Jun 9, 3:12 pm, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
>
>
>
> > "J" <n...@noone.org> a écrit dans le message denews: 466a2d19$0$17156$afc38...@news.optusnet.com.au...
> > | "Michel Cadot" <micadot{at}altern{dot}org> wrote:
> > |
> > | >
> > | > <jms.n...@gmail.com> a crit dans le message de news:
> > | > 1181278817.166749.65...@i13g2000prf.googlegroups.c om...
> > | > | Instead of transporting a tablespace between 2 databases .... canone
> > | > | transport the tablespace to the same database to essentially "restore"
> > | > | a tablespace to the state when the datafiles were copied ?
> > | > |
> > | > | e.g.: Assuming I have only one user that owns objects in the
> > | > | tablespace(s):
> > | > |
> > | >
> > | > And the purpose is?
> > |
> > | You did not read the first part of the post ? The OP says to "restore" a
> > | tablespace to the state when the datafiles were copied.

>
> > I meant what is the purpose to use TTS instead of "rename".

>
> 1) Tablespace rename only works with Oracle10g.
>
> 2) Even if I was using 10g, you still have to use a transportable
> tablespace, dont you ?
>
> jms


I was finally able to import the tablespace within the same database,
using the steps I outlined in the OP. However, I also needed to drop
the tablespaces before doing the import.

I did get a few errors though about:

IMP-00093: Inconsistency between dumpfile constraint definition for
table XXX with columns ("yyyy" )
IMP-00003: ORACLE error 1925 encountered
ORA-01925: maximum of 30 enabled roles exceeded
IMP-00000: Import terminated unsuccessfully

.... which I ignored.

However, the problem that I am facing now is that all of the user's
sequences were NOT imported!, whereas if I do an expport/import for
the user, the sequences are imported. Aren't sequences stored in the
user's default tablespace ?

Reply With Quote
  #8 (permalink)  
Old 06-13-2007, 03:44 AM
jms.news@gmail.com
Guest
 
Posts: n/a
Default Re: Transportable tablespaces within the same database

On Jun 13, 9:46 am, "jms.n...@gmail.com" <jms.n...@gmail.com> wrote:
> On Jun 12, 10:54 am, "jms.n...@gmail.com" <jms.n...@gmail.com> wrote:
>
>
>
> > On Jun 9, 3:12 pm, "Michel Cadot" <micadot{at}altern{dot}org> wrote:

>
> > > "J" <n...@noone.org> a écrit dans le message denews: 466a2d19$0$17156$afc38...@news.optusnet.com.au...
> > > | "Michel Cadot" <micadot{at}altern{dot}org> wrote:
> > > |
> > > | >
> > > | > <jms.n...@gmail.com> a crit dans le message de news:
> > > | > 1181278817.166749.65...@i13g2000prf.googlegroups.c om...
> > > | > | Instead of transporting a tablespace between 2 databases .... can one
> > > | > | transport the tablespace to the same database to essentially "restore"
> > > | > | a tablespace to the state when the datafiles were copied ?
> > > | > |
> > > | > | e.g.: Assuming I have only one user that owns objects in the
> > > | > | tablespace(s):
> > > | > |
> > > | >
> > > | > And the purpose is?
> > > |
> > > | You did not read the first part of the post ? The OP says to "restore" a
> > > | tablespace to the state when the datafiles were copied.

>
> > > I meant what is the purpose to use TTS instead of "rename".

>
> > 1) Tablespace rename only works with Oracle10g.

>
> > 2) Even if I was using 10g, you still have to use a transportable
> > tablespace, dont you ?

>
> > jms

>
> I was finally able to import the tablespace within the same database,
> using the steps I outlined in the OP. However, I also needed to drop
> the tablespaces before doing the import.
>
> I did get a few errors though about:
>
> IMP-00093: Inconsistency between dumpfile constraint definition for
> table XXX with columns ("yyyy" )
> IMP-00003: ORACLE error 1925 encountered
> ORA-01925: maximum of 30 enabled roles exceeded
> IMP-00000: Import terminated unsuccessfully
>
> ... which I ignored.
>
> However, the problem that I am facing now is that all of the user's
> sequences were NOT imported!, whereas if I do an expport/import for
> the user, the sequences are imported. Aren't sequences stored in the
> user's default tablespace ?


Not only the sequences ... but the views as well.


Reply With Quote
  #9 (permalink)  
Old 06-13-2007, 03:18 PM
Brian Peasland
Guest
 
Posts: n/a
Default Re: Transportable tablespaces within the same database

jms.news@gmail.com wrote:
> On Jun 13, 9:46 am, "jms.n...@gmail.com" <jms.n...@gmail.com> wrote:
>> On Jun 12, 10:54 am, "jms.n...@gmail.com" <jms.n...@gmail.com> wrote:
>>
>>
>>
>>> On Jun 9, 3:12 pm, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
>>>> "J" <n...@noone.org> a écrit dans le message denews: 466a2d19$0$17156$afc38...@news.optusnet.com.au...
>>>> | "Michel Cadot" <micadot{at}altern{dot}org> wrote:
>>>> |
>>>> | >
>>>> | > <jms.n...@gmail.com> a crit dans le message de news:
>>>> | > 1181278817.166749.65...@i13g2000prf.googlegroups.c om...
>>>> | > | Instead of transporting a tablespace between 2 databases .... can one
>>>> | > | transport the tablespace to the same database to essentially "restore"
>>>> | > | a tablespace to the state when the datafiles were copied ?
>>>> | > |
>>>> | > | e.g.: Assuming I have only one user that owns objects in the
>>>> | > | tablespace(s):
>>>> | > |
>>>> | >
>>>> | > And the purpose is?
>>>> |
>>>> | You did not read the first part of the post ? The OP says to "restore" a
>>>> | tablespace to the state when the datafiles were copied.
>>>> I meant what is the purpose to use TTS instead of "rename".
>>> 1) Tablespace rename only works with Oracle10g.
>>> 2) Even if I was using 10g, you still have to use a transportable
>>> tablespace, dont you ?
>>> jms

>> I was finally able to import the tablespace within the same database,
>> using the steps I outlined in the OP. However, I also needed to drop
>> the tablespaces before doing the import.
>>
>> I did get a few errors though about:
>>
>> IMP-00093: Inconsistency between dumpfile constraint definition for
>> table XXX with columns ("yyyy" )
>> IMP-00003: ORACLE error 1925 encountered
>> ORA-01925: maximum of 30 enabled roles exceeded
>> IMP-00000: Import terminated unsuccessfully
>>
>> ... which I ignored.
>>
>> However, the problem that I am facing now is that all of the user's
>> sequences were NOT imported!, whereas if I do an expport/import for
>> the user, the sequences are imported. Aren't sequences stored in the
>> user's default tablespace ?

>
> Not only the sequences ... but the views as well.
>
>


Transportable Tablespaces (TTS) will only copy user's objects that are
actually stored in those tablespaces. So you'll get the tables, indexes,
etc. You can query DBA_SEGMENTS to see which objects will be in the
tablespace you are transporting.

Transportable Tablespaces will not let you move objects that exist in
the Data Dictionary, i.e. views, sequences, packages, procedures.

Even though the definition for the trigger exists in the Data
Dictionary, you can get triggers transported with TTS as they will be
tied directly to the tables being transported. And you can copy
constraints as well for the same reason.

HTH,
Brian

--
================================================== =================

Brian Peasland
dba@nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown

--
Posted via a free Usenet account from http://www.teranews.com

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Database Lock vs Database Freeze data _null_; Newsgroup comp.soft-sys.sas 0 04-24-2007 01:29 PM
Re: Database Lock vs Database Freeze Bob_Abelson@HGSI.COM Newsgroup comp.soft-sys.sas 0 04-24-2007 01:20 PM
Re: Database Lock vs Database Freeze Nancy Brucken Newsgroup comp.soft-sys.sas 0 04-24-2007 06:02 AM
Help with SQL Database Problem!!! Jeremy Ambler Newsgroup comp.soft-sys.sas 1 11-17-2004 10:18 PM
Re: Help with SQL Database Problem!!! Sigurd Hermansen Newsgroup comp.soft-sys.sas 0 11-17-2004 09:48 PM



All times are GMT. The time now is 10:01 PM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.