State management of package PL/SQL in ADF
Hi allI redesign a form of Oracle in the ADF. The shape is a front end for some fairly complex processing that is provided by a database package. The package maintains the different data elements in its State which are used during the session of the interactive user. I would like if possible to reuse functionality in this package for the ADF in the screen version. Clearly, in order to use the package as what I would need to ensure the that maintaining the connection to the database for the user's session just as it would be in forms.
I have been reading up on top of the connection and the Application Module pool and think it is possible to switch off the two pools and ensure that a user session gets a single database session - set jbo.ampool.doampooling = false and jbo.doconnectionpooling = false (default). I am not mistaken in this or have I missed part of the battery of the session/connection?
Assuming that it is possible, is it advisable? The maximum number of concurrent users on the application server would be about 200, access to a number of different databases.
The alternative I suppose would be to redesign the package in the ADF BC layer. While it is perhaps the best architecture if there would be a major effort in the redevelopment of the Java code from scratch.
I use JDeveloper/ADF 11.1.1.3.
Thank you very much
Kevin.
Yep, it's no doubt that the technique is called 'Dynamic JDBC Credentials'.
In this for terms is it advisable, for 200 users, assuming that the memory of your package is not huge each user would be nice. Ideally you don't want to rewrite (and a new test) all this code database then go with what you have.
However, in saying that this is not the best option when you want to scale to a huge amount of users. The best way to make sure is to stress test by using a tool such as JMeter to see if things stand up to.
CM.
Tags: Java
Similar Questions
-
ORA-04068: current state of the packages was waived - avoid
Hello
I fight with the bad behavior of developers that is, something like this:
I did some tests and looks like when you recompile pkg1 withCREATE OR REPLACE PACKAGE pkg1 IS g_version VARCHAR2(20) := '7.3'; TYPE t_id_kon IS RECORD( id_kon VARCHAR2(12), sr_id NUMBER(5)); TYPE t_id_kont IS TABLE OF t_id_kon INDEX BY BINARY_INTEGER; FUNCTION get_version RETURN VARCHAR2; END pkg1; /
Global g_version variable it is ORA-04068 generated for all sessions using this pkg1 before recompiling.
But what about type and table_type declared in pkg1 they cause same behavior as g_version global varialbe?
And generally how to treat than the types of situations of application point of view, you must catch this exception and re-run your application just?
concerning
GregGPackages tend to fail because of their 'package '. A package has a 'State' when it contains the package variable and constant level etc. and the package is called. On the first calling package, the 'State' is created in memory to hold the values of these variables, etc. If an object including the package depends on for example a table is changed somehow example deleted and recreated due to data dependencies, the package then takes a State not VALID. When you do then appealed to the package, Oracle examines the status and see that it is not valid, then determines that the package has a "State". Because something changed the package depended on, the State is taken as being obsolete and is ignored, which causes the error "State package has been abandoned" message.
If a package has no variables of level package etc. i.e. the 'State' and then, taking the same example above, the whole takes an INVALID state, but when you make then a call to the package, Oracle considers as invalid, but knows that there is no 'State' attached to it and is therefore able to recompile the package automatically and then continue execution without causing error messages. The only exception here is if the thing that the package was dependent on a change of such kind that the package may not compile, in which case you will get an invalid error package type.
And if you want to know how we prevent Jetty package States...
Move all variables and constants in a stand-alone package specification and to refer to those of your original package. So when the status of your original packing is invlidated for some reason, it has no State package and can be recompiled automatically, however the packaging containing the vars/const is not cancelled because it has no dependencies, so the State that is in memory for this package will remain and may continue to be used.
As for package-level sliders, you will need to make these premises to the procedures/functions using them as you won't be able of sliders reference in all of packages like that (not sure on the use of the REF CURSOR but... exists for me to study!)
This first example shows the State being disabled by adding a new column on the table and causing to give a 'Package State scrapped' error...
SQL> set serveroutput on SQL> SQL> create table dependonme (x number) 2 / Table created. SQL> SQL> insert into dependonme values (5) 2 / 1 row created. SQL> SQL> create or replace package mypkg is 2 procedure myproc; 3 end mypkg; 4 / Package created. SQL> SQL> create or replace package body mypkg is 2 v_statevar number := 5; -- this means my package has a state 3 4 procedure myproc is 5 myval number; 6 begin 7 select x 8 into myval 9 from dependonme; 10 11 myval := myval * v_statevar; 12 DBMS_OUTPUT.PUT_LINE('My Result is: '||myval); 13 end; 14 end mypkg; 15 / Package body created. SQL> SQL> exec mypkg.myproc My Result is: 25 PL/SQL procedure successfully completed. SQL> SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG' 2 / OBJECT_NAME -------------------------------------------------------------------------------------------------- OBJECT_TYPE STATUS ------------------- ------- MYPKG PACKAGE VALID MYPKG PACKAGE BODY VALID SQL> SQL> SQL> alter table dependonme add (y number) 2 / Table altered. SQL> SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG' 2 / OBJECT_NAME -------------------------------------------------------------------------------------------------- OBJECT_TYPE STATUS ------------------- ------- MYPKG PACKAGE VALID MYPKG PACKAGE BODY INVALID SQL> SQL> exec mypkg.myproc BEGIN mypkg.myproc; END; * ERROR at line 1: ORA-04068: existing state of packages has been discarded ORA-04061: existing state of package body "SCOTT.MYPKG" has been invalidated ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.MYPKG" ORA-06512: at line 1 SQL> SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG' 2 / OBJECT_NAME -------------------------------------------------------------------------------------------------- OBJECT_TYPE STATUS ------------------- ------- MYPKG PACKAGE VALID MYPKG PACKAGE BODY INVALID SQL> SQL> exec mypkg.myproc PL/SQL procedure successfully completed. SQL> SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG' 2 / OBJECT_NAME -------------------------------------------------------------------------------------------------- OBJECT_TYPE STATUS ------------------- ------- MYPKG PACKAGE VALID MYPKG PACKAGE BODY VALID
And the following example shows how to get the package in their own specifications of package variables, allows the package to automatically recompile when it is called even if it has become invalid by the action to add a column to the table.
SQL> drop table dependonme 2 / Table dropped. SQL> SQL> drop package mypkg 2 / Package dropped. SQL> SQL> set serveroutput on SQL> SQL> create table dependonme (x number) 2 / Table created. SQL> SQL> insert into dependonme values (5) 2 / 1 row created. SQL> SQL> create or replace package mypkg is 2 procedure myproc; 3 end mypkg; 4 / Package created. SQL> SQL> create or replace package mypkg_state is 2 v_statevar number := 5; -- package state in seperate package spec 3 end mypkg_state; 4 / Package created. SQL> SQL> create or replace package body mypkg is 2 -- this package has no state area 3 4 procedure myproc is 5 myval number; 6 begin 7 select x 8 into myval 9 from dependonme; 10 11 myval := myval * mypkg_state.v_statevar; -- note: references the mypkg_state package 12 DBMS_OUTPUT.PUT_LINE('My Result is: '||myval); 13 end; 14 end mypkg; 15 / Package body created. SQL> SQL> exec mypkg.myproc My Result is: 25 PL/SQL procedure successfully completed. SQL> SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG' 2 / OBJECT_NAME -------------------------------------------------------------------------------------------------- OBJECT_TYPE STATUS ------------------- ------- MYPKG PACKAGE VALID MYPKG PACKAGE BODY VALID SQL> SQL> alter table dependonme add (y number) 2 / Table altered. SQL> SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG' 2 / OBJECT_NAME -------------------------------------------------------------------------------------------------- OBJECT_TYPE STATUS ------------------- ------- MYPKG PACKAGE VALID MYPKG PACKAGE BODY INVALID SQL> SQL> exec mypkg.myproc My Result is: 25 PL/SQL procedure successfully completed.
-
error ORA-4068:-l' current state of the package is invalidated
Hai friends,
Please see this link
Problem we faced, it is ' error ora-4068:-l' current state of the package is disabled "in the application.initiallly of customer, we migrated to oracle 9i and 10g 10.2.0.4.0
We have discussed and obtained the solution as the timestamp of the objects may be different. (we expect the access rights of the table sys.obj$) pls see the link
But now we are informed senior as below
(1) error ora-4068 will come only when recompile us the view. is this true?
(2) 6136074 bug is fixed in 10.2.0.4.0. is it?
Gurus of give your valuable suggestions
SPackages tend to fail because of their 'package '. A package has a 'State' when it contains the package variable and constant level etc. and the package is called. On the first calling package, the 'State' is created in memory to hold the values of these variables, etc. If an object including the package depends on for example a table is changed somehow example deleted and recreated due to data dependencies, the package then takes a State not VALID. When you do then appealed to the package, Oracle examines the status and see that it is not valid, then determines that the package has a "State". Because something changed the package depended on, the State is taken as being obsolete and is ignored, which causes the error "State package has been abandoned" message.
If a package has no variables of level package etc. i.e. the 'State' and then, taking the same example above, the whole takes an INVALID state, but when you make then a call to the package, Oracle considers as invalid, but knows that there is no 'State' attached to it and is therefore able to recompile the package automatically and then continue execution without causing error messages. The only exception here is if the thing that the package was dependent on a change of such kind that the package may not compile, in which case you will get an invalid error package type.
And if you want to know how we prevent Jetty package States...
Move all variables and constants in a stand-alone package specification and to refer to those of your original package. So when the status of your original packing is invlidated for some reason, it has no State package and can be recompiled automatically, however the packaging containing the vars/const is not cancelled because it has no dependencies, so the State that is in memory for this package will remain and may continue to be used.
As for package-level sliders, you will need to make these premises to the procedures/functions using them as you won't be able of sliders reference in all of packages like that (not sure on the use of the REF CURSOR but... exists for me to study!)
This first example shows the State being disabled by adding a new column on the table and causing to give a 'Package State scrapped' error...
SQL> set serveroutput on SQL> SQL> create table dependonme (x number) 2 / Table created. SQL> SQL> insert into dependonme values (5) 2 / 1 row created. SQL> SQL> create or replace package mypkg is 2 procedure myproc; 3 end mypkg; 4 / Package created. SQL> SQL> create or replace package body mypkg is 2 v_statevar number := 5; -- this means my package has a state 3 4 procedure myproc is 5 myval number; 6 begin 7 select x 8 into myval 9 from dependonme; 10 11 myval := myval * v_statevar; 12 DBMS_OUTPUT.PUT_LINE('My Result is: '||myval); 13 end; 14 end mypkg; 15 / Package body created. SQL> SQL> exec mypkg.myproc My Result is: 25 PL/SQL procedure successfully completed. SQL> SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG' 2 / OBJECT_NAME -------------------------------------------------------------------------------------------------- OBJECT_TYPE STATUS ------------------- ------- MYPKG PACKAGE VALID MYPKG PACKAGE BODY VALID SQL> SQL> SQL> alter table dependonme add (y number) 2 / Table altered. SQL> SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG' 2 / OBJECT_NAME -------------------------------------------------------------------------------------------------- OBJECT_TYPE STATUS ------------------- ------- MYPKG PACKAGE VALID MYPKG PACKAGE BODY INVALID SQL> SQL> exec mypkg.myproc BEGIN mypkg.myproc; END; * ERROR at line 1: ORA-04068: existing state of packages has been discarded ORA-04061: existing state of package body "SCOTT.MYPKG" has been invalidated ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.MYPKG" ORA-06512: at line 1 SQL> SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG' 2 / OBJECT_NAME -------------------------------------------------------------------------------------------------- OBJECT_TYPE STATUS ------------------- ------- MYPKG PACKAGE VALID MYPKG PACKAGE BODY INVALID SQL> SQL> exec mypkg.myproc PL/SQL procedure successfully completed. SQL> SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG' 2 / OBJECT_NAME -------------------------------------------------------------------------------------------------- OBJECT_TYPE STATUS ------------------- ------- MYPKG PACKAGE VALID MYPKG PACKAGE BODY VALID
And the following example shows how to get the package in their own specifications of package variables, allows the package to automatically recompile when it is called even if it has become invalid by the action to add a column to the table.
SQL> drop table dependonme 2 / Table dropped. SQL> SQL> drop package mypkg 2 / Package dropped. SQL> SQL> set serveroutput on SQL> SQL> create table dependonme (x number) 2 / Table created. SQL> SQL> insert into dependonme values (5) 2 / 1 row created. SQL> SQL> create or replace package mypkg is 2 procedure myproc; 3 end mypkg; 4 / Package created. SQL> SQL> create or replace package mypkg_state is 2 v_statevar number := 5; -- package state in seperate package spec 3 end mypkg_state; 4 / Package created. SQL> SQL> create or replace package body mypkg is 2 -- this package has no state area 3 4 procedure myproc is 5 myval number; 6 begin 7 select x 8 into myval 9 from dependonme; 10 11 myval := myval * mypkg_state.v_statevar; -- note: references the mypkg_state package 12 DBMS_OUTPUT.PUT_LINE('My Result is: '||myval); 13 end; 14 end mypkg; 15 / Package body created. SQL> SQL> exec mypkg.myproc My Result is: 25 PL/SQL procedure successfully completed. SQL> SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG' 2 / OBJECT_NAME -------------------------------------------------------------------------------------------------- OBJECT_TYPE STATUS ------------------- ------- MYPKG PACKAGE VALID MYPKG PACKAGE BODY VALID SQL> SQL> alter table dependonme add (y number) 2 / Table altered. SQL> SQL> select object_name, object_type, status from user_objects where object_name = 'MYPKG' 2 / OBJECT_NAME -------------------------------------------------------------------------------------------------- OBJECT_TYPE STATUS ------------------- ------- MYPKG PACKAGE VALID MYPKG PACKAGE BODY INVALID SQL> SQL> exec mypkg.myproc My Result is: 25 PL/SQL procedure successfully completed.
-
Problem to generate Java package PL SQL in Jdeveloper
Hello
I have problem to create the java class package PL SQL in JDeveloper.
I use jdeveloper database navigator and right-click on a package and choose generate Java then in the Jpublisher window choose my controller view and accept other default values.
I call methods in the generated class in the Action of a button in my JSP page, but when I click the button it throws null pointer exception! I Fund one of the generated method return null and it lead to this exception.
protected DefaultContext __tx = null;
public DefaultContext getConnectionContext() throws SQLException {}
If (__tx == null) {}
__tx = (getConnection () == null)? DefaultContext.getDefaultContext (): new DefaultContext (getConnection ());
}
Return __tx;
};
public connection getConnection() throws SQLException
{
If (__onn! = null) return __onn;
ElseIf (__tx! = null) return __tx.getConnection ();
ElseIf (__dataSource! = null) __onn = __dataSource.getConnection ();
Return __onn;
}
I'm trying to generate the class in the model project and create DataControl to it and use the action method, but noting the change and I get null pointer again!
JDeveloper Versino = 11.1.1.7.0
I would like to ask you another question: why generate java packaging at all?
Where you want to call the package?
Back to your question: you should see the code as
Public Sub setDataSourceLocation (String dataSourceLocation) throws SQLException {}
javax.sql.DataSource dataSource;
try {}
Class cls = Class.forName ("javax.naming.InitialContext");
Object ctx = cls.newInstance ();
Meth java.lang.reflect.Method is CL. GetMethod ("search", new class [] {String.class});
dataSource = (javax.sql.DataSource) meth.invoke (ctx, new Object() {"java: comp/env /" + dataSourceLocation});
setDataSource (dataSource);
} catch (Exception e) {}
again throw java.sql.SQLException ("data source initialization error in" + dataSourceLocation + ":" + e.getMessage ());
}
}
in the generated code. This code search a data source (that you have defined for example on the Weblogic Server) by calling the method
setDataSourceLocaltion("jdbc/HRConnDS");
That look to the top of the n data source stores in the class variable.
Timo
-
Call objects (packages-Pl/SQL procedures) DB of the ADF
Hello
1. How can we call DB procedures/Packages using ADF?
2 are there scenarios describing when to use what Layout? & Also any introduction of layouts in the ADF.
Thank you.Hello
You can expose your PL/SQL package in the form of web services as well and use it on your layout. Check this blog entry on the call of PL/SQL of the ADF, it may be useful
http://baigsorcl.blogspot.com/2010/05/calling-PLSQL-procedure-and-function-in.htmlThis presentation would help understand layouts http://blogs.oracle.com/shay/2010/05/adf_faces_layouts_demo_-ahid.html
also, you can refer to the guide of the web user interface. -
current state of the package has been abandoned...
Hi all..
I get the following error only for the '"first run" ", even the package is in State"valid ". If the execute the same package to new "second run", it works ok.
usually we complie all 'invalid objects"in the diagram, when we pass the TEST or PRE-PRODUCTION code approx.
but I get the following error, even if the package is in State "valid".
I went through the next thread, blu explained the cause of this error,ERROR at line 1: ORA-04068: existing state of packages has been discarded ORA-04061: existing state of package "TEST_OWNER.TEST_PKG" has been invalidated ORA-04065: not executed, altered or dropped package "TEST_OWNER.TEST_PKG" ORA-06508: PL/SQL: could not find program unit being called: "TEST_OWNER.TEST_PKG" ORA-06512: at line 2
but we receive this error even when the package is 'valid' State too?
Which session refers to a package for first time package is instantiated in memory of the session. If the package is recompiled, Oracle assumes he may have changed and the package in memory session instance is no longer valid. This is why any reference to this package made by this session will raise an error.
Session 1:
SQL> create or replace 2 package pkg1 3 is 4 g_n number; 5 procedure p1; 6 end; 7 / Package created. SQL> create or replace 2 package body pkg1 3 is 4 procedure p1 5 is 6 begin 7 for rc in (select * from emp) loop 8 dbms_output.put_line(rc.empno); 9 end loop; 10 end; 11 end; 12 / Package body created. SQL> exec pkg1.p1; PL/SQL procedure successfully completed. SQL>
This package is instantiated PKG1 is session1. Then session 2:
SQL> alter package pkg1 compile body; Package body altered. SQL>
Back to session 1:
SQL> exec pkg1.p1; BEGIN pkg1.p1; END; * ERROR at line 1: ORA-04068: existing state of packages has been discarded ORA-04061: existing state of package body "SCOTT.PKG1" has been invalidated ORA-04065: not executed, altered or dropped package body "SCOTT.PKG1" ORA-06508: PL/SQL: could not find program unit being called: "SCOTT.PKG1" ORA-06512: at line 1 SQL>
SY.
-
creating a package in sql * more
Hello all;
Do you know what the problem with that statement
I get the following error messageSQL> create or replace pkg_initial_comment as procedure save_initial_comment(p_i d number, p_first_name varchar2, p_last_name varchar2, p_comment varchar2, p_dat e date); end save_initial_comment; create or replace package body pkg_initial_co mment as procedure save_initial (p_id number, p_comments varchar2, p_first_name varchar2, p_last_name varchar2, p_date date) is begin insert into initial_commen ts values (1, p_first_name, p_last_name, p_comment, sysdate); end save_initial; end pkg_initial_comment; create or replace pkg_initial_comment as procedure save_initial_comment(p_id num ber, p_first_name varchar2, p_last_name varchar2, p_comment varchar2, p_date dat e); end save_initial_comment; create or replace package body pkg_initial_comment as procedure save_initial (p_id number, p_comments varchar2, p_first_name varch ar2, p_last_name varchar2, p_date date) is begin insert into initial_comments va lues (1, p_first_name, p_last_name, p_comment, sysdate); end save_initial; end p kg_initial_comment
ORA-00922:
and my table structure is less than
create table initial_comment (id number(30), first_name varchar2(4000), last_name varchar2(4000), create_date date);
're missing you the keyword package after first replace.
Good bye
DPT -
I AM trying to EXECUTE a sql AGENT JOB. And I am getting this error below.
But I'm not able to identify exactly what is the issue.
The work I get a successful execution when it is run manually in SSIS2013.tHERE I USE the EXACT VARIABLES. Help, please.
Here is the error of the story of job.
Day 02/08/2016 08:44:32
Historic backlog)ID from step 1
Server
Name of the job
Step name exec command file
Time 00:00:01
SQL severity 0
SQL Message ID 0
Operator by e-mail
Operator Net sent
Operator paged
Retries attempted 0Message
Executed as user: asd... * C:\Windows\system32>REM * STEP: get the letter order of maestro and run the SSIS C:\Windows\system32>REM package * C:\Windows\system32>REM * C:\Windows\system32>REM * C:\Windows\system32>REM * AX-RISCVMSQL440Microsoft (R) SQL Server Execute Package Utility Version 12.0.4100.1 for 32-bit Copyright (C) Microsoft Corporation. All rights reserved. Start: 08:44:32 Info: 2016-08-02 08:44:32.39 Code: 0 x 40016041 Source: abc Description: the package tries to configure from the XML "J:\ReportSettings\BatchJobsConfig.dtsConfig". End of information news: 2016-08-02 08:44:32.44 Code: 0x4004300A Source: ErrorLog to FlatFile SSIS. Pipeline Description: starts the Validation phase. End progress Info: 2016-08-02 08:44:32.44 Source: for the validation of the FlatFile error log: 0% complete end progress CustomEvent: 2016-08-02 08:44:32.44 Source: journal of the FlatFile errors name: OnPipelinePreComponentCall Description: data flow engine invokes a component method. End CustomEvent CustomEvent: 2016-08-02 08:44:32.44 Source: journal of the FlatFile errors name: OnPipelinePostComponentCall Description: data flow engine has completed a call to a method of component. End CustomEvent CustomEvent: 2016-08-02 08:44:32.44 Source: journal of the FlatFile errors name: OnPipelinePreComponentCall Description: data flow engine invokes a component method. End CustomEvent CustomEvent: 2016-08-02 08:44:32.44 Source: journal of the FlatFile errors name: OnPipelinePostComponentCall Description: data flow engine has completed a call to a method of component. End CustomEvent CustomEvent: 2016-08-02 08:44:32.44 Source: journal of the FlatFile errors name: OnPipelinePreComponentCall Description: data flow engine invokes a component method. End CustomEvent CustomEvent: 2016-08-02 08:44:32.44 Source: journal of the FlatFile errors name: OnPipelinePostComponentCall Description: data flow engine has completed a call to a method of component. End progress CustomEvent: 2016-08-02 08:44:32.44 Source: for the validation of the FlatFile error log: 50% full end progress CustomEvent: 2016-08-02 08:44:32.44 Source: name of the journal of the FlatFile errors: OnPipelinePreComponentCall Description: data flow engine invokes a component method. End CustomEvent CustomEvent: 2016-08-02 08:44:32.44 Source: journal of the FlatFile errors name: OnPipelinePostComponentCall Description: data flow engine has completed a call to a method of component. End CustomEvent CustomEvent: 2016-08-02 08:44:32.44 Source: journal of the FlatFile errors name: OnPipelinePreComponentCall Description: data flow engine invokes a component method. End CustomEvent CustomEvent: 2016-08-02 08:44:32.44 Source: journal of the FlatFile errors name: OnPipelinePostComponentCall Description: data flow engine has completed a call to a method of component. End CustomEvent CustomEvent: 2016-08-02 08:44:32.44 Source: journal of the FlatFile errors name: OnPipelinePreComponentCall Description: data flow engine invokes a component method. End CustomEvent CustomEvent: 2016-08-02 08:44:32.44 Source: journal of the FlatFile errors name: OnPipelinePostComponentCall Description: data flow engine has completed a call to a method of component. End progress CustomEvent: 2016-08-02 08:44:32.44 Source: for the validation of the FlatFile error log: 100% complete end course Info: 2016-08-02 08:44:32.44 Code: 0 x 40043006 Source: ErrorLog to FlatFile SSIS. Pipeline Description: Prepare for Execute phase begins. End progress News: 2016-08-02 08:44:32.44 Source: ErrorLog FlatFile prepare Execute: 0% all CustomEven end progress... Exit code 1. The step failed.Hi John,.
According to the description, you have concerns about ssis package in the SQL agent job and you are unable to identify what exactly is the question. In addition, you get a performance successful when performed manually in SSIS2013 on the system.
Certainly, I understand your concern.
In order to get more information about this, I suggest you to post your query on the forum of the MSDN Community for that matter. You can get more effective suggestions and adapted by experts familiar with this topic.
Please visit the link below for the best support.
https://social.msdn.Microsoft.com/forums/SQLServer/en-us/home?category=SQLServer
I hope this information is useful.
Please let us know if you need more help, we will be happy to help you.
Thank you.
-
Running a package in SQL Developer
Hello
When I introduce a new package in a database and the package is given bz *.pkg file, what is the difference between the opening of the packing of files in SQL Developer (via 'Open '->' file') and then run the package and just copy paste the code Pl/SQL package in an editor.
I plead the cause I did the following experiment, which I've posted it here:
Faraz' Oracle DBA Blog: error opening a PL/SQL package as a file in Oracle SQL Developer
Run the file that has your ddl inside package and execution of the package itself - two different things.
When you open a file in SQL Developer, according to the file extension, you will get either a SQL worksheet or a PL/SQL Editor.
I'm assuming that your package file has made two database objects, the package specification and package body. If this is the scenario, you need to open it in a SQL worksheet, set your connection details, and then run with F5.
If your file contains only a spec or body in pkg, you can and should open in the procedure Editor. There, you will see your highlight syntax errors in the code itself.
I speak a little of that here, with some screenshots so I hope it's easier to understand.
-
package pl/sql execution plan
Hi all
How we can find the bottoleneks in the pl/sql package. I know we can use dbms_profiler. Gathersed data, but not having planned the details.
Here's the query I use
Select s.text,
p.total_occur,
p.TOTAL_TIME/1000000000 total_time,
p.min_time / 1000000000 min_time,.
p.max_time / 1000000000 max_time
of plsql_profiler_data p, user_source s, plsql_profiler_runs r
where p.line # = Check
and p.runid = r.runid
and r.run_comment = 'XXXX_YYY_INIT.XXX_TO_DDD(1,,360). '
and s.name LIKE 'XXX % ';
I see that dbms_profiler has gathered data. But it does give that which line is how long take.
Please guide findout that.
Thank you
Col owner format a10
Col name format a20
row col 9999 format
Col source format a40 word_wrap
occurrences of col 9999999 format
Col tot_time_s format 999,999,990.999
Col run_comment format a40
format of pct col 999
Select runid, run_date, plsql_profiler_runs run_comment;
Select OWNER u.unit_owner, u.unit_name NAME, d.line # LINE, (select the text from all_source where type in ('BODY of PACKAGE', 'FUNCTION', 'PROCEDURE', 'TRIGGER') and name = u.unit_name and = d.line line # and u.unit_owner and type = u.unit_type = owner) SOURCE, d.total_occur OCCURRENCES, (d.total_time/1000000000) TOT_TIME_S, d.total_time/r.run_total_time*100 "PCT".
of plsql_profiler_runs r, plsql_profiler_units u, plsql_profiler_data d
where are.runid = & runid
and r.runid = u.runid
and r.runid = d.runid
and d.unit_number = u.unit_number
and (d.total_time/1000000000) > 1 - more than 1 second
order of tot_time_s
/
Kind regards
Harman
-
SELECT statement in a Package body
I have the following in my package body and it gives me an error:
- Error (7.1): PLS-00428: an INTO clause in this SELECT statement
PROCEDURE MyQuery
AS
BEGIN
Select * from customer;
END MyQuery;
The error message is correct.
Your selection must have an INTO clause and must return 1 and only 1 row.
-
Create the PL/SQL package in SQL Developer 4.0.0.12
Hello
I built a model in SQL Developer 4.0.0.12 and I want to create a PL/SQL package.
In ODMiner 11.1.0.4 of 'Tools' > 'Create pl/sql package' I can get a script to create the package and every thing is OK.
but in SQL Developer, I select "Deploy" from the popup menu of each node and it generates a folder containing scripts associated with each node. I don't see any relevant script for creating a package.
How can I create a PL/SQL package in my workflow?
Thanks for any help you can provide in this situation.
Please see this whitepaper to find out how to build the PL/SQL package for deployment of workflow:
Oracle Data Miner (Extension of SQL Developer 4.0)
-
INSERT statement is slower in PL/SQL, SQL
I can't understand why an insert in PL/SQL is much slower than in SQL (against 5 minutes 2 seconds).
INSERT statement and explain plans are below.
The BIG difference is that I use an immediate execution with bind variable because I'm passing in the dynamic table/column names. Maybe that confuses the optimizer? Another point is that if I remove the 2 'GOLD' terms these two queries run the same speed.
Oracle 10g
Jason
The insert statement is:
[code]
INSERT / * + APPEND * / INTO linker_sec_betach_ip
SELECT
SEC_CLIENTVISIT_GUID
SEC_INST
SEC_ADMIT_DT
SEC_DISCHARGE_DT
SEC_ENCOUNTER
SEC_TYPE
SEC_STATUS
SEC_CARE_LEVEL
BETACH_CD_ENCOUNTER_ID
BETACH_INST
BETACH_ADMIT_DT
BETACH_DISCH_DT
BETACH_PCU_FIRST
DATE_SCORE
LAST_UPDATE_DT AS SYSDATE
CEN
SELECT
BT. CLIENTVISIT_GUID AS SEC_CLIENTVISIT_GUID
bt. INST AS SEC_INST
bt. ADMIT_DT AS SEC_ADMIT_DT
bt. DISCHARGE_DT AS SEC_DISCHARGE_DT
bt. MEETING AS SEC_ENCOUNTER
bt. SEC_TYPE ACE TYPE
bt. STATE SEC_STATUS
bt. CARE_LEVEL AS SEC_CARE_LEVEL
JT. CD_ENCOUNTER_ID AS BETACH_CD_ENCOUNTER_ID
JT. INST AS BETACH_INST
JT. ADMIT_DT AS BETACH_ADMIT_DT
JT. DISCH_DT AS BETACH_DISCH_DT
JT. PCU_FIRST AS BETACH_PCU_FIRST
ABS (bt. ADMIT_DT - JT. ADMIT_DT) AS DATE_SCORE
MIN (ABS (bt. ADMIT_DT - JT. ADMIT_DT)) OVER (PARTITION BY bt. CLIENTVISIT_GUID) AS LINK_PRIMARY_KEY_SCORE
MIN (ABS (bt. ADMIT_DT - JT. ADMIT_DT)) OVER (PARTITION BY JT. CD_ENCOUNTER_ID) AS BASE_PRIMARY_KEY_SCORE
OF sec_encounters_delme bt
jt betach_visits
WHERE)
(bt. RSP = JT. PHN)
OR (bt. PTN_CHART = JT. RHRN) - IF I REMOVE THESE TWO THEN THEY BOTH RUN THE SAME SPEED
OR (bt. MEET = JT. ENCOUNTER_NO) -IF I REMOVE THESE TWO and THEN THEY BOTH PERFORM THE SAME SPEED
)
AND bt. ADMIT_DT < trunc (sysdate)
AND bt. ADMIT_DT > = JT. ADMIT_DT - 1.5
AND bt. ADMIT_DT < = JT. ADMIT_DT + 1.5
AND bt. ADMIT_DT > = trunc(sysdate-7)
AND bt. ADMIT_DT < trunc(sysdate-7) + 7
AND JT. ADMIT_DT > = trunc(sysdate-7) - 1.5
AND JT. ADMIT_DT < = trunc(sysdate-7) + 7 + 1.5
AND 1 = 1
);
[/ code]
THIS PLAN IS < 2 seconds for 5000 lines
Hash value of plan: 1434516581
-----------------------------------------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
-----------------------------------------------------------------------------------------------------------
| 0 | INSERT STATEMENT. | 3. 378. 42 (3) | 00:00:01 |
| 1. LOAD SELECT ACE | LINKER_SEC_BETACH_IP | | | | |
| 2. VIEW | | 3. 378. 42 (3) | 00:00:01 |
| 3. CONCATENATION. | | | | |
|* 4 | FILTER | | | | | |
|* 5 | TABLE ACCESS BY INDEX ROWID | SEC_ENCOUNTERS_DELME | 1. 74. 3 (0) | 00:00:01 |
| 6. NESTED LOOPS | | 1. 137. 13 (0) | 00:00:01 |
| 8 S TABLE ACCESS BY INDEX ROWID | BETACH_VISITS | 1. 63. 10 (0) | 00:00:01 |
|* 8 | INDEX RANGE SCAN | IDX_BETACH_VISITS_006 | 1. | 9 (0) | 00:00:01 |
|* 9 | INDEX RANGE SCAN | NDX_SEC_ENC_05 | 1. | 2 (0) | 00:00:01 |
| * 10 | FILTER | | | | | |
| * 11 | TABLE ACCESS BY INDEX ROWID | SEC_ENCOUNTERS_DELME | 1. 74. 4 (0) | 00:00:01 |
| 12. NESTED LOOPS | | 1. 137. 14 (0) | 00:00:01 |
| 13. TABLE ACCESS BY INDEX ROWID | BETACH_VISITS | 1. 63. 10 (0) | 00:00:01 |
| * 14 | INDEX RANGE SCAN | IDX_BETACH_VISITS_006 | 1. | 9 (0) | 00:00:01 |
| * 15 | INDEX RANGE SCAN | NDX_SEC_ENC_06 | 3. | 2 (0) | 00:00:01 |
| * 16. FILTER | | | | | |
| * 17. TABLE ACCESS BY INDEX ROWID | SEC_ENCOUNTERS_DELME | 1. 74. 4 (0) | 00:00:01 |
| 18. NESTED LOOPS | | 1. 137. 14 (0) | 00:00:01 |
| * 19. TABLE ACCESS BY INDEX ROWID | BETACH_VISITS | 1. 63. 10 (0) | 00:00:01 |
| * 20. INDEX RANGE SCAN | IDX_BETACH_VISITS_006 | 1. | 9 (0) | 00:00:01 |
| * 21. INDEX RANGE SCAN | NDX_SEC_ENC_03 | 3. | 2 (0) | 00:00:01 |
-----------------------------------------------------------------------------------------------------------
Information of predicates (identified by the operation identity card):
---------------------------------------------------
4 filter (TRUNC (SYSDATE@!-7) - 1.5 < = TRUNC (SYSDATE@!-7) + 7 + 1.5 AND)
TRUNC (sysdate@!-7) < TRUNC (SYSDATE@!-7) + 7 AND TRUNC(SYSDATE@!) > TRUNC (SYSDATE@!-7))
5 - filter("BT".") ADMIT_DT' > = TRUNC (SYSDATE@!-7) AND "BT". "" ADMIT_DT "< TRUNC(SYSDATE@!) AND
'BT '. "" ADMIT_DT "< TRUNC (SYSDATE@!-7) + 7 AND"BT ". "" ADMIT_DT "> = INTERNAL_FUNCTION ("JT". "ADMIT_DT")-1.5 "
(AND "BT". "" ADMIT_DT "< = INTERNAL_FUNCTION ("JT". "ADMIT_DT") + (1.5) "
8 - access("JT".") ADMIT_DT' > = TRUNC (SYSDATE@!-7) - 1.5 AND
"JT". ("' ADMIT_DT" < = TRUNC (SYSDATE@!-7) + 7 + 1.5)
filter (INTERNAL_FUNCTION ("JT". "ADMIT_DT")-1.5 < TRUNC(SYSDATE@!) " AND
INTERNAL_FUNCTION ("JT". "ADMIT_DT") + 1.5 > = TRUNC (SYSDATE@!-7) AND "
INTERNAL_FUNCTION ("JT". "ADMIT_DT")-1.5 < TRUNC (SYSDATE@!-7)(+7) "
9 - access("BT".") MEET JT '=' '. ("' ENCOUNTER_NO")
10 filter (TRUNC (SYSDATE@!-7) - 1.5 < = TRUNC (SYSDATE@!-7) + 7 + 1.5 AND)
TRUNC (sysdate@!-7) < TRUNC (SYSDATE@!-7) + 7 AND TRUNC(SYSDATE@!) > TRUNC (SYSDATE@!-7))
11 - filter("BT".") ADMIT_DT' > = TRUNC (SYSDATE@!-7) AND "BT". "" ADMIT_DT "< TRUNC(SYSDATE@!) AND
'BT '. "" ADMIT_DT "< TRUNC (SYSDATE@!-7) + 7 AND"BT ". "" ADMIT_DT "> = INTERNAL_FUNCTION ("JT". "ADMIT_DT")-1.5 "
(AND "BT". "" ADMIT_DT "< = INTERNAL_FUNCTION ("JT". "ADMIT_DT") + 1.5 AND "
LNNVL ("BT". "JT"="MEETING" "." " ENCOUNTER_NO'))
14 - access("JT".") ADMIT_DT' > = TRUNC (SYSDATE@!-7) - 1.5 AND
"JT". ("' ADMIT_DT" < = TRUNC (SYSDATE@!-7) + 7 + 1.5)
filter (INTERNAL_FUNCTION ("JT". "ADMIT_DT")-1.5 < TRUNC(SYSDATE@!) " AND
INTERNAL_FUNCTION ("JT". "ADMIT_DT") + 1.5 > = TRUNC (SYSDATE@!-7) AND "
INTERNAL_FUNCTION ("JT". "ADMIT_DT")-1.5 < TRUNC (SYSDATE@!-7)(+7) "
15 - access("BT".") PTN_CHART «= TO_NUMBER ("JT".» RHRN'))
16 filter (TRUNC (SYSDATE@!-7) - 1.5 < = TRUNC (SYSDATE@!-7) + 7 + 1.5 AND)
TRUNC (sysdate@!-7) < TRUNC (SYSDATE@!-7) + 7 AND TRUNC(SYSDATE@!) > TRUNC (SYSDATE@!-7))
17 - filter("BT".") ADMIT_DT' > = TRUNC (SYSDATE@!-7) AND "BT". "" ADMIT_DT "< TRUNC(SYSDATE@!) AND
'BT '. "" ADMIT_DT "< TRUNC (SYSDATE@!-7) + 7 AND"BT ". "" ADMIT_DT "> = INTERNAL_FUNCTION ("JT". "ADMIT_DT")-1.5 "
(AND "BT". "" ADMIT_DT "< = INTERNAL_FUNCTION ("JT". "ADMIT_DT") + 1.5 AND "
LNNVL ("BT". "PTN_CHART '= TO_NUMBER ("JT".' RHRN')) AND LNNVL ("BT". "JT"="MEETING" "." " ENCOUNTER_NO'))
19 - filter("JT".") PHNS' IS NOT NULL)
20 - access("JT".") ADMIT_DT' > = TRUNC (SYSDATE@!-7) - 1.5 AND
"JT". ("' ADMIT_DT" < = TRUNC (SYSDATE@!-7) + 7 + 1.5)
filter (INTERNAL_FUNCTION ("JT". "ADMIT_DT")-1.5 < TRUNC(SYSDATE@!) " AND
INTERNAL_FUNCTION ("JT". "ADMIT_DT") + 1.5 > = TRUNC (SYSDATE@!-7) AND "
INTERNAL_FUNCTION ("JT". "ADMIT_DT")-1.5 < TRUNC (SYSDATE@!-7)(+7) "
21 - access("BT".") PHN '=' JT '. ("' PHN ')
When I placed this SQL in PL/SQL (AND place it in an immediate execution) it slows down.
THIS PLAN GOES ~ 5minutes to 5000 lines
Hash value of plan: 60405780
----------------------------------------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
----------------------------------------------------------------------------------------------------------
| 0 | INSERT STATEMENT. | 1. 126. 2 (0) | 00:00:01 |
| 1. LOAD SELECT ACE | LINKER_SEC_BETACH_IP | | | | |
| 2. VIEW | | 1. 126. 2 (0) | 00:00:01 |
|* 3 | FILTER | | | | | |
|* 4 | TABLE ACCESS BY INDEX ROWID | SEC_ENCOUNTERS_DELME | 1. 74. 1 (0) | 00:00:01 |
| 5. NESTED LOOPS | | 1. 137. 2 (0) | 00:00:01 |
| 4 > TABLE ACCESS BY INDEX ROWID | BETACH_VISITS | 1. 63. 1 (0) | 00:00:01 |
|* 7 | INDEX RANGE SCAN | IDX_BETACH_VISITS_006 | 1. | 1 (0) | 00:00:01 |
|* 8 | INDEX RANGE SCAN | NDX_SEC_ENC_07 | 2. | 1 (0) | 00:00:01 |
----------------------------------------------------------------------------------------------------------
Information of predicates (identified by the operation identity card):
---------------------------------------------------
3 filter (TO_NUMBER(:4) - 1.5 < = TO_NUMBER(:5) + 7 + AND 1.5: 2 < TO_NUMBER(:3) + 7 AND)
To_date(:1) > TO_DATE (:2))
4 - filter("BT".") PHN '=' JT '. "' PHN ' AND 'JT '. "' PHN ' IS NOT NULL OR
'BT '. «PTN_CHART «= TO_NUMBER ("JT".» ("' RHRN") OR "BT". «"JT MEETING «=»» ("' ENCOUNTER_NO")
7 - access("JT".") ADMIT_DT' > = TO_NUMBER(:4) - 1.5 AND "JT". ("' ADMIT_DT" < = TO_NUMBER(:5) + 7 + 1.5)
filter (INTERNAL_FUNCTION ("JT". "ADMIT_DT")-1.5 < TO_NUMBER(:3) + 7 AND "
INTERNAL_FUNCTION ("JT". "ADMIT_DT")-1.5 <: 1 AND INTERNAL_FUNCTION ("JT" ".") " (ADMIT_DT') + 1.5 > =: 2)
8 - access("BT".") ADMIT_DT' > = INTERNAL_FUNCTION ("JT". "ADMIT_DT") - 1.5 AND "BT". ("' ADMIT_DT" <: 1).
filter ("BT". "ADMIT_DT" < TO_NUMBER(:3) + 7 AND "BT" "." " ADMIT_DT' > =: 2 AND
'BT '. "" ADMIT_DT "< = INTERNAL_FUNCTION ("JT". "ADMIT_DT") + (1.5) "
I have it!
I added / * + USE_CONCAT * / forces subquery and not it the PL/SQL plan of union the subqueries.
Hoek thanks for the link to the use of the tracing utility.
Jason
-
status of the database api (PL/SQL) based adf BC?
Hello
does anyone know the status of the API database (PL/SQL) based project ADF BC?
(mentioned here: https://groups.google.com/forum/?fromgroups#! msg/adf-methodology/TiP2JXQm_Ag/zNbD7Kyf6hUJ)
The following link does not work:
https://database-API-based-ADF-BC.SampleCode.Oracle.com/
It is also not included in the sample code oracle: http://www.oracle.com/technetwork/indexes/samplecode/jdeveloper-adf-sample-522118.html
concerning
PeterHello
The following link does not work:
https://database-API-based-ADF-BC.SampleCode.Oracle.com/Avrom and EMG moved the project to a server that no longer exists. I had the code example of Avrom (at least a copy) and intend to work with Chris Muir to again make it a project of the EMG. Due to my time constraints used to be until the end of the year.
The code that you can download on the blog of Avrom however works fine.
Frank
-
The user managed backup hot via Sql
Hi being a little old school - I'm trying to understand the steps required for a Hotbackup managed through Sql (sorry fans RMAN!)
I understand that I can save each tablespace in turn (via the necessary ALTER TABLESPACE < x > BEGIN BACKUP and then out of backup)
I also assume that I simply take a backup of my control file (wither in binary form or trace if necessary)
I also assume that you do not back up the Redo Logs (since you reset draw on any recovery anyway)
The bit I'm not sure of is the Undo Tablespace - can be backup in eactly the same way as any other tablespaces?
Y at - it all components that I need backup (outside the archive logs)
Thank you
JimAlways provide the Oracle version 4-digit.
The documentation covers all of the steps required for a manual backup.
http://docs.Oracle.com/CD/B28359_01/backup.111/b28270/osbackup.htm#CEGJIHJF
See Chapter 27 Making User-Managed database backup for instructions.
Maybe you are looking for
-
Firefox suddenly now covers the entire screen and even excludes the icon in the lower right.
The browser page originally did not cover all of the page too, I have to place my cursor on the upper limit of the browser page to access research and the Firefox toolbar now.
-
T520 DisplayPort does not recognize the HD4K monitor
T420 race that 6.7 RHEL is unable to see a P2715Q HD4K Dell monitor DisplayPort connection. I have no problem connecting to monitors 1080 p Dell P2414H to work, but not this 4K monitor at home. Further research and discussions with colleagues suggest
-
Hello I have a 1 d array (say size 1000, each element of the array range from 0 to 255) and try to compare each element to a threshold (say 100). If the array element is less than the threshold of 100 replace it with the value 1, otherwise replace it
-
My CD/DVD RW optiarc dvd rw ad-7560 s ata device suddenly stopped working I get a "code 10 this device cannot start. I have uninstalled and still get this error. When I put a CD in nothing happens. It is not read. Any suggestions?
-
The on-screen display is backwards. How to turn it back to its normal position?
My screen got upside down. I don't know how to get back to its normal position.