Home » RDBMS Server » Server Administration » Move job to other database (oracle,10.2.0.2.0,Unix)
Move job to other database [message #512223] Fri, 17 June 2011 11:11 Go to next message
Database admin
Messages: 365
Registered: September 2006
Location: india
Senior Member

I want to move IT_TO_DUM_LOADING job from G1 database to G2 database.

I executed the below query and returned one row with jobname IT_TO_DUM_LOADING.

SELECT OWNER, JOB_NAME, JOB_SUBNAME, JOB_CREATOR, CLIENT_ID,
GLOBAL_UID, PROGRAM_OWNER, PROGRAM_NAME, JOB_TYPE, JOB_ACTION,
NUMBER_OF_ARGUMENTS, 
SCHEDULE_OWNER, SCHEDULE_NAME, SCHEDULE_TYPE, TO_CHAR(START_DATE,'DD-MON-YYYY') START_DATE,
EVENT_QUEUE_OWNER, EVENT_QUEUE_NAME, EVENT_QUEUE_AGENT, EVENT_CONDITION,
EVENT_RULE, TO_CHAR(END_DATE,'DD-MON-YYYY') END_DT, JOB_CLASS, ENABLED, AUTO_DROP,
RESTARTABLE, STATE, JOB_PRIORITY, RUN_COUNT, MAX_RUNS,
FAILURE_COUNT, MAX_FAILURES, 
RETRY_COUNT, TO_CHAR(LAST_START_DATE,'DD-MON-YYYY') LAST_START_DT, LAST_RUN_DURATION,
TO_CHAR(NEXT_RUN_DATE,'DD-MON-YYYY') NEXT_RUN_DATE, SCHEDULE_LIMIT, 
MAX_RUN_DURATION, LOGGING_LEVEL, STOP_ON_WINDOW_CLOSE,
INSTANCE_STICKINESS, RAISE_EVENTS, SYSTEM, JOB_WEIGHT, NLS_ENV,
SOURCE, DESTINATION, COMMENTS, FLAGS
FROM dba_scheduler_jobs where job_name LIKE '%IT%'



it returned the result with

owner,
job_name=IT_TO_DUM_LOADING
job_creator='BALA'
job_type=stored_procedure
job_action='DUM_IT_LOAD'
schedule_type=calendar
start_date='12-JUNE-2008
job_class=DEFAULT_JOB_CLASS
enabled=TRUE
auto_drop=false
state=scheduled
job_priority=3
run_count=291
faliure_count=90
last_start_DT=16-JUN-2011
last_run_duration=+00 01:46:01.159365
next_run_date=17-JUN-2011
loggin_levels=RUN
stop_on_window_close=false
job_weight=1
comments=This job load the Items,locations and Vendor details from IH to DUM
flags=311333

I could not find this job in dba_jobs.

Can somebody help me how to move this job from one database to other database?

Thanks

[Updated on: Mon, 20 June 2011 05:00] by Moderator

Report message to a moderator

Re: Move job to other database [message #512224 is a reply to message #512223] Fri, 17 June 2011 11:20 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/

DBA_JOBS is different from DBA_SCHEDULER_JOBS

>Can somebody help me how to move this job from one database to other database?
write code to do so.
DBMS_METADATA does not support JOB object type.

SELECT owner,
       job_name,
       job_subname,
       job_creator,
       client_id,
       global_uid,
       program_owner,
       program_name,
       job_type,
       job_action,
       number_of_arguments,
       schedule_owner,
       schedule_name,
       schedule_type,
       To_char(start_date, 'DD-MON-YYYY')      start_date,
       event_queue_owner,
       event_queue_name,
       event_queue_agent,
       event_condition,
       event_rule,
       To_char(end_date, 'DD-MON-YYYY')        end_dt,
       job_class,
       enabled,
       auto_drop,
       restartable,
       state,
       job_priority,
       run_count,
       max_runs,
       failure_count,
       max_failures,
       retry_count,
       To_char(last_start_date, 'DD-MON-YYYY') last_start_dt,
       last_run_duration,
       To_char(next_run_date, 'DD-MON-YYYY')   next_run_date,
       schedule_limit,
       max_run_duration,
       logging_level,
       stop_on_window_close,
       instance_stickiness,
       raise_events,
       system,
       job_weight,
       nls_env,
       source,
       destination,
       comments,
       flags
FROM   dba_scheduler_jobs
WHERE  job_name LIKE '%IT%'  

[Updated on: Fri, 17 June 2011 11:23]

Report message to a moderator

Re: Move job to other database [message #512226 is a reply to message #512224] Fri, 17 June 2011 11:26 Go to previous messageGo to next message
Database admin
Messages: 365
Registered: September 2006
Location: india
Senior Member

"DBMS_METADATA does not support JOB object type."


can you explain the above one in detail as i could not understand what you are saying.

Thanks

Re: Move job to other database [message #512230 is a reply to message #512226] Fri, 17 June 2011 11:35 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
balaji14 wrote on Fri, 17 June 2011 09:26
"DBMS_METADATA does not support JOB object type."


can you explain the above one in detail as i could not understand what you are saying.

Thanks



DBMS_METADATA can generate DDL for many objects that exist;
but JOB is not one of the support OBJECT_TYPE.

 1* select object_type, count(*) from dba_objects group by object_type order by 1
SQL> /

OBJECT_TYPE	      COUNT(*)
------------------- ----------
CLUSTER 		    10
CONSUMER GROUP		    25
CONTEXT 		     7
DATABASE LINK		     2
DESTINATION		     2
DIMENSION		     5
DIRECTORY		    10
EDITION 		     1
EVALUATION CONTEXT	    15
FUNCTION		   313
INDEX			  3938
INDEX PARTITION 	   682
INDEXTYPE		     9
JAVA CLASS		 22920
JAVA DATA		   328
JAVA RESOURCE		   834
JAVA SOURCE		     2
JOB			    15
JOB CLASS		    13
LIBRARY 		   183
LOB			   924
LOB PARTITION		     1
MATERIALIZED VIEW	     3
OPERATOR		    55
PACKAGE 		  1316
PACKAGE BODY		  1254
PROCEDURE		   185
PROGRAM 		    19
QUEUE			    40
RESOURCE PLAN		    10
RULE			     1
RULE SET		    23
SCHEDULE		     3
SCHEDULER GROUP 	     4
SEQUENCE		   231
SYNONYM 		 27806
TABLE			  2982
TABLE PARTITION 	   531
TRIGGER 		   626
TYPE			  2824
TYPE BODY		   244
UNDEFINED		     9
VIEW			  5063
WINDOW			     9
XML SCHEMA		    52

45 rows selected.
Re: Move job to other database [message #512232 is a reply to message #512223] Fri, 17 June 2011 11:40 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
100+ posts and still unable to format a query and correctly post?
Are you sure you are able to do your job?

Regards
Michel

[Updated on: Fri, 17 June 2011 11:41]

Report message to a moderator

Re: Move job to other database [message #512233 is a reply to message #512230] Fri, 17 June 2011 11:41 Go to previous messageGo to next message
Database admin
Messages: 365
Registered: September 2006
Location: india
Senior Member


So you mean job cannot be moved to other database ??

Re: Move job to other database [message #512234 is a reply to message #512233] Fri, 17 June 2011 11:43 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>So you mean job cannot be moved to other database ??

I can move job from one DB to another.
Can you?
Can you create JOB in any DB?
Re: Move job to other database [message #512236 is a reply to message #512234] Fri, 17 June 2011 11:46 Go to previous messageGo to next message
Database admin
Messages: 365
Registered: September 2006
Location: india
Senior Member



yes, using DBMS_SCHEDULER.create_job
Re: Move job to other database [message #512237 is a reply to message #512236] Fri, 17 June 2011 11:48 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
balaji14 wrote on Fri, 17 June 2011 09:46


yes, using DBMS_SCHEDULER.create_job

GREAT! now proceed to do so.
Re: Move job to other database [message #512238 is a reply to message #512237] Fri, 17 June 2011 11:51 Go to previous messageGo to next message
Database admin
Messages: 365
Registered: September 2006
Location: india
Senior Member

OK.But i need the exact parameters and the command that is used
to create job in another database because it should be replica
of source database.


Thanks
Re: Move job to other database [message #512241 is a reply to message #512238] Fri, 17 June 2011 11:55 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>OK.But i need the exact parameters
We don't have those parameters, so we can't assist; You're On Your Own (YOYO)
Re: Move job to other database [message #512247 is a reply to message #512238] Fri, 17 June 2011 12:16 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
balaji14 wrote on Fri, 17 June 2011 18:51
OK.But i need the exact parameters and the command that is used
to create job in another database because it should be replica
of source database.


Thanks


And what did you search and find with the method we gave you many times in your previous topics?

Regards
Michel

Re: Move job to other database [message #512377 is a reply to message #512223] Sun, 19 June 2011 21:48 Go to previous messageGo to next message
hkchital
Messages: 128
Registered: September 2008
Location: Singapore
Senior Member
Your query was on DBA_SCHEDULER_JOBS.


You then say "I could not find this job in dba_jobs."

DBA_JOBS is the view for the "older-style" jobs interface without a Scheduler.
DBA_SCHEEDULER_JOBS is the view for the new interface where a Scheduler is used.
The two types of jobs are very different.

Scheduler Jobs can be exported and imported using expdp/impdp.

See http://download.oracle.com/docs/cd/E11882_01/server.112/e17120/schedadmin003.htm#i1007297

and

http://download.oracle.com/docs/cd/E11882_01/server.112/e17120/appendix_a002.htm#BGBBBFGJ


Hemant K Chitale
Re: Move job to other database [message #512397 is a reply to message #512377] Mon, 20 June 2011 02:32 Go to previous messageGo to next message
Database admin
Messages: 365
Registered: September 2006
Location: india
Senior Member

Thanks Hemant...

While querying select * from dba_scheduler_job,i am getting error like
ORA-01882: timezone region %s not found

Thanks

Re: Move job to other database [message #512400 is a reply to message #512397] Mon, 20 June 2011 03:04 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Could you COPY AND PASTE what you did and got:
SQL> select * from dba_scheduler_job;
select * from dba_scheduler_job
              *
ERROR at line 1:
ORA-00942: table or view does not exist

Regards
Michel
Re: Move job to other database [message #512401 is a reply to message #512400] Mon, 20 June 2011 03:25 Go to previous messageGo to next message
Database admin
Messages: 365
Registered: September 2006
Location: india
Senior Member

SQL>
SQL> select * from dba_scheduler_jobs;
ERROR:
ORA-01882: timezone region %s not found


no rows selected


Thanks
Re: Move job to other database [message #512402 is a reply to message #512401] Mon, 20 June 2011 03:35 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
col parameter format a40
col value format a40
select * from v$nls_parameters where parameter like '%TIME%' order by 1;
select sessiontimezone, dbtimezone from dual;
select * from v$version;


Regards
Michel

[Updated on: Mon, 20 June 2011 03:37]

Report message to a moderator

Re: Move job to other database [message #512416 is a reply to message #512402] Mon, 20 June 2011 04:27 Go to previous messageGo to next message
Database admin
Messages: 365
Registered: September 2006
Location: india
Senior Member


You want the output of those above queries ?

[Updated on: Mon, 20 June 2011 04:38]

Report message to a moderator

Re: Move job to other database [message #512420 is a reply to message #512416] Mon, 20 June 2011 04:41 Go to previous messageGo to next message
cookiemonster
Messages: 13921
Registered: September 2008
Location: Rainy Manchester
Senior Member
Yes
Re: Move job to other database [message #512421 is a reply to message #512420] Mon, 20 June 2011 04:50 Go to previous messageGo to next message
Database admin
Messages: 365
Registered: September 2006
Location: india
Senior Member

SQL> col parameter format a40
SQL> col value format a40
SQL> select * from v$nls_parameters where parameter like '%TIME%' order by 1;

PARAMETER
----------------------------------------
VALUE
----------------------------------------
NLS_TIMESTAMP_FORMAT
DD-MON-RR HH.MI.SSXFF AM

NLS_TIMESTAMP_TZ_FORMAT
DD-MON-RR HH.MI.SSXFF AM TZR

NLS_TIME_FORMAT
HH.MI.SSXFF AM


PARAMETER
----------------------------------------
VALUE
----------------------------------------
NLS_TIME_TZ_FORMAT
HH.MI.SSXFF AM TZR


SQL> select sessiontimezone, dbtimezone from dual;

SESSIONTIMEZONE
---------------------------------------------------------------------------
DBTIME
------
+05:30
-05:00


SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE    11.1.0.7.0      Production
TNS for HPUX: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
Re: Move job to other database [message #512422 is a reply to message #512421] Mon, 20 June 2011 04:58 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Title
(oracle,10.2.0.2.0,Unix)

Quote:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production

Try to provide accurate information.

Execute SELECT for each column and row of dba_scheduler_jobs to find which one(s) contain(s)
invalid data and post what you find.

Regards
Michel
Re: Move job to other database [message #512428 is a reply to message #512422] Mon, 20 June 2011 05:37 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I means each TIMESTAMP column.

Regards
Michel
Re: Move job to other database [message #512441 is a reply to message #512428] Mon, 20 June 2011 06:14 Go to previous messageGo to next message
Database admin
Messages: 365
Registered: September 2006
Location: india
Senior Member

Here is the column description of dba_scheduler_jobs view with status


owner--returned rows data
JOB_NAME --returned rows data
JOB_SUBNAME--returned rows data
JOB_STYLE--returned rows data
JOB_CREATOR-w
CLIENT_ID-w
GLOBAL_UID - empty row
PROGRAM_OWNER- empty row
PROGRAM_NAME- empty
JOB_TYPE-- returned rows data
JOB_ACTION--returned rows data
NUMBER_OF_ARGUMENTS--return 0
SCHEDULE_OWNER--returned rows data
SCHEDULE_NAME-returned rows data
SCHEDULE_TYPE-returned rows data
START_DATE -- ORA-01882: timezone region %s not found
REPEAT_INTERVAL--- returned rows data
EVENT_QUEUE_OWNER - empty
EVENT_QUEUE_NAME- empty
EVENT_QUEUE_AGENT- empty
EVENT_CONDITION- empty
EVENT_RULE- empty
END_DATE- empty
JOB_CLASS-returned rows data
ENABLED---returned rows data
AUTO_DROP---returned rows data
RESTARTABLE--returned rows data
STATE-returned rows data
JOB_PRIORITY-returned rows data
RUN_COUNT-returned rows data
MAX_RUNS - empty
FAILURE_COUNT-returned rows data
MAX_FAILURES- empty
RETRY_COUNT -- zero
LAST_START_DATE -- ORA-01882: timezone region %s not found
LAST_RUN_DURATION-w
NEXT_RUN_DATE -- ORA-01882: timezone region %s not found
SCHEDULE_LIMIT--- empty
MAX_RUN_DURATION- empty
LOGGING_LEVEL--returned rows data
STOP_ON_WINDOW_CLOSE--returned rows data
INSTANCE_STICKINESS---returned rows data
RAISE_EVENTS-- empty
SYSTEM--returned rows data
JOB_WEIGHT--returned rows data
NLS_ENV--returned rows data
SOURCE-- empty
DESTINATION-- empty
CREDENTIAL_OWNER-- empty
CREDENTIAL_NAME-- empty
INSTANCE_ID-- empty
DEFERRED_DROP--returned rows data
COMMENTS--returned rows data
FLAGSE-- returned rows data
Re: Move job to other database [message #512449 is a reply to message #512441] Mon, 20 June 2011 06:59 Go to previous message
ThomasG
Messages: 3211
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
$ oerr ORA 01882
01882, 00000, "timezone region %s not found"
// *Cause: The specified region name was not found.
// *Action: Please contact Oracle Customer Support.


Have a look at MyOracleSupport Note 414590.1
Previous Topic: How can prevent DBA user from disabling any trigger ?
Next Topic: ASM disk string
Goto Forum:
  


Current Time: Thu May 02 08:53:57 CDT 2024