Home » RDBMS Server » Server Utilities » Job Scheduler (oracle 10.2.0.1.0 - windows XP)
Job Scheduler [message #492318] Sat, 29 January 2011 06:09 Go to next message
muktha_22
Messages: 527
Registered: December 2009
Senior Member
Hi All,

Need your guidence.

1) I created a script file as below:
create table table1 (name varchar2(5),age number(2))
2) And i created a JOB as below:
begin
dbms_scheduler.create_job(
job_name => 'ARC_MOVE_2′,
job_type => 'EXECUTABLE',
job_action => '/home/arup/dbtools/scriptname.sql',
repeat_interval => 'FREQ=MINUTELY; INTERVAL=30′,
enabled => true,
comments => 'Move Archived Logs to a Different Directory'
);
end;
It was successfully ran, but there is no table created with the name "TABLE1".

please need your help...

Regards:
Muktha
Re: Job Scheduler [message #492328 is a reply to message #492318] Sat, 29 January 2011 08:57 Go to previous messageGo to next message
John Watson
Messages: 8929
Registered: January 2010
Location: Global Village
Senior Member
What are you trying to do? Do you want to create a table, or move your archivelogs?
Re: Job Scheduler [message #492329 is a reply to message #492318] Sat, 29 January 2011 08:58 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
'/home/arup/dbtools/scriptname.sql' is not an executable, I doubt the job successfully executed.
In addition, it is not even a correct SQL script.
(By the way, what does the comment (and job name) has to do with the script purpose?)

Regards
Michel

[Updated on: Sat, 29 January 2011 08:58]

Report message to a moderator

Re: Job Scheduler [message #492333 is a reply to message #492329] Sat, 29 January 2011 09:08 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>It was successfully ran,
If true, it would *NEVER* run successfully again (because table would now exist & next run would error out).
Doing CREATE TABLE from a job is nonsensical in my opinion.

It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Re: Job Scheduler [message #492335 is a reply to message #492329] Sat, 29 January 2011 09:31 Go to previous messageGo to next message
John Watson
Messages: 8929
Registered: January 2010
Location: Global Village
Senior Member
Quote:
'/home/arup/dbtools/scriptname.sql' is not an executable,
We don't know that! The bizarre nature of the call to CREATE_JOB makes it unwise to make assumptions about the sanity of name.
Also,
Quote:
because table would now exist & next run would error out
We don't know this, either: there could well be another job, perhaps called CREATE_DATABASE or something equally sensible, that in fact drops the table shortly after creation.

I don't think it is safe to assume anything in this topic.
Re: Job Scheduler [message #492337 is a reply to message #492335] Sat, 29 January 2011 09:53 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Do you mean we can have some doubts about OP's sanity? /forum/fa/917/0/

Regards
Michel
Re: Job Scheduler [message #492471 is a reply to message #492337] Mon, 31 January 2011 06:21 Go to previous messageGo to next message
muktha_22
Messages: 527
Registered: December 2009
Senior Member
Hi All,

I created that Script to test the SCHEDULER.
If it is not correct,

please guide me..
I just want to run any of a Scheduler to test.

Regards:
Muktha
Re: Job Scheduler [message #492472 is a reply to message #492471] Mon, 31 January 2011 06:28 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Maybe:
job_action => '/.../bin/sqlplus -s user/psw@base @/home/arup/dbtools/scriptname.sql'
or a shell script containing this statement and all settings of environment variables.

Regards
Michel

Re: Job Scheduler [message #492473 is a reply to message #492472] Mon, 31 January 2011 06:30 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
And maye you can also try the examples in the documentation:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/schedadmin006.htm
http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/scheduse002.htm

Regards
Michel
Re: Job Scheduler [message #493595 is a reply to message #492473] Tue, 08 February 2011 23:14 Go to previous messageGo to next message
muktha_22
Messages: 527
Registered: December 2009
Senior Member
Hi All,

please help me on the below requirements:
1) I Just want to check SCHEDULER with simply creating some tables.
2) Also can you provide me docs for Taking BACKUPS with DBMS_SCHEDULER?

Regards:
Muktha
Re: Job Scheduler [message #493596 is a reply to message #493595] Tue, 08 February 2011 23: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/
>1) I Just want to check SCHEDULER with simply creating some tables.
HUH?
What are inputs? What are desired outputs?

>2) Also can you provide me docs for Taking BACKUPS with DBMS_SCHEDULER?
http://tahiti.oracle.com
Re: Job Scheduler [message #493600 is a reply to message #493596] Tue, 08 February 2011 23:54 Go to previous messageGo to next message
muktha_22
Messages: 527
Registered: December 2009
Senior Member
Hi Blackswan,

For explaining some newcomers,
1) I just need to create a SCHEDULER for create a Table in next 2 min.

Regards:
Muktha
Re: Job Scheduler [message #493601 is a reply to message #493600] Wed, 09 February 2011 00:00 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>1) I just need to create a SCHEDULER for create a Table in next 2 min.
WHY in next 4 minutes the job will fail.

DDL is fired once & then no more.
Why is SCHEDULER part of solution.?

Re: Job Scheduler [message #493615 is a reply to message #493600] Wed, 09 February 2011 01:39 Go to previous message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
muktha_22 wrote on Wed, 09 February 2011 06:54
Hi Blackswan,

For explaining some newcomers,
1) I just need to create a SCHEDULER for create a Table in next 2 min.

Regards:
Muktha

See DBMS_JOB for this.

Regards
Michel

[Updated on: Wed, 09 February 2011 01:40]

Report message to a moderator

Previous Topic: ora-39082
Next Topic: Import dump
Goto Forum:
  


Current Time: Fri Apr 19 19:23:04 CDT 2024