SQL & PL/SQL :: ORA-31603 When Using DBMS_JOB.SUBMIT
Jul 5, 2013
I'm using dbms_metadata.get_ddl inside a package and I have a problem: if I execute the package directly, like "exec pkg_util.read_ddl('TA_DL_IDP', 'RMI_KUNDE') it works fine.
If I submit the same procedure using DBMS_JOB.SUBMIT, I get an error: Err_ -31603 - MSG: ORA-31603: object "RMI_KUNDE" of type TABLE not found in schema "TA_DL_IDP"
I know that in order to use dbms_metadata.get_ddl I need to have SELECT_CATALOG_ROLE and I know about the necessity to give explicit grants to objects rather than using roles when running pl/sql code from inside a package, but this is different: the different behavior is between running the same package in foreground and submitting it using DBMS_JOB.SUBMIT.
Discreet use of dbms_job.submit (to call a procedure), can be used to multi thread several instances of same proc in pl sql. I am able to do it.The problem is that dbms_output.put_line of the proc which is multi threaded does not reflects in the outer proc (the proc which parallels this proc and then waits for their completion).How do I receive the output?
'Can we pass a dynamic collection variable to the procedure that is called from dbms_job.submit'
I have a package my_package with:
1. record type: ocv_rec
2. collection type: varr_ocv_rec varray(100) of ocv_rec
3. record type: ext_id_rec
4. collection type: varr_ext_id_rec table of ext_id_rec index by pls_integer
5. procedure: analyze_error_152_ll
6. procedure: get_ext_ids_152( v_db_ssa_dtl in varr_ocv_rec, ext_id_type in varchar2, ext_ids out varr_ext_id_rec)
Now here is where the issue resides:Within the definition of analyze_error_152_ll (in body of my_package), I call get_ext_ids_152 using dbms_job.submit
I have user U1 with dblink DBL1 (private dblink, not public).
CODECREATE DATABASE LINK DBL1 CONNECT TO U1 IDENTIFIED BY XX USING 'TNS1';
I have user U2 with dblink DBL2 (private dblink, not public).
CODECREATE DATABASE LINK DBL2 CONNECT TO U2 IDENTIFIED BY XX USING 'TNS2';
Both dblinks works fine, it means I can do select.
When I logged in with U1 and try to execute the following statement :
CODESELECT SYS.DBMS_METADATA.GET_DDL('DB_LINK',OBJECT_NAME) FROM SYS.USER_OBJECTS WHERE OBJECT_TYPE = 'DATABASE LINK' AND OBJECT_NAME = 'DBL1';
I get ORA-31603 error:
CODEORA-31603: object "DBL1" of type DB_LINK not found in schema "U1" ORA-06512: at "SYS.DBMS_METADATA", line 4018 ORA-06512: at "SYS.DBMS_METADATA", line 5843 ORA-06512: at line 1
same happens when I pass user name to get_ddl:
CODESELECT SYS.DBMS_METADATA.GET_DDL('DB_LINK',OBJECT_NAME, [b]USER[/b]) FROM SYS.USER_OBJECTS WHERE OBJECT_TYPE = 'DATABASE LINK' AND OBJECT_NAME = 'DBL1';
When I select from user_objects with the following query , it is there.
CODESELECT * FROM SYS.USER_OBJECTS WHERE OBJECT_TYPE = 'DATABASE LINK' AND OBJECT_NAME = 'DBL1';
DBMS_METADATA.GET_DDL works for every other objects of U1 (tables, views, ... for example) except for dblinks. DBMS_METADATA.GET_DDL works for every objects of U2, includes DBL2.
I tried to add "select catalog role" to U1, even when I know that I need it only for objects from other users.
I tried to create DBL2 in U1 - same results.
I tried to re-create dblink using full connection string - with same result.
I have user U1 with dblink DBL1 (private dblink, not public).When I logged in with U1 and try to execute the following statement :
SELECT SYS.DBMS_METADATA.GET_DDL('DB_LINK',OBJECT_NAME) FROM SYS.USER_OBJECTS WHERE OBJECT_TYPE = 'DATABASE LINK' AND OBJECT_NAME = 'DBL1';
I get ORA-31603 error:
ORA-31603: object "DBL1" of type DB_LINK not found in schema "U1" ORA-06512: at "SYS.DBMS_METADATA", line 4018 ORA-06512: at "SYS.DBMS_METADATA", line 5843 ORA-06512: at line 1
DBL1 script is as follows:
CREATE DATABASE LINK DBL1 CONNECT TO U1 IDENTIFIED BY XX USING 'TNS1';
when I select from user_objects with the following query , it is there.
SELECT * FROM SYS.USER_OBJECTS WHERE OBJECT_TYPE = 'DATABASE LINK' AND OBJECT_NAME = 'DBL1';
DBMS_METADATA.GET_DDL works for every other objects (tables for example) in this schema except for dblinks.
We have Data Migration for our application coded in PL/SQL. The DB server has 64 Cores available (Solaris 10 OS) however running the migration code written as a function, utilizes very little CPU and CPU utilization is to max 2%. To utilize CPU power available to increase the speed of migration, we are using DBMS_JOB to schedule this function multiple times.
However scheduling the function 10 times, we are seeing that at any moment only 4/5 oracle processes are active and utilizing the CPU and CPU utilization has gone up to 5-6%. The speed of migration is increased but not to a great extend which I feel would work if we could utilize more CPU.
I see a parameter job_queue_processes is set to 10 currently in the database and am planning to increase this (currently to 25 as I don't have exact count of how many other jobs may be running in the database).
I have to change the execution of a job, I have the sys access.The job is in another user, say scott.how to use dbms_change using sys account to change the execution of a job in Scott user..
We have a bunch of jobs scheduled using DBMS_JOB (yes, I know I should be using DBMS_SCHEDULER, but we haven't migrated there yet). We are running Oracle 11.2.0.3 on Windows Server 2003 x64.
For example, we have a job that is supposed to run every Wednesday at 20:00. The Interval we have set up is "NEXT_ DAY (TRUNC(SYSDATE), 'WEDNESDAY')+20/24". This has been working as intended. Today (Monday), however, the job kicked off at 11:52. It was the wrong day and the wrong time.
I don't see anything weird in my alert log. Where else should I check to figure out why this job ran today?
JOB LAST_DATE LAST_SEC NEXT_DATE NEXT_SEC INTERVAL WHAT 293 1/7/2013 11:52:46 AM 11:52:46 1/9/2013 8:00:00 PM 20:00:00 NEXT_DAY(TRUNC(SYSDATE), 'WEDNESDAY')+20/24 ACQUISITIONS.WORKLOAD_STATUS_UPDATE_NOTIF;
My requirement is I have placed a check Box in the Detailed Block and i have assigned values for the check box as
Checked - R Unchecked - P Initial Value - R
by default the check box would be displayed as Checked while inserting the values in to table the value of check box is not getting inserted but when the check box is unchecked the the value is getting inserted as P when the submit button is pressed.
My current system have 1 submit button with single form. This submit button will call *file_content.upload*.
htp.p('function on_submit() {'); htp.p('...the rest of my code here..'); htp.p('document.forms[0].submit();'); htp.p('return true;'); htp.p('}'); htp.p('<form enctype="multipart/form-data" method="post" action="file_content.upload">'); htp.p('...the rest of my code here..'); htp.p('<input type="button" id="btn_Submit" value="Submit" onclick="on_submit()"></form>');
My question is, i want to enhance this by adding additional 1 submit button with value "Save". But this new "Save" button will call/trigger different file. This new button will call *file_content.update*. How to accomplish this and how to differentiate these 2 button?
i m using apex 4.1, and want to submit page when page load. i tried dynamic action but it continuously refreshing page. is there any other javascript or anything else from which i submit page on load
dynamic action used, event on load and action submit page but it continuously submitting page.
we had one problem one of oracle job scheduled using dbms_job was inactive for so long time,As one of our developer noticed this and reached me as i checked the dba_job was running without an process
SQL> select sid,serial#,paddr from gv$session where osuser='oracle';
I was monitoring a database job to collect statistics, it was scheduled using DBMS_JOBS..I found that it was running during business hours so i got the session ID of the job using;
select sid from dba_jobs_running where job=11;
I then i killed the job using;
select serial# from v$session where sid =232; alter system kill session '232, 10852'; select sid from dba_jobs_running where job=11;
no rows selected...After some time i again fired the same command
select sid from dba_jobs_running where job=11;
SID ---------- 232
and found that the same job is again running..This behavior was repeated again N again. i have attached the spool file for the same...
what could be the reason that the job is starting all over again even after killing the session and what should be done to stop it..I understand that once the database shuts down and if the job is still running then it will restart once the database is up..In this case, Should i remove the job and re submit it again..
I have created a stored procedure that checks if a file exists and gets a date from the file if it exists. The date is then used as a paramter. See below:
CODEcreate or replace PROCEDURE "P_Load_Stamp" AS v_exists BOOLEAN; v_length NUMBER; v_blocksize NUMBER;
[code]...
The above codes works perfectly and I scheduled it using SQLPLUS as follows:
CODEvariable jobno number; variable instno number; begin select instance_number into :instno from v$instance;
[code]...
My problem is that I need to pass the date from the above procedure as a parameter to another stored procedure. So I modified my code as follows (the parts in red):
CODEcreate or replace PROCEDURE "P_Load_Stamp" (vCTIDATE OUT varchar2) AS v_exists BOOLEAN; v_length NUMBER;
[code]...
Now it doesn't strike me as a rights issue since I created it in the schem schema. What could I be doing wrong here?
I am creating 5 dbms_job at run time in side a stored procedure.But when I execute that procedure, all the job get 100%cpu and as a result other process does not get response. so my question is can we limit the dbms_job to use a defined amount of cpu%.
Holiday_master table has the list of holiday dates as "From_Date"
I have the form based on the Leave_Transaction Table, and I have created the Process, as "On-submit-after computations and validations" and posted the following PLSQL code,
declare days number(3); ex_days emp_master.remaining_days%type; new_rem_days emp_master.remaining_days%type; begin
[code]....
If the Dates is between from_date and To_date comes in Saturday and sunday and/or if any Date is exist in the Hpliday_master table it will exclude and return the count(*) remaining dates, For example,
If the From_date is 04-may-2012' and To_date is 08-may-2012,
Here the dates 5th may and 6th may are "saturday" and "sunday"
and if any date between From_date and To_date is exist in Holiday_Master Table i.e say here it is 07-may-2012, Then the remaining dates are(excluding sat,sunday and dates in holiday_table),
04-may-2012, 08-may-2012.
so the count(*) is 2.
I am using the above code but still it returning 5,I think this
...where to_char(dt,'fmday') not in ('sunday','saturday') minus (select holiday_start from holiday_master))
I have a scroll bar in my form. When i scroll the bar, one of SUBMIT buttons which is disabled gets enabled automatically. Do we have any triggers on scroll bar where i can disable the button again.
I have created two page process with two buttons "APPROVE" AND "CANCEL" button. first page process running approve invoice procedure on approve button and second page process running cancel invoice procedure on cancel button. i want to display massage before approve invoice and cancel invoice (DO you want to approve invoice) on approve button and (Do you want to cancel invoice on ) cancel button.
How i can show the new added rows to tabular form after submit? what I want is to show my customer new added rows that recently added. but according to how I sort the tabular form, the new added rows distributed in multi pagination in tabular form. I'm not good in English, excuse me for my mistakes. I use apex 4.2.0 On Oracle 11g r2 on windows Server 2008
We have an application that has "After Submit" and AJAX "On-Demand" processes. We need the "After Submit" to fire and complete first, set an application item (by referencing the next value in a sequence), and then fire the "On-Demand" processes. We have the sequence number set accordingly, with all of the "After Submit" processes given a lower (APEX) sequence number than the "On-Demand" processes; however, it seems the "After Submit" processes are still not firing and completing because only intermittently are the "On-Demand" processes able to access the application item's value--80% of the time this value is simply blank. Making matters more complicated is that the application item is derived from an Oracle sequence, so in my "On-Demand" processes, I cannot simply re-run some of the same logic used in one of the "After Submit" processes that sets the sequence--the sequence may only be set once, and only by this "After Submit" process; we have no choice in that regard. Is there any way possible in APEX to 100% force processes to fire AND complete, one after another, in the order in which they are listed by their (APEX) sequence? In other words, if we have this:
(APEX) Seq Name & Process Type
1 process A ("After Submit") 2 process B ("After Submit")--this sets application item :XYZ 3 process C ("On-Demand)--this uses application item :XYZ and MUST have this item value available to do any processing Can we instruct APEX to fire process A, complete it, fire process B, complete it, and only then, fire process C?