info of parallel execution in the plan of the explain command
In terms of explaining it, he learns you if a query is running in parallel? If so, what parts give you information about parallel execution?
a parallel plan contains a large number of obvious differences if compared to a corresponding series plan: you should see a few operations beginning with the prefix of PX. In addition, it is more difficult to interpret a plane parallel (at least for me). Randolf Geist explains the basics (and more) in his informative article: parallel understanding - execution part 1.
Tags: Database
Similar Questions
-
graphic execution using the unix command
I'm new to endeca3.1
is there an available way to run the chart using the unix command?
How can I plan the graph in the cron tab?
Take a look at the Guide to the Integrator ETL server (Server CloverETL), Chapter 6, Scheduling and also chapter 14 on the Simple HTTP API. This should allow you to plan or call graphical ETL published to the server.
http://docs.Oracle.com/CD/E40518_01/Integrator.311/IntegratorServerGuide.PDF
-
Help to understand the plan of the explain command
Hello world
I have a question:
INSERT INTO ICM_UPSEL_1_ALL
Select a.customer_no, a.pr_code_bbl, pr_code_pmm, a.score, a.price_diff, a.flag (b.pr_code_pmm) min
ICM_UPSEL_MIN_PRDIFF_1 a, icm_pre b
where a.customer_no = b.customer_no
and a.pr_code_bbl = b.pr_code_bbl
and a.score = b.score
and a.flag = b.flag
and a.price_diff = b.price_diff
and b.price_diff > 0
and b.score > = 0.5
and b.flag = 1
and b.price_diff > 0 and b.price_diff < = 10
Group of a.customer_no, a.pr_code_bbl, a.score, a.price_diff, a.flag
This query runs in a pl/sql procedure. The plan of the explain for this query command is:
Hash value of plan: 3124235498
------------------------------------------------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
------------------------------------------------------------------------------------------------------------------
| 0 | INSERT STATEMENT. | 1. 143. 4 (25) | 00:00:01 |
| 1. LOAD TABLE CLASSIC | ICM_UPSEL_1_ALL | | | | |
| 2. HASH GROUP BY. | 1. 143. 4 (25) | 00:00:01 |
| 3. NESTED LOOPS | | | | | |
| 4. NESTED LOOPS | | 1. 143. 3 (0) | 00:00:01 |
|* 5 | TABLE ACCESS BY INDEX ROWID | ICM_UPSEL_MIN_PRDIFF_1 | 1. 65. 1 (0) | 00:00:01 |
|* 6 | INDEX RANGE SCAN | MPD_1_FLAG_IDX | 1. | 1 (0) | 00:00:01 |
|* 7 | INDEX RANGE SCAN | ICM_PRE_FLAG_IDX | 1. | 2 (0) | 00:00:01 |
|* 8 | TABLE ACCESS BY INDEX ROWID | ICM_PRE | 1. 78. 2 (0) | 00:00:01 |
------------------------------------------------------------------------------------------------------------------
Information of predicates (identified by the operation identity card):
---------------------------------------------------
5 - filter("A".") PRICE_DIFF"> 0 AND 'A '. "SCORE" > = 0.5 AND 'A' "." " (PRICE_DIFF"< = 10)
6 - access("A".") FLAG "= 1)
7 - access("B".") FLAG "= 1)
8 - filter("B".") PRICE_DIFF"< = 10 AND 'B '. "SCORE" > = 0.5 AND 'B' "." " PRICE_DIFF"> 0 AND
"A"." CUSTOMER_NO '=' B '. "' CUSTOMER_NO ' AND 'A '. "" PR_CODE_BBL "=" B ". "' PR_CODE_BBL ' AND 'A '. "SCORE" = 'B' "." " SCORE '.
AND 'A '. "" PRICE_DIFF "=" B ". ("' PRICE_DIFF")
This query runs for 10 hours now and still no results. Could someone please help me where goes wrong... Why is - it take as long to insert data...
The number of rows in ICM_UPSEL_MIN_PRDIFF_1: 84 858
The number of rows in icm_pre: 455,500,944
All columns are indexed.
My version of the database is 11.1.0.6 running on windows server 2003 R2.
Thanks in advance
This plan seems much more suitable for me: instead of doing > 80 K of the loops of the CBO now decides to make a unique HASH JOIN. I would try to run the operation with the dynamic_sampling flag. If the system statistics are not completely misleading the operation now only takes a few minutes (and no 10: 00 >).
Concerning
Martin
-
Tuning SQL - do not understand the plan of the explain command.
Hi all
I use 11g R2 and I have 2 questions about the setting of a query.
My relevant parameters for the optimizer are:BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production PL/SQL Release 11.2.0.3.0 - Production CORE 11.2.0.3.0 Production TNS for 64-bit Windows: Version 11.2.0.3.0 - Production NLSRTL Version 11.2.0.3.0 - Production
The query I want to run is quite simple. It returns a few exceptions with a filter.NAME TYPE VALUE ------------------------------------ ----------- ----------------------- -- optimizer_capture_sql_plan_baselines boolean FALSE optimizer_dynamic_sampling integer 2 optimizer_features_enable string 11.2.0.3 optimizer_index_caching integer 0 optimizer_index_cost_adj integer 100 optimizer_mode string ALL_ROWS optimizer_secure_view_merging boolean TRUE optimizer_use_invisible_indexes boolean FALSE optimizer_use_pending_statistics boolean FALSE optimizer_use_sql_plan_baselines boolean TRUE
The execution plan is the following:SELECT ERO.DVC_EVT_ID, E.DVC_EVT_DTTM FROM D1_DVC_EVT E, D1_DVC_EVT_REL_OBJ ERO WHERE ERO.MAINT_OBJ_CD = 'D1-DEVICE' AND ERO.PK_VALUE1 = :H1 AND ERO.DVC_EVT_ID = E.DVC_EVT_ID AND E.DVC_EVT_TYPE_CD IN ('END-GSMLOWLEVEL-EXCP-SEV-1', 'STR-GSMLOWLEVEL-EXCP-SEV-1') ORDER BY E.DVC_EVT_DTTM DESC;
So, as you can see, rank 8, I have a TABLE ACCESS BY GLOBAL INDEX ROWID. But what I am failling to see is how Oracle display an ACCESS BY GLOBAL INDEX ROWID TABLE without using any index. As the thought that Oracle has always been a ROWID due to an index.Plan hash value: 3627978539 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | Id | Operation | Name | Starts | E-Rows |E-Bytes| Cost (%CPU)| Pstart| Pstop | A-Rows | A-Time | Buffers | Reads | OMem | 1Mem | Used-Mem | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | | | 7131 (100)| | | 1181 |00:00:17.17 | 8627 | 2978 | | | | | 1 | SORT ORDER BY | | 1 | 3137 | 275K| 7131 (1)| | | 1181 |00:00:17.17 | 8627 | 2978 | 80896 | 80896 |71680 (0)| | 2 | NESTED LOOPS | | 1 | | | | | | 1181 |00:00:17.16 | 8627 | 2978 | | | | | 3 | NESTED LOOPS | | 1 | 3137 | 275K| 7130 (1)| | | 2058 |00:00:08.09 | 6709 | 1376 | | | | | 4 | TABLE ACCESS BY INDEX ROWID | D1_DVC_EVT_REL_OBJ | 1 | 3137 | 125K| 845 (1)| | | 2058 |00:00:04.37 | 820 | 799 | | | | |* 5 | INDEX RANGE SCAN | D1T404S0 | 1 | 3137 | | 42 (0)| | | 2058 |00:00:00.08 | 27 | 23 | | | | | 6 | PARTITION RANGE ITERATOR | | 2058 | 1 | | 1 (0)| KEY | KEY | 2058 |00:00:03.69 | 5889 | 577 | | | | |* 7 | INDEX UNIQUE SCAN | D1T400P0 | 2058 | 1 | | 1 (0)| KEY | KEY | 2058 |00:00:03.66 | 5889 | 577 | | | | |* 8 | TABLE ACCESS BY GLOBAL INDEX ROWID| D1_DVC_EVT | 2058 | 1 | 49 | 2 (0)| ROWID | ROWID | 1181 |00:00:09.05 | 1918 | 1602 | | | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Peeked Binds (identified by position): -------------------------------------- 1 - (VARCHAR2(30), CSID=178): '271792300706' Predicate Information (identified by operation id): --------------------------------------------------- 5 - access("ERO"."PK_VALUE1"=:H1 AND "ERO"."MAINT_OBJ_CD"='D1-DEVICE') filter("ERO"."MAINT_OBJ_CD"='D1-DEVICE') 7 - access("ERO"."DVC_EVT_ID"="E"."DVC_EVT_ID") 8 - filter(("E"."DVC_EVT_TYPE_CD"='END-GSMLOWLEVEL-EXCP-SEV-1' OR "E"."DVC_EVT_TYPE_CD"='STR-GSMLOWLEVEL-EXCP-SEV-1'))
I also have an index on the DVC_EVT_TYPE_CD column in my table (line 8 of the predicate information section)
And finally, what would be your suggestions to improve the performance of this query...
Thank you very much.If I read content (RowSource) statistical information and plan properly, then access the table in step 4 on D1_DVC_EVT_REL_OBJ needs dry 4.37 and accesses 820 buffers. If you had an index D1_DVC_EVT_REL_OBJ (MAINT_OBJ_CD, PK_VALUE1, DVC_EVT_ID) I guess this table access could be avoided. To avoid the access of the table on D1_DVC_EVT an index on D1_DVC_EVT (DVC_EVT_ID, DVC_EVT_TYPE_CD, DVC_EVT_DTTM) should be sufficient.
I think that these indices would improve the performance of the query, but of course, they would have a negative impact on the performance of DML on the table and they could influence other queries on the table.
-
Hello world
I have a little a problem of performance on 12 c that gives me a little trouble at the head. I moved from 11 to 12 databases and no amendment of the application have been made. Our requests are generated somewhat dynamically, so that they are the same thing every time.
Let's start with the execution plan I get:
SQL > select * from table (dbms_xplan.display ());
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hash value of plan: 3567104424
-----------------------------------------------------------------------------------------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time | TQ | IN-OUT | PQ Distrib.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 55. 7095 | 3764 (1) | 00:00:01 | | | |
| 1. COORDINATOR OF PX | | | | | | | | |
| 2. PX SEND QC (ORDER). : TQ10006 | 55. 7095 | 3764 (1) | 00:00:01 | Q1, 06 | P > S | QC (ORDER).
| 3. SORT ORDER BY | | 55. 7095 | 3764 (1) | 00:00:01 | Q1, 06 | SVCP | |
| 4. PX RECEIVE | | 55. 7095 | 3763 (1) | 00:00:01 | Q1, 06 | SVCP | |
| 5. RANGE OF SEND PX | : TQ10005 | 55. 7095 | 3763 (1) | 00:00:01 | Q1, 05 | P > P | RANGE |
| 6. UNIQUE FATE | | 55. 7095 | 3763 (1) | 00:00:01 | Q1, 05 | SVCP | |
|* 7 | HASH JOIN | | 55. 7095 | 3762 (1) | 00:00:01 | Q1, 05 | SVCP | |
| 8. PX RECEIVE | | 801 | 50463 | 3696 (1) | 00:00:01 | Q1, 05 | SVCP | |
| 9. PX SEND HASH | : TQ10003 | 801 | 50463 | 3696 (1) | 00:00:01 | Q1, 03 | P > P | HASH |
| * 10 | HASH JOIN | | 801 | 50463 | 3696 (1) | 00:00:01 | Q1, 03 | SVCP | |
| 11. RECEIVE PX | | 801 | 40851 | 2333 (1) | 00:00:01 | Q1, 03 | SVCP | |
| 12. PX SEND BROADCAST | : TQ10002 | 801 | 40851 | 2333 (1) | 00:00:01 | Q1, 02 | P > P | BROADCAST |
| 13. NESTED LOOPS | | 801 | 40851 | 2333 (1) | 00:00:01 | Q1, 02 | SVCP | |
| 14. KIND OF BUFFER. | | | | | Q1, 02 | ISSUE | |
| 15. RECEIVE PX | | | | | | Q1, 02 | SVCP | |
| 16. PX SEND HASH | : TQ10000 | | | | | | S > P | HASH |
| 17. NESTED LOOPS | | 823. 31274 | 1509 (1) | 00:00:01 | | | |
| * 18. TABLE ACCESS BY ROWID INDEX BATCH | PAGED_LOOKUP_PKS | 500 | 9500 | 3 (0) | 00:00:01 | | | |
| * 19. INDEX RANGE SCAN | PAGED_LOOKUP_PKS_IDX2 | 1. | 2 (0) | 00:00:01 | | | |
| 20. TABLE ACCESS BY ROWID INDEX BATCH | BILL_ITEM | 2. 38. 4 (0) | 00:00:01 | | | |
| * 21. INDEX RANGE SCAN | BILL_ITEM_FK2 | 4. | 2 (0) | 00:00:01 | | | |
| * 22. INDEX UNIQUE SCAN | PK_INSERTION | 1. 13. 1 (0) | 00:00:01 | Q1, 02 | SVCP | |
| 23. ITERATOR BLOCK PX | | 1548K | 17 M | 1353 (2) | 00:00:01 | Q1, 03 | ISSUE | |
| 24. FULL RESTRICTED INDEX SCAN FAST | BOOKING_ACCOUNT_1 | 1548K | 17 M | 1353 (2) | 00:00:01 | Q1, 03 | SVCP | |
| 25. PX RECEIVE | | 22037 | 1420K | 65 (2) | 00:00:01 | Q1, 05 | SVCP | |
| 26. PX SEND HASH | : TQ10004 | 22037 | 1420K | 65 (2) | 00:00:01 | Q1, 04 | S > P | HASH |
| 27. SELECTOR PX | | | | | | Q1, 04 | SCWC | |
| 28. TABLE ACCESS FULL | CONTACT | 22037 | 1420K | 65 (2) | 00:00:01 | Q1, 04 | SCWP | |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Information of predicates (identified by the operation identity card):
---------------------------------------------------
7 - access ("ACCOUNT_ID" ="ACCOUNT_ID")
10 - access ("BOOKING" ="BOOKING")
18 - filter("T1".") SEQUENCE_NO' < 501 AND "T1". ("' SEQUENCE_NO" > = 1).
19 - access("T1".") SESSION_ID '= 123456 AND 'T1'.' SEARCH_ID "= 25)
21 - access("T1".") N1 "=" BILL_ID")
22 - access ("BOOKING" = "BOOKING" AND "INSERTION_SET" = "INSERTION_SET" AND "INSERT"="INSERT")
Note
-----
-the dynamic statistics used: dynamic sampling (level = 2)
-This is an adaptation plan
-2 directives Plan Sql used for this statement
51 selected lines.
Elapsed time: 00:00:00.15
SQL > spool off
OK, now let's go through the problem:
- It's a development running on a virtual server, and which hosts a few other databases, so the parallel execution is not a good thing. parallel_degree_policy is set to MANUAL, parallel_max_servers and all other parallel_ limits are set to 1 and tables have been changed with the settings of NOPARALLEL. So why is the execution plan always generated with all stages of parallel execution? I don't seem to get rid of in 12 c
- Next mystery is that the said plan of the explain command is an adaptation plan, and yet I put the true optimizer_adaptive_reproting_only
- Now to the problem of effective enforcement, so I'm playing around with all these settings. The query runs for 3-4 seconds, returning around about 500 cases. However, in some cases this same query with the same input variable races for hours and if I can believe the AWR and ASH reports, read a good 180 GB of data. The main wait event is direct path read temp temp and writing.
This is not isolated to that one query. I have a few queries now that all display the same behavior, one of them running overnight. I don't seem to get to a standard nested loop execution plans.
The entire base is a database plug-in and I don't know I just missed something in the new features Guide.
Would appreciate some ideas.
Thank you
If you want to disable parallel execution, you must set parallel_max_servers to zero. Maybe the optimizer thinks he can use a parallel plan because parallel_max_servers is non-zero (even though the number of slaves available means that it will be serialized to a parallel plan).
Note that you have a ticket saying dynamic stats have been used. Maybe you have a 11 for optimizer_dynamic_sampling setting, and allowing Oracle to be very inventive with collection of samples and parallelism.
You have also 2 SQL instructions in game. These are the things that get associated with objects rather than the instructions, then perhaps someone has been playing with parallelism and managed to associate the parallelism with one of the tables in your query (I am not sure 100% that it is possible, just throw a suggestion). Take a look at the SQL used for education guidelines.
To give us a little more information, you can:
Shoot memory execution plan dbms_xplan.display_cursor ({sql_id}, {number of children}, 'ALL'));
We show all the parallel settings (see setting the parallel)
Pull on the parameters of the optimizer for query memory (select name, value of V$ sql_optimizer_env where sql_id = {your sql identifier} and child_number = {your child number})
Concerning
Jonathan Lewis
-
Two parallel executions, calling a DLL function
Hello
Since this test takes about 6 hours to test my USE, I plan to use the parallel model to test 2 UUT at the same time in parallel.
I implement the test code as a DLL of CVI.
However, to my surprise, it seems that the steps that call a DLL function actually traveled in one series, not in parallel:
Test 2 power outlets if one enters and executes a DLL works, the other waits for the first to complete its operation and return. While the other runs on the same copy of the DLL, so that the DLL global variables are actually shared between executions.
So if a DLL will take 5 minutes to complete, two executions in the running at the same time take 10 minutes. This isn't a running in parallel in every way.
What I want and expect also TestStand, was to completely isolate the copies of these two executions DLL such as test two casings could run at the same time the same DLL function by arbitrary executiong their copy of the function, completely isolated from one another.
So they separated globals, discussions, etc., and two parallel jacks take 5 minutes to run a step, instead of 10.
Such a scenario is possible?
If not, how can I use my test in parallel (in truly parallel) when the use of 2-socket test?
(1) Yes, he'll call the multiple executions in TestStand calling into the same dll in memory the same copy of this DLL. Thus dll called in this way must be thread-safe (that is written in a way that is safe for multiple threads running the code at the same time). This means usually avoiding the use of global variables among other things. Instead, you can store the thread shows in local variables within your sequence and pass it in the dll as a parameter as needed. Keep in mind all the DLLs your dll calls must also be thread-safe or you need to synchronize calls in other DLLs with locks or other synchronization primitives.
1 (b) even if your dll are not thread-safe, you might still be able to get some benefits from parallel execution using the type of automatic planning step and split your sequence in independent sections, which can be performed in an order any. What it will do is allow you to run Test a socket A and B Test to another socket in parallel, and then once they are then perhaps test B will take place on one and test one run on the other. In this way, as long as each test is independent of the other you can safely run them in parallel at the same time even if it is not possible to run the same test in parallel at the same time (that is, if you can not run test on two Sockets at the same time, you might still be able to get an advantage of parallelism by running the Test B in one take during the tests in the other. See the online help for the type of step in autoscheduling for more details).
(2) taken executions (and all executions of TestStand really) are threads separated within the same process. Since they are in the same process, the global variables in the dll are essentially shared between them. TestStand Station globals are also shared between them. TestStand Globals file, however, are not shared between runs (each run gets its own copy) unless you enable the setting in the movie file properties dialog box.
(3) course, using index as a way to distinguish data access are perfectly valid. Just be careful that what each thread does not affect data that other threads have access. For example, if you have a global network with 2 elements, one for each grip test, you can use safely the decision-making of index in the table and in this way are not sharing data between threads even if you use a global variable, but the table should be made from the outset before start running threads , or it must be synchronized in some way, otherwise it is possible to have a thread tries to access the data, while the other thread is created. Basically, you need to make sure that if you use global data which the creation/deletion, modification and access in a thread does not affect the global data that the other thread use anyway in or we must protect these creation/deletion, modification and access to global data with locks, mutex or critical sections.
Hope this helps,
-Doug
-
Hello
I would like to know if there is any provision in oracle for procedures parallel execution in the same package. I suggested to my friend to create the DBMS work and start both at the same time to run in parallel. Apart from that we have any parallel concept of the performance/multi-threading in the oracle procedure?
Kind regards
VimalI don't know what is your procedure and why you must run in parallel, but I suggest you look at DBMS_Parallel_Execute package(11g) to perform an update in parallel or parallel Function (PARALLEL_ENABLE).
-
Parallel execution of multiple scripts
Hi all
I understand that aid of parallels that we can achieve the parallel execution of the queries(insert/update/delete).
Question of my today, I would like to know if parallelism can be achieved for the following scenario.
I have a script with an insert select statement and multiple merge statements and a few updates statements all on the same table.
I have to run this script 12 times on the same table, once for each month of the year.
Currently, we run for Jan (where record_date = '201001') commit, then run for February and so on.
Every 12 months can be executed in parallel. One way I can think is to create 12 different scripts and kicking around the opening 12 sessions SQL more (all on the same table).
Is there a better way to do this?
Note: the data for each month will not affect other other data month.
Kind regards
AJCreation of 12 different scripts would be a suboptimal solution and a maintenance nightmare. 1 set script and call 12 times with different settings would be a little better.
1 creating a stored procedure with parameters and execute that procedure in the 12 times Planner would be even better, because everything works on the side server only.Your description is deliberately vague, so the possibility of blocking cannot be excluded.
----------
Sybrand Bakker
Senior Oracle DBA -
RunAs with the /savecred option does not accept the credentials stored by the cmdkey command
Hello
I am trying to automate the storage of credentials for profiles of several people on several servers so that they can use it with scripts, they will use that have the command 'runas' with the /savecred option. I use the command "cmdkey" to store the user and the password, but when the runas command is run, it prompts for the password anyway. I know that the /savecred works since if I leave the command-line runas for the password and I enter, on subsequent runs, he is more requested for the password. Curiously, if I use the cmdkey command to replace the stored credentials, runas invite you again the password so it can store it himself. Almost as runas does not 'trust' cmdkey. Any thoughts on why this can happen and how can I get around it? I really need to automate the identification information storing or it will take a couple hundred manual executions of the runas command to get this store on the profiles of all the people in need.
Hello
The question you have posted is related to professional level support. Please visit the below mentioned link to find a community that will support what ask you:
-
There is a configuration option that allows the parallel execution of sub vi?
I'm trying to run a vi in teststand has two parallel execution paths. A path under vi implements the trigger and wait for data from a module scope, while in the other lane, I'm starting a power supply. The power waits until the scope is armed and runs.
It works as a standalone vi. When I try to run this vi in teststand he works the first vi scope and then runs the power supply. Of course vi opportunities get to expiration and outputs and data are not met.
I tried a number of methods of synchronization, and although they seem to work standalone, as soon as I try them in Testsatnd I have this problem.
I am new to teststand and I was wondering if there is some configuration config I missed which allows a vi like this to run as he's independent.
I have a number of simple screws that run as planned, but this one left me speechless.
I had to split these screws but would really prefer to have them in the same vi.
(The latest versions of teststand and Labview running)
Henry
hkroker,
It is a known problem. Please refer to the following KB to help solve your problem.
- Parallel blocks run sequentially why does my LabVIEW VI when it is called from TestStand?
Concerning
Anand jegou
National Instruments
-
Wait for the mechanism in the parallel execution of packages
Dear all,
I submit two packets in parallel as below, which works very well.
I present this in a shell script which is registered as a front end program.
Front end program completed in a second, while the data are not visible in the tables, the data is visible only when the execution of the package completed.
Please can you suggest a mechanism so that I can make the plsql block in shell script to wait for both the delivery of completed packages.
#!/bin/sh | . $CUST_TOP/bin/CUST_ID_CM.env export INFA_USER=$INFA_USER export userpass=`(echo $1 | cut -f2 -d'"' | cut -d '"' -f3)` ploadtype=$5 pyear=$7 ##################################################################### if [ "$ploadtype" = "Restatement" ]; then sqlplus -s $userpass <<EOF set heading off feedback off verify off serveroutput on spool /usr/tmp/tmp_tph_load.txt DECLARE l_cnt NUMBER; BEGIN DBMS_SCHEDULER.CREATE_JOB(job_name => 'YEARLY_RESTATEMENTS', job_type => 'STORED_PROCEDURE', job_action => 'RESTATEMENTS_DATAFEED_PKG.INSERT_RESTATEMENTS_P', number_of_arguments => 1, enabled => FALSE, auto_drop => TRUE); DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(job_name => 'YEARLY_RESTATEMENTS', argument_position => 1, argument_value => '$7'); DBMS_SCHEDULER.ENABLE('YEARLY_RESTATEMENTS'); DBMS_SCHEDULER.CREATE_JOB(job_name => 'YEARLY_ACTUALS', job_type => 'STORED_PROCEDURE', job_action => 'ACTUALS_DATAFEED_PKG.INSERT_ACTUALS_P', number_of_arguments => 1, enabled => FALSE, auto_drop => TRUE); DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE(job_name => 'YEARLY_ACTUALS', argument_position => 1, argument_value => '$7'); DBMS_SCHEDULER.ENABLE('YEARLY_ACTUALS'); LOOP SELECT COUNT(1) INTO l_cnt FROM DBA_SCHEDULER_RUNNING_JOBS WHERE UPPER(job_name) IN (UPPER('Yearly_Actuals'), UPPER('Yearly_Restatements')); EXIT WHEN l_cnt < 1; END LOOP; END; / EOF # fi exit
Your problem is the timing. You can perform the check at DBA_SCHEDULER_RUNNING_JOBS before the entry is actually in there.
Here is an example. I just submitted a PLSQL_BLOCK waiting for 60 seconds.
SQL> DECLARE 2 l_cnt NUMBER; 3 BEGIN 4 dbms_output.put_line(systimestamp || ' - Started'); 5 DBMS_SCHEDULER.CREATE_JOB(job_name => 'YEARLY_RESTATEMENTS', 6 job_type => 'PLSQL_BLOCK', 7 job_action => 'BEGIN DBMS_LOCK.SLEEP(60); END;', 8 enabled => FALSE, 9 auto_drop => TRUE); 10 DBMS_SCHEDULER.ENABLE('YEARLY_RESTATEMENTS'); 11 12 LOOP 13 SELECT COUNT(1) into l_cnt 14 FROM DBA_SCHEDULER_RUNNING_JOBS 15 WHERE UPPER(job_name) IN 16 (UPPER('Yearly_Actuals'), UPPER('Yearly_Restatements')); 17 18 EXIT WHEN l_cnt < 1; 19 dbms_output.put_line(systimestamp || ' - Waiting'); 20 dbms_lock.sleep(10); 21 END LOOP; 22 dbms_output.put_line(systimestamp || ' - Completed'); 23 END; 24 / 04-DEC-14 02.32.00.075794000 AM -05:00 - Started 04-DEC-14 02.32.00.121862000 AM -05:00 - Completed PL/SQL procedure successfully completed.
Now it ends immediately. But you can see that the job is still running.
SQL> SELECT COUNT(1) 2 FROM DBA_SCHEDULER_RUNNING_JOBS 3 WHERE UPPER(job_name) IN 4 (UPPER('Yearly_Actuals'), UPPER('Yearly_Restatements')); COUNT(1) ---------- 1
Now I make my code to wait 5 seconds before the audit
SQL> DECLARE 2 l_cnt NUMBER; 3 BEGIN 4 dbms_output.put_line(systimestamp || ' - Started'); 5 DBMS_SCHEDULER.CREATE_JOB(job_name => 'YEARLY_RESTATEMENTS', 6 job_type => 'PLSQL_BLOCK', 7 job_action => 'BEGIN DBMS_LOCK.SLEEP(60); END;', 8 enabled => FALSE, 9 auto_drop => TRUE); 10 DBMS_SCHEDULER.ENABLE('YEARLY_RESTATEMENTS'); 11 12 -- Wait for a wile before checking 13 dbms_lock.sleep(5); 14 LOOP 15 SELECT COUNT(1) into l_cnt 16 FROM DBA_SCHEDULER_RUNNING_JOBS 17 WHERE UPPER(job_name) IN 18 (UPPER('Yearly_Actuals'), UPPER('Yearly_Restatements')); 19 20 EXIT WHEN l_cnt < 1; 21 dbms_output.put_line(systimestamp || ' - Waiting'); 22 dbms_lock.sleep(10); 23 END LOOP; 24 dbms_output.put_line(systimestamp || ' - Completed'); 25 END; 26 / 04-DEC-14 02.33.09.294256000 AM -05:00 - Started 04-DEC-14 02.33.14.347866000 AM -05:00 - Waiting 04-DEC-14 02.33.24.369777000 AM -05:00 - Waiting 04-DEC-14 02.33.34.389725000 AM -05:00 - Waiting 04-DEC-14 02.33.44.410508000 AM -05:00 - Waiting 04-DEC-14 02.33.54.430561000 AM -05:00 - Waiting 04-DEC-14 02.34.04.450684000 AM -05:00 - Waiting 04-DEC-14 02.34.14.462191000 AM -05:00 - Completed PL/SQL procedure successfully completed. SQL>
Now you can see the code entered in the loop and waited.
-
I get charged $74.95 per month for the creative cloud. I am trying to cancel it, but according to my adobe account info, I'm not on a plan. How is what happens? And how can I stop Adobe to credit my credit card each month?
Kindly Contact customer you can also try: phone support | Orders, returns of trade.
Let us know if you need assistance with this.
Atul_Saini
-
appropriate using index for the execution of the parallel statement
Hi all
I created indexes for my table
That was before I started thinking about the execution of the parallel statement. As far as I've heard I need to change my correct use with parallel hint index. Could you please suggest the way forward?CREATE INDEX ZOO.rep184_med_arcdate ON ZOO.rep184_mediate(arcdate);
Marco wrote:
Hi allI created indexes for my table
CREATE INDEX ZOO.rep184_med_arcdate ON ZOO.rep184_mediate(arcdate);
That was before I started thinking about the execution of the parallel statement. As far as I've heard I need to change my correct use with parallel hint index. Could you please suggest the way forward?
When all else fails, read the Fine
http://download.Oracle.com/docs/CD/E11882_01/server.112/e17118/sql_elements006.htm#autoId63
-
Plans of multiple executions for the same SQL statement
Dear experts,
awrsqrpt. SQL shows several plans for a single SQL statement executions. How is it possible that a single SQL statement will be several Plans of executions within the AWR report.
Here is the output of the awrsqrpt for your reference.
Your contribution is very much appreciated.WORKLOAD REPOSITORY SQL Report Snapshot Period Summary DB Name DB Id Instance Inst Num Release RAC Host ------------ ----------- ------------ -------- ----------- --- ------------ TESTDB 2157605839 TESTDB1 1 10.2.0.3.0 YES testhost1 Snap Id Snap Time Sessions Curs/Sess --------- ------------------- -------- --------- Begin Snap: 32541 11-Oct-08 21:00:13 248 141.1 End Snap: 32542 11-Oct-08 21:15:06 245 143.4 Elapsed: 14.88 (mins) DB Time: 12.18 (mins) SQL Summary DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542 Elapsed SQL Id Time (ms) ------------- ---------- 51szt7b736bmg 25,131 Module: SQL*Plus UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(ACCT_DR_BAL, 0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND TEST_ACC_NB = ACCT_ACC_NB(+)) WHERE TEST_BATCH_DT = (:B1 ) ------------------------------------------------------------- SQL ID: 51szt7b736bmg DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542 -> 1st Capture and Last Capture Snap IDs refer to Snapshot IDs witin the snapshot range -> UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(AC... Plan Hash Total Elapsed 1st Capture Last Capture # Value Time(ms) Executions Snap ID Snap ID --- ---------------- ---------------- ------------- ------------- -------------- 1 2960830398 25,131 1 32542 32542 2 3834848140 0 0 32542 32542 ------------------------------------------------------------- Plan 1(PHV: 2960830398) ----------------------- Plan Statistics DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542 -> % Total DB Time is the Elapsed Time of the SQL statement divided into the Total Database Time multiplied by 100 Stat Name Statement Per Execution % Snap ---------------------------------------- ---------- -------------- ------- Elapsed Time (ms) 25,131 25,130.7 3.4 CPU Time (ms) 23,270 23,270.2 3.9 Executions 1 N/A N/A Buffer Gets 2,626,166 2,626,166.0 14.6 Disk Reads 305 305.0 0.3 Parse Calls 1 1.0 0.0 Rows 371,735 371,735.0 N/A User I/O Wait Time (ms) 564 N/A N/A Cluster Wait Time (ms) 0 N/A N/A Application Wait Time (ms) 0 N/A N/A Concurrency Wait Time (ms) 0 N/A N/A Invalidations 0 N/A N/A Version Count 2 N/A N/A Sharable Mem(KB) 26 N/A N/A ------------------------------------------------------------- Execution Plan ------------------------------------------------------------------------------------------------ | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------------------------ | 0 | UPDATE STATEMENT | | | | 1110 (100)| | | 1 | UPDATE | TEST | | | | | | 2 | TABLE ACCESS FULL | TEST | 116K| 2740K| 1110 (2)| 00:00:14 | | 3 | TABLE ACCESS BY INDEX ROWID| ACCT | 1 | 26 | 5 (0)| 00:00:01 | | 4 | INDEX RANGE SCAN | ACCT_DT_ACC_IDX | 1 | | 4 (0)| 00:00:01 | ------------------------------------------------------------------------------------------------ Plan 2(PHV: 3834848140) ----------------------- Plan Statistics DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542 -> % Total DB Time is the Elapsed Time of the SQL statement divided into the Total Database Time multiplied by 100 Stat Name Statement Per Execution % Snap ---------------------------------------- ---------- -------------- ------- Elapsed Time (ms) 0 N/A 0.0 CPU Time (ms) 0 N/A 0.0 Executions 0 N/A N/A Buffer Gets 0 N/A 0.0 Disk Reads 0 N/A 0.0 Parse Calls 0 N/A 0.0 Rows 0 N/A N/A User I/O Wait Time (ms) 0 N/A N/A Cluster Wait Time (ms) 0 N/A N/A Application Wait Time (ms) 0 N/A N/A Concurrency Wait Time (ms) 0 N/A N/A Invalidations 0 N/A N/A Version Count 2 N/A N/A Sharable Mem(KB) 26 N/A N/A ------------------------------------------------------------- Execution Plan --------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | --------------------------------------------------------------------------------------------- | 0 | UPDATE STATEMENT | | | | 2 (100)| | | 1 | UPDATE | TEST | | | | | | 2 | TABLE ACCESS BY INDEX ROWID| TEST | 1 | 28 | 2 (0)| 00:00:01 | | 3 | INDEX RANGE SCAN | TEST_DT_IND | 1 | | 1 (0)| 00:00:01 | | 4 | TABLE ACCESS BY INDEX ROWID| ACCT | 1 | 26 | 4 (0)| 00:00:01 | | 5 | INDEX RANGE SCAN | INDX_ACCT_DT | 1 | | 3 (0)| 00:00:01 | --------------------------------------------------------------------------------------------- Full SQL Text SQL ID SQL Text ------------ ----------------------------------------------------------------- 51szt7b736bm UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL, 0) + NVL(ACCT_DR_BAL, 0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND PB RN_ACC_NB = ACCT_ACC_NB(+)) WHERE TEST_BATCH_DT = (:B1 )
Thank you for taking your time to answer my question.
ConcerningOracle Lover3 wrote:
How will I know (from Plan 1 and Plan 2) whose execution plan chose for the current run?Since you're already on 10.2, you can identify the actual execution plan by checking in V$ SESSION SQL_ID and SQL_CHILD_NUMBER column. This can be used to identify the plan in V$ SQL_PLAN (columns SQL_ID and CHILD_NUMBER) and in 10g, you can use the convenient DBMS_XPLAN. Function DISPLAY_CURSOR for the information of the real plan using these two parameters.
Kind regards
RandolfOracle related blog stuff:
http://Oracle-Randolf.blogspot.com/SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676 /.
http://sourceforge.NET/projects/SQLT-pp/ -
Sequential execution of the structure of the event?
Greetings,
I'm at the very beginning of the development of applications. I have a list of 10 tests (we just call test 1 test 10). I would (ideally) for a user to have the option of selecting 1 or even 10 tests, any combination basically (listbox, it was what I thought). Now the kicker is, I want a structure of event related to this list box. And run each index table selected by the user. So if the user must select test 1, test 2 and test 6, I had received a table of 0, 1, and 5, respectively. The structure of the event should run sequentially as a result. Right now I plan each event at the outbreak would run a state machine for the test itself. So if test 1 was a simple test of current draw (just for example). The user would choose 1 Test that raises the corresponding event. The event inside a state machine would execute the necessary market, TAKE the MEASURE of CURRENT, STOP says finally.
I've tried my hand at a cluster with Boolean values, but did not too far. Even though I know there is a solution somewhere within the cluster and the binder for Boolean types inside for the value change. But I need allow the user time to choose all the tests to run before launching the sequential execution of the structure of the event.
I'm sorry if I missed something, I am still drinking my coffee Sunday I do not have a VI to post. I tried yesterday with no luck and the best test I had too many nested loops.
Thanks in advance for any help in this matter. I feel I've hit a moment "DUH" in the development process. But I find it difficult to set up a structure of the event to run several events in the event generated by 1 user.
-Chazzzmd
Maybe you are looking for
-
Non-active 3g WWAN cant on T430 with Windows 10
After the operating system of windows 7 to upgrade windows 10, I can not active on t430 3g wwan. Please help me solve this problem
-
Reports set up automatically in the Script of Diadem
Hello first of all my Prolem: I have a huge file TDMS series of measures. I made several models of REPORTS such as title, measure set, overview together and so on. Now, I wrote a script that loads a data file, and then generates the title, and after
-
Users are not able to open jpg or pdf files in their RDP Session to a server terminal server
Nice day We have 3 terminal servers, but users are not able to open files jpg or pdf on the 3rd Server terminal server. It is said that they need admin rights to do. Much needed suggestions there? :) Sincerely, Robert
-
Bisa bantu saya dengan ini error?
could not load file or assembly 'Microsoft.visualstudio.platform.appdomainmanager, version = 10.0.0.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a' or one of its dependencies. access is denied.
-
Red Exclamtion sign on my icons
Why do each of my one word document icons exclamation red on the bottom?