Home > database >  Oracle creates a regular job in the test environment normal execution, but are not performed in the
Oracle creates a regular job in the test environment normal execution, but are not performed in the

Time:09-20

Oracle creates a regular job in the test environment normal execution, but are not performed in the formal environment, also looked at the job_queue_processes value is 5, only three jobs,

CodePudding user response:

Stick to create the script for the JOB

CodePudding user response:

Declare
V_jobnum number;
V_job number;
The begin
SELECT COUNT (*), MAX (JOB) INTO V_JOBNUM, V_JOB FROM USER_JOBS WHERE UPPER (I)='P_REFORM_TABLE; ';
If v_jobnum & gt; 0 then
Dbms_job. Remove (v_job);
end if;

SELECT COUNT (*), MAX (JOB) INTO V_JOBNUM, V_JOB FROM USER_JOBS WHERE UPPER (I)='ES_DBA. P_ALL_JOBS; ';
If v_jobnum & gt; 0 then
Dbms_job. Remove (v_job);
end if;

/* create an ORACLE JOB tasks regularly, every night at 0:00 automatic call P_ALL_JOBS process */
Dbms_job. Submit (job=& gt; V_jobnum, what=& gt; 'ES_DBA. P_ALL_JOBS; ', next_date=& gt; TRUNC (SYSDATE + 1), the interval=& gt; 'TRUNC (SYSDATE) + 1');

Commit;
end;

exit;

CodePudding user response:

reference 1st floor yaiger response:
a stick to create the script for the JOB
declare
V_jobnum number;
V_job number;
The begin
SELECT COUNT (*), MAX (JOB) INTO V_JOBNUM, V_JOB FROM USER_JOBS WHERE UPPER (I)='P_REFORM_TABLE; ';
If v_jobnum & gt; 0 then
Dbms_job. Remove (v_job);
end if;

SELECT COUNT (*), MAX (JOB) INTO V_JOBNUM, V_JOB FROM USER_JOBS WHERE UPPER (I)='ES_DBA. P_ALL_JOBS; ';
If v_jobnum & gt; 0 then
Dbms_job. Remove (v_job);
end if;

/* create an ORACLE JOB tasks regularly, every night at 0:00 automatic call P_ALL_JOBS process */
Dbms_job. Submit (job=& gt; V_jobnum, what=& gt; 'ES_DBA. P_ALL_JOBS; ', next_date=& gt; TRUNC (SYSDATE + 1), the interval=& gt; 'TRUNC (SYSDATE) + 1');

Commit;
end;

exit;

CodePudding user response:

Writing is a little problem
SELECT COUNT (*), MAX (JOB) INTO V_JOBNUM, V_JOB FROM USER_JOBS WHERE UPPER (I)='P_REFORM_TABLE; ';
If v_jobnum & gt; 0 then
Dbms_job. Remove (v_job);
end if;

SELECT COUNT (*), MAX (JOB) INTO V_JOBNUM, V_JOB FROM USER_JOBS WHERE UPPER (I)='ES_DBA. P_ALL_JOBS; ';
If v_jobnum & gt; 0 then
Dbms_job. Remove (v_job);
end if;
This writing will put itself also delete this JOB to should transform itself rule out?

CodePudding user response:

reference 4 floor yaiger response:
writing a bit of a problem
SELECT COUNT (*), MAX (JOB) INTO V_JOBNUM, V_JOB FROM USER_JOBS WHERE UPPER (I)='P_REFORM_TABLE; ';
If v_jobnum & gt; 0 then
Dbms_job. Remove (v_job);
end if;

SELECT COUNT (*), MAX (JOB) INTO V_JOBNUM, V_JOB FROM USER_JOBS WHERE UPPER (I)='ES_DBA. P_ALL_JOBS; ';
If v_jobnum & gt; 0 then
Dbms_job. Remove (v_job);
end if;
This writing will put itself also delete this JOB to should transform itself rule out?
should not writing problem, also can automatically perform the test database, show script no problem; Formal database, also can be carried out manually, just in the official database automatically perform not,

CodePudding user response:

You this kind of writing, but did not specify which you want to delete the JOB, take a value of MAX (JOB)
The JOB in the test library and formal environment is likely to be different, test library MAX (JOB) is likely to be A, A formal environment is likely to be take his JOB in itself

CodePudding user response:

What is the purpose of this JOB are you? Look very vague, only delete a JOB, but the JOB isn't specified

CodePudding user response:

refer to 7th floor yaiger response:
you what is the purpose of this JOB? Look very vague, only delete a JOB, and the JOB is not specify
this JOB is mainly to log into the current table operations to history table and empty,

CodePudding user response:

refer to 7th floor yaiger response:
you what is the purpose of this JOB? Look very vague, only delete a JOB, and the JOB is not specify
I want to perform the JOB is 9, so take the value of the script is MAX (JOB) is going to have a problem, and tests on the library JOB is 11, and just 11 this JOB is one of the biggest, so there is no problem?

CodePudding user response:

Didn't understand your logic, mapping is formal or test environment?
From the map view, will delete JOB11, if itself is 11, will be removed the itself, why no problem?
In addition JOB10 don't have to delete it?

If your goal is' to log into the current table operations to history table and empty, 'why do you want to generate multiple JOB to deal with? A JOB can be done



references 9 f mingminglove1946 response:
Quote: refer to 7th floor yaiger response:

What is the purpose of this JOB are you? Look very vague, only delete a JOB, and the JOB is not specify
I want to perform the JOB is 9, so take the value of the script is MAX (JOB) is going to have a problem, and tests on the library JOB is 11, and just 11 this JOB is one of the biggest, so there is no problem?
  • Related