Unix Technical Forum

Small scale - programmer driven - schema object/data restore

This is a discussion on Small scale - programmer driven - schema object/data restore within the Oracle Database forums, part of the Database Server Software category; --> Hi - We have a small Oracle server used by three programmers. We would like programmer working on Schema ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-18-2008, 10:46 AM
northof40
 
Posts: n/a
Default Small scale - programmer driven - schema object/data restore

Hi - We have a small Oracle server used by three programmers.
We would like programmer working on Schema A to be able to backup the
schema (at T1) and subsequently (at T2) restore it for the purposes of
testing etc.

We would also like on customer sites when applying schema changes via
DDL to backup the structure of the affected schema before making the
changes.

We assumed both of these would be possible via exp (with ROWS=Y) and
imp (with IGNORE=Y, DESTROY=Y) but we find, on restore, we still have
the data inserted between T1 and T2.

As background - I know we could at least do the programmer thing by
using RMAN but we'd rather not give the programmers access to that if
we could avoid it; more background the data volumes are tiny.

Can anyone explain what's going wrong ?

thanks

R.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-18-2008, 10:46 AM
Mark D Powell
 
Posts: n/a
Default Re: Small scale - programmer driven - schema object/data restore

On Jul 14, 9:59*pm, northof40 <shearich...@gmail.com> wrote:
> Hi - We have a small Oracle server used by three programmers.
> We would like programmer working on Schema A to be able to backup the
> schema (at T1) and subsequently (at T2) restore it for the purposes of
> testing etc.
>
> We would also like on customer sites when applying schema changes via
> DDL to backup the structure of the affected schema before making the
> changes.
>
> We assumed both of these would be possible via exp (with ROWS=Y) and
> imp (with IGNORE=Y, DESTROY=Y) but we find, on restore, we still have
> the data inserted between T1 and T2.
>
> As background - I know we could at least do the programmer thing by
> using RMAN but we'd rather not give the programmers access to that if
> we could avoid it; more background the data volumes are tiny.
>
> Can anyone explain what's going wrong ?
>
> thanks
>
> R.


What do you mean by
>> we still have the data inserted between T1 and T2. <<


If you are running the import as user T1 and the T2 objects are being
imported to user T1 then use the fromuser= touser= parameters or impdp
equilivent to load T2 back into user T2. User T1 is probably going to
have to have the EXP_FULL_DATABASE role in order to export other
user's objects.

HTH -- Mark D Powell --




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-18-2008, 10:46 AM
Mark D Powell
 
Posts: n/a
Default Re: Small scale - programmer driven - schema object/data restore

On Jul 15, 10:02*am, Mark D Powell <Mark.Pow...@eds.com> wrote:
> On Jul 14, 9:59*pm, northof40 <shearich...@gmail.com> wrote:
>
>
>
>
>
> > Hi - We have a small Oracle server used by three programmers.
> > We would like programmer working on Schema A to be able to backup the
> > schema (at T1) and subsequently (at T2) restore it for the purposes of
> > testing etc.

>
> > We would also like on customer sites when applying schema changes via
> > DDL to backup the structure of the affected schema before making the
> > changes.

>
> > We assumed both of these would be possible via exp (with ROWS=Y) and
> > imp (with IGNORE=Y, DESTROY=Y) but we find, on restore, we still have
> > the data inserted between T1 and T2.

>
> > As background - I know we could at least do the programmer thing by
> > using RMAN but we'd rather not give the programmers access to that if
> > we could avoid it; more background the data volumes are tiny.

>
> > Can anyone explain what's going wrong ?

>
> > thanks

>
> > R.

>
> What do you mean by
> *>> we still have the data inserted between T1 and T2. <<
>
> If you are running the import as user T1 and the T2 objects are being
> imported to user T1 then use the fromuser= touser= parameters or impdp
> equilivent to load T2 back into user T2. *User T1 is probably going to
> have to have the EXP_FULL_DATABASE role in order to export other
> user's objects.
>
> HTH -- Mark D Powell --- Hide quoted text -
>
> - Show quoted text -


PS - I question if you should be using destroy=y. That is a very
dangerous parameter and unless you can guarentee that all sites that
run your code separate the user objects into dedicated tablespaces
could cause damage to their databases.

-- Mark D Powell --
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-18-2008, 10:46 AM
Joey.Dantoni@gmail.com
 
Posts: n/a
Default Re: Small scale - programmer driven - schema object/data restore

Agreed on destroy = y--bad idea.

Have you thought about dropping a recreating T2 (perhaps after
exporting). This should all be shell (and/or batch) scriptable, to be
a fairly automated and consistent process.

Also have you thought about using FLASHBACK?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-18-2008, 10:47 AM
gazzag
 
Posts: n/a
Default Re: Small scale - programmer driven - schema object/data restore

On 15 Jul, 15:02, Mark D Powell <Mark.Pow...@eds.com> wrote:
> If you are running the import as user T1 and the T2 objects are being
> imported to user T1 then use the fromuser= touser= parameters or impdp
> equilivent to load T2 back into user T2. *User T1 is probably going to
> have to have the EXP_FULL_DATABASE role in order to export other
> user's objects.
>
> HTH -- Mark D Powell --- Hide quoted text -
>
> - Show quoted text -


As I understand the OP, T1 and T2 are not schema names.

T1 = time of export of the schema in question
T2 = time of subsequent import of the schema in question

At T2, I would drop the schema in question, recreate it and then run
the import with FULL=Y.

HTH

-g
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 07:01 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