Unix Technical Forum

job ownership during schema imp/exp changes

This is a discussion on job ownership during schema imp/exp changes within the Oracle Database forums, part of the Database Server Software category; --> Is there are any way to prevent jobs from being imported under wrong username (SYS) when schema exp/imp is ...


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

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-25-2008, 01:42 AM
NetComrade
 
Posts: n/a
Default job ownership during schema imp/exp changes

Is there are any way to prevent jobs from being imported under wrong
username (SYS) when schema exp/imp is being done (e.g. schema
movement?)

I suspect this has to do with user_id's not matching..

Thanks.
........
We run Oracle 9.2.0.6 on RH4 AMD
remove NSPAM to email
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-25-2008, 01:42 AM
DA Morgan
 
Posts: n/a
Default Re: job ownership during schema imp/exp changes

NetComrade wrote:
> Is there are any way to prevent jobs from being imported under wrong
> username (SYS) when schema exp/imp is being done (e.g. schema
> movement?)
>
> I suspect this has to do with user_id's not matching..
>
> Thanks.
> .......
> We run Oracle 9.2.0.6 on RH4 AMD
> remove NSPAM to email


Not sure I understand your question but my answer would be no.
If you provide the wrong schema name there is no reason for
Oracle not to use it.
--
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
  #3 (permalink)  
Old 02-25-2008, 01:42 AM
yong321@gmail.com
 
Posts: n/a
Default Re: job ownership during schema imp/exp changes

NetComrade wrote:
> Is there are any way to prevent jobs from being imported under wrong
> username (SYS) when schema exp/imp is being done (e.g. schema
> movement?)
>
> I suspect this has to do with user_id's not matching..
>
> Thanks.
> .......
> We run Oracle 9.2.0.6 on RH4 AMD
> remove NSPAM to email


If the intent is to avoid importing a job when you import other things
owned by the original user, you can either drop the job after import,
or pre-create a dummy job in the target database using
dbms_jobs.isubmit with the same job number as the job in the source.
This is because the imported job would take the same job number and
fail to be imported if the number is already taken.

Whoever imports the schema owns the job. If your intent is to create a
job in the target database under the original user's ownership (as
shown under dba_jobs.log_user and priv_user but not schema_user), you
still do the same. Then recreate the job under the correct schema.
Dbms_job.user_export makes this a little easier. See Metalink
322797.999.

Why not temporarily allow the user instead of SYS to import? Is there
anything only SYS can do (like row level security stuff)?

Yong Huang

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-25-2008, 01:52 AM
NetComrade
 
Posts: n/a
Default Re: job ownership during schema imp/exp changes

On 18 Jan 2006 20:54:45 -0800, yong321@gmail.com wrote:

>NetComrade wrote:
>> Is there are any way to prevent jobs from being imported under wrong
>> username (SYS) when schema exp/imp is being done (e.g. schema
>> movement?)
>>
>> I suspect this has to do with user_id's not matching..
>>
>> Thanks.
>> .......
>> We run Oracle 9.2.0.6 on RH4 AMD
>> remove NSPAM to email

>
>If the intent is to avoid importing a job when you import other things
>owned by the original user, you can either drop the job after import,
>or pre-create a dummy job in the target database using
>dbms_jobs.isubmit with the same job number as the job in the source.
>This is because the imported job would take the same job number and
>fail to be imported if the number is already taken.
>
>Whoever imports the schema owns the job. If your intent is to create a
>job in the target database under the original user's ownership (as
>shown under dba_jobs.log_user and priv_user but not schema_user), you
>still do the same. Then recreate the job under the correct schema.
>Dbms_job.user_export makes this a little easier. See Metalink
>322797.999.
>
>Why not temporarily allow the user instead of SYS to import? Is there
>anything only SYS can do (like row level security stuff)?



The situation is schema migration from server to server.
The problem is exp/imp with the sys(or system) user, and importing on
the other server, however, the jobs get imported under sys (or system)
user, instead of the original owner.

Yes, the workaround seemed to be to give exp_full_database on one end
and imp_full_database on the other end, and just use the 'ownership'
user to imp and exp.. However, I don't understand why jobs won't be
owned by the original owner in the first place.

Thanks,
-A

........
We run Oracle 9.2.0.6 on RH4 AMD
remove NSPAM to email
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-25-2008, 01:53 AM
Joel Garry
 
Posts: n/a
Default Re: job ownership during schema imp/exp changes

Interestingly enough, the metalink document about how to use exp/imp to
copy PORTAL schemas has this little nugget:

---- Jobs
--
-- Reassign the JOBS imported to PORTAL. After the import, they belong
-- incorrectly to the user SYS.
update dba_jobs set LOG_USER='PORTAL', PRIV_USER='PORTAL' where
schema_user='PORTAL';
commit;

jg
--
@home.com is bogus.
Wanna buy a watch?
http://www.signonsandiego.com/uniont...26auction.html

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-25-2008, 01:53 AM
NetComrade
 
Posts: n/a
Default Re: job ownership during schema imp/exp changes

On 26 Jan 2006 11:39:28 -0800, "Joel Garry" <joel-garry@home.com>
wrote:

>Interestingly enough, the metalink document about how to use exp/imp to
>copy PORTAL schemas has this little nugget:
>
>---- Jobs
>--
>-- Reassign the JOBS imported to PORTAL. After the import, they belong
>-- incorrectly to the user SYS.
>update dba_jobs set LOG_USER='PORTAL', PRIV_USER='PORTAL' where
>schema_user='PORTAL';
>commit;


I didn't know updating dba_* was allowed.

Thanks for the tip.
........
We run Oracle 9.2.0.6 on RH4 AMD
remove NSPAM to email
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-25-2008, 01:53 AM
hpuxrac
 
Posts: n/a
Default Re: job ownership during schema imp/exp changes

Updating dba_* ... ???

Heavily discouraged in general except for specific extenuating
circumstances.

Such as ( sometimes ) notes include in oracle support information.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-25-2008, 01:53 AM
Joel Garry
 
Posts: n/a
Default Re: job ownership during schema imp/exp changes

Netcomrade wrote:

>I didn't know updating dba_* was allowed.


Allowed, yes, a good idea, wellllllll... it depends. :-)

I haven't tried it, just thought it was interesting, and also
interesting that it was posted (in the portal context) to solve your
exact problem. There have been various tricks posted in the past on
updating internal tables, generally it is a really bad idea. This one
looks mostly harmless.

jg
--
@home.com is bogus.
Pew study author says "We still have needs, strong needs, to see, touch
and smell people."
http://www.signonsandiego.com/uniont...6internet.html

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 02:03 AM.


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