R embeddied in SQL - ggplot2 package
Hello!
I have
Database Oracle 12 c, R 3.0.1 ORE 1.4
installed.
I use Oracle SQL Developer 4.0.0.
In RStudio, with ORE client connected to the server of ore, I installed ggplot2 library.
When I run after the code in SQL Developer, I get no results
BEGIN
sys.rqScriptDrop ('PNG_Example');
sys.rqScriptCreate ('PNG_Example',
"function() {}
x < - 1/100
y <-log(1:100)
Library (ggplot2)
qplot(x,y)
}');
END;
/
SELECT *.
TABLE (rqEval (NULL, 'PNG', 'PNG_Example'));
Why is it so? I missed something?
I need to have embedded in the SQL code ggplot2 graphics, not only simple graphs based on the basic plot.
Hello
The qplot function returns a ggplot object. The chart does not display until you call print or draw on the object:
Plot (qplot(x,y))
Sherry
Tags: Business Intelligence
Similar Questions
-
in this case
BEGIN
sys.rqScriptDrop ('PNG_Example');
sys.rqScriptCreate ('PNG_Example',
"function() {}
x < - 1/100
y <-log(1:100)
Library (ggplot2)
Plot (qplot(x,y))Sherry Lamonica-Oracle
}');
END;
/
SELECT *.
TABLE (rqEval (NULL, 'PNG', 'PNG_Example'));
Oralce can trace an image size .default is 480px * 480px
I can chang set out size. (example 840px * 640px)
Thank you ~.
to resize the result use the parameter ore.png.height and ore.png.width
example of
Select * from table (rqEval (cursor (select 1 as "ore.connect", like "ore.png.height" 700, 700 as "ore.png.width" of the double), "PNG", 'your_script'));
HTH
Jaromir Nemec D.B.
-
Hi all
Recently I came across the "dbms.sqldiag_internal" package in oracle's blog.
It has been mentioned that this package can be used to create fix sql with notes, thus changing the path queries generated by applications packaged as siebel.
I googled carefully on the creation of this patch, but in vain. There was one and only reference to blogs.oracle.com with an example. Also, this has not been documented by Oracle.
So I would like to know if someone tried to create patches SQL in this way and they was useful?
If so could provide me with some references for the implementation step by step?
Please find below oracle blog link:
https://blogs.Oracle.com/optimizer/entry/how_can_i_hint_aRecently I came across the "dbms.sqldiag_internal" package in oracle's blog
I think that it was news to most of us.
The implementation step by step has been detailed in the blog that you linked.
The most important point on application of your own sql patch is if it is supported, and why you would use this approach on an approach supported and documented using a base plan sql?
I asked the question on the blog, but he has not spent with moderation and not responded to.
You can certainly use base lines to amend the plan packaged sql using dbms_spm.load_plans_from_cursor_cache, for example
http://OraStory.WordPress.com/2011/10/13/no-need-to-change-source-code-hint-it-using-a-baseline/ -
PACKAGE BODY APPS. AD_ZD_ADOP contains errors
APP TIER - Linux - SLES 11 - SP2 - x86_64
DB LEVEL - Linux for system Z - SLES 11 - SP2 - s390
I encounter errors in the body to Package APPS. AD_ZD_ADOP, that has brought all the patches to a status quo on our schedule instance.
The sequence of events have been
The following hotfixes have been applied.
- Patch 19462638
- Patch 19197270
- Patch 21132723
- 19330775
- 20677045
- 19259764
Doc 1617461.1 was followed - B path of
After Patch 19259764 has been applied, all steps until step 8 of Doc 1617461.1 have been completed.
Failure of the fs_clone step (step 9). My colleague opened a SR - advice was far from expected.
Yesterday, I took this with success and more cloned the fix for the file system to perform file system (1383621.1) - however, I'm still not able to run fs_clone with success.
Even a basic ADADMIN session fails.
Here are the errors while trying to compile APPS package bodies. AD_ZD_ADOP
SQL > alter package APPS. AD_ZD_ADOP compile body;WARNING: The bodies of Package modified with compilation errors.
SQL > show errors;
Errors for BODY of PACKAGE applications. AD_ZD_ADOP:LINE/COL ERROR
-------- -----------------------------------------------------------------
2503/3 PL/SQL: statement ignored
2503/7 PLS-00201: identifier ' SYS. DBMS_METADATA_UTIL' must be declared
SQL >Also while trying to launch ADADMIN, I get errors themselves.
Error of Administration AD:
ORA-04063: package body "APPS. AD_ZD_ADOP"contains errors
Could not insert the record of the action in the table of patches
Error of Administration AD:
Error when you try to insert adadmin task CMP_INVALID action
Update running adadmin of failure actions
Error of Administration AD:
The following ORACLE error:
ORA-01756: city not properly finished chain
occurred while executing the SQL statement:
UPDATE ad_adop_session_patches set status = 'F' where status = 'R' and
as numero_de_bogue ' ADADMIN
Error of Administration AD:
Table ad_adop_session_patches update errors
You must check the file
/U02/fs_ne/EBSapps/log/ADadmin/log/ADadmin.log
to find errors.
Can someone please. I have also a SR - but nice try various channels to find a solution.
Hello
The necessary subsidies on the SYS package may be missing. DBMS_METADATA_UTIL.
Try this command (as sysdba) and compile the package:
Grant execute on SYS. DBMS_METADATA_UTIL applications;
Kind regards
Bashar
-
How to install SQL Developer 4.1 on Win10?
Hi guys,.
today I tried to install the SQL Developer 4.1 on a Win10 machine. First of all, I tried with the version that contains the JDK and then I installed the jdk1.8.0_51 manually and used normal SQL Developer packages.
My problem is that the SQLDeveloper cannot be started. During the first trial an error has occurred that a dll could not be run. With the manual installed JDK SQLDeveloper processes is killed during the splash screen and start something with "Register"... »
Thanks for your comments
Andy
> error has occurred that a dll could not be run
Remember you of what was the real error message?
You can try to delete the application profiles for SQL Developer data directory and try again
-
package body "APPS. AD_ZD_ADOP' mistakes adoption apply fail
Hello to any help/solution for this error:
EBS version 12.2
Intend to upgrade to 12.2.4 then only may apply Doc-Id 1617461.1 :
"adoption phase = apply patches = 19330775, 20677045 = /hotpatch merge Yes = yes".
Validation of the system configuration...
[ERROR] Could not execute the SQL statement:
Select AD_ZD_ADOP. The double GET_INVALID_NODES()
[ERROR] Error message:
[ERROR] Could not execute the SQL statement:
Select AD_ZD_ADOP. The double GET_INVALID_NODES()
[ERROR] Error message:
[UNEXPECTED] '-1' nodes are listed in the table ADOP_VALID_NODES, but not in the FND_NODES table.
[UNEXPECTED] To fix this problem, run AutoConfig on the nodes '-1 '.
[UNEXPECTED] Error checking if it is an instance of multi node
SQL > ALTER PACKAGE APPS. BODY OF AD_ZD_ADOP OF COMPILATION;
WARNING: The bodies of Package modified with compilation errors.
SQL > SHOW ERRORS, PACKAGE BODY APPS. AD_ZD_ADOP
Errors for BODY of PACKAGE applications. AD_ZD_ADOP:
LINE/COL ERROR
-------- -----------------------------------------------------------------
505/13 PL/SQL: statement ignored
507/86 PL/SQL: ORA-00904: "SESSION_TYPE": invalid identifier
511/13 PL/SQL: statement ignored
513/86 PL/SQL: ORA-00904: "SESSION_TYPE": invalid identifier
521/12 PL/SQL: statement ignored
524/18 PL/SQL: ORA-00904: "SESSION_TYPE": invalid identifier
533/9 PL/SQL: statement ignored
535/121 PL/SQL: ORA-00904: "SESSION_TYPE": invalid identifier
575/9 PL/SQL: statement ignored
577/123 PL/SQL: ORA-00904: "SESSION_TYPE": invalid identifier
1580/7 PL/SQL: statement ignored
LINE/COL ERROR
-------- -----------------------------------------------------------------
1582/65 PL/SQL: ORA-00904: "SESSION_TYPE": invalid identifier
SQL >
Thank you!
Luis
Hello
The solution is:
1. check that your ad_adop_session_patches.xdf file is version 120.6.12020000.4
grep Header $AD_TOP/patch/115/xdf/ad_adop_session_patches.xdf
2. If the version is correct, then run this command (from Bug 18544083 : ADOPTION: ORA-04063: "APPS.) (AD_ZD_ADOP"CONTAINS ERRORS / ORA-00904:"SESSION_TYPE"):
adjava-mx512m - nojit oracle.apps.fnd.odf2.FndXdfCmp applsys APPS apps APPS thin
: : table $AD_TOP/patch/115/xdf/ad_adop_session_patches.xdf $FND_TOP/patch/115/xdf/xsl changedb = y Please put in the host current (complete), port, and SID
NOTE: If you want to test the command first, please change "changedb = y" to "changedb = n".
3. Please retry compilation AD_ZD_ADOP (or try running ADZDADOPB.pls).
4. If the compilation of work, retry the patch.
Kind regards
Luis
-
DBMS_REDEFINITION package leads to a PLS00201 compilation error
I try to put a logic of redefining online within a packet but direct issues, in particular the package doesn't seem to know DBMS_REDEFINITION. I can run DBMS_REDEFINITION, only not go in a package or a program named.
Here is a minimal example that fails:
-- Executed by the same user -- This works just fine: BEGIN DBMS_OUTPUT.PUT_LINE(SYS.DBMS_REDEFINITION.CONS_USE_ROWID); END; -- This generates PLS-00201 error on SYS.DBMS_REDEFINITION: CREATE OR REPLACE PACKAGE testpkg AUTHID CURRENT_USER AS gc_int PLS_INTEGER := SYS.DBMS_REDEFINITION.CONS_USE_ROWID; END testpkg; -- This does not work because testpkg is invalid: BEGIN DBMS_OUTPUT.PUT_LINE(testpkg.gc_int); END;
The problem is that I can run these instructions to the same user within the same session and I still get the error PLS. I even ran on my own system of sandbox (12 c VM) where I have system privileges, but it does not work. I fiddled with the AUTHID clause but that did not help.
Related discussions:
Any suggestions?
How grant you permission to this user to use dbms_redefinition? It must be a direct subsidy without a role:
Connected to: Oracle Database 11g Release 11.2.0.4.0 - 64bit Production SQL> CREATE OR REPLACE PACKAGE testpkg 2 AUTHID CURRENT_USER 3 AS 4 gc_int PLS_INTEGER := SYS.DBMS_REDEFINITION.CONS_USE_ROWID; 5 END testpkg; 6 / Warning: Package created with compilation errors. SQL> drop package testpkg; Package dropped. SQL> conn / as sysdba Connected. SQL> grant all on dbms_redefinition to hr; Grant succeeded. SQL> conn hr/hr Connected. SQL> CREATE OR REPLACE PACKAGE testpkg 2 AUTHID CURRENT_USER 3 AS 4 gc_int PLS_INTEGER := SYS.DBMS_REDEFINITION.CONS_USE_ROWID; 5 END testpkg; 6 / Package created.
-
Running SQL scripts on different databases
Hello!
At my work we have many databases on a server. I have to make a request so that users can run the application on a selected database SQL scripts.
So my question may be separated into 2 sections:
1 - is possible to let users SQL scripts run directly from the application?
I think a database to create a page that displays the list of all the SQL scripts, that we want to use, and when you click on a specific script name in the list, it asks something like "Where the database you want to run the script?", and then, as confirmed by the user, it would show results running the script on a different page.
is 2 - possible to let users choose what database to run these scripts?
Any information would be helpful, I'm at the beginning of the project and am not sure at all about how to proceed, or if it is at all possible.
Thank you!
Fallen_Kaede wrote:
Thanks for the quick response. I confirm that we are talking about databases on a server.
The request is to "debug" to other databases. For example, be run scripts to the locks on the list, to show the different indexes on a table, etc. to help diagnose problems.
It looks like the 'users' are DBA who should use OEM/Grid Control to do so.
1 - is possible to let users SQL scripts run directly from the application?
Lol the only way to run scripts in the APEX is the use of the SQL Scripts for SQL workshop component.
The key word in your question is 'application '. SQL * more and Developer SQL are applications that allow users to run SQL scripts on the desktop. Scripts SQL is an APEX integrated application that allows developers to run SQL scripts on the web. However, there is no documented way supported for end users to run SQL scripts in a custom of APEX application that you created. Therefore, rethink your approach. Rather than create an application APEX runs scripts, you must convert the scripts in PL/SQL, APEX packages, pages, components and applications leverage features of the APEX and reports, graphics and interactivity (e.g. exploration links; timed refreshes etc.). This will give you a user experience improved, beyond what is possible using static SQL scripts.
is 2 - possible to let users choose what database to run these scripts?
The APEX applications would exist on an instance of the APEX in a database and access other databases using the database links (which can have a performance impact). It would be possible to create a LOV based on the view of the USER_DB_LINKS dictionary and use in a selection set to a global page list to provide a control to set the current context of the database. Region data sources will have to be generated dynamically in the packages of PL/SQL use the links from relevant database based on this value LOV.
-
Package body dropped, but showing invalid
Nice day:
Oracle 11 g 2
I created a Package with Package bodies, procedures 3, which works very well. I can call it without error. However, if I run this query:
SELECT *.
From user_objects
Situation WHERE = "INVALID."
I get the following result:
OBJECT_NAME SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED LAST_DDL_TIME TIMESTAMP STATUS TEMPORARY GENERATED SECONDARY NAMESPACE EDITION_NAME TASK_PROCEDURES 28700 PACKAGE BODY 5 July 14 July 11, 14 2014-07 - 11:18:42:39 Not valid N N N 2 It is an old package body, that I dropped it about 4 days ago. That is always supposed to show if I run this query?
I work with Oracle SQL Developer, using almost the same version too. I don't think that it has nothing to do with the tool as the data dictionary shows this info too.
Could you post the exact commands that you run from a sql more session? And the sql like too much output.
Example (demo of pseudo code)
SQL > alter the package xxx body compilation;
SQL > compiled package.
SQL > show errors
SQL > no error
SQL > drop package xxx;
SQL > package abandoned;
SQL > drop package body xxx.
???
SQL > select xxx.someFunction from double;
I could explain the behavior if you have enabled the editions (CDE). But there is no air if in your case.
Just to be absolutely sure of it. Make the select statement and after the release:
select object_name, object_type, namespace, edition_name from user_objects_ae where object_name = 'YOURPACKAGENAME';
-
ORA-04063: package body "APPS. HZ_PARTY_STAGE"contains errors
Hello
Received the error when compile. Checked in the Note: 427418.1 did not work. Help, please. It's 12.1.3, 11.2.0.3 Linux database.
SQL > alter package APPS. HZ_PARTY_STAGE compile body;
WARNING: The bodies of Package modified with compilation errors.
SQL > show err
Errors for BODY of PACKAGE applications. HZ_PARTY_STAGE:
LINE/COL ERROR
-------- -----------------------------------------------------------------
85/5 PL/SQL: statement ignored
85/5 PLS-00201: identifier ' AD_CTX_DDL. DROP_PREFERENCE' must be
has said
95/5 PL/SQL: statement ignored
95/5 PLS-00201: identifier ' AD_CTX_DDL. CREATE_PREFERENCE' must be
has said
96/5 PL/SQL: statement ignored
96/5 PLS-00201: identifier ' AD_CTX_DDL. SET_ATTRIBUTE' must be declared
3313/28 PL/SQL: statement ignored
LINE/COL ERROR
-------- -----------------------------------------------------------------
3313/28 PLS-00201: identifier ' AD_CTX_DDL. SYNC_INDEX' must be declared
3322/27 PL/SQL: statement ignored
3322/27-PLS-00201: identifier ' AD_CTX_DDL. SYNC_INDEX' must be declared
3352/24 PL/SQL: statement ignored
3352/24 PLS-00201: identifier ' AD_CTX_DDL. SYNC_INDEX' must be declared
3362/23 PL/SQL: statement ignored
3362/23 PLS-00201: identifier ' AD_CTX_DDL. SYNC_INDEX' must be declared
3399/26 PL/SQL: statement ignored
3399/26-PLS-00201: identifier ' AD_CTX_DDL. SYNC_INDEX' must be declared
3409/26 PL/SQL: statement ignored
3409/26-PLS-00201: identifier ' AD_CTX_DDL. SYNC_INDEX' must be declared
LINE/COL ERROR
-------- -----------------------------------------------------------------
3447/27 PL/SQL: statement ignored
3447/27-PLS-00201: identifier ' AD_CTX_DDL. SYNC_INDEX' must be declared
SQL > grant execute on AD_CTX_DDL. DROP_PREFERENCE applications;
Grant execute on AD_CTX_DDL. Applications DROP_PREFERENCE
*
ERROR on line 1:
ORA-04042: procedure, function, package, or package body does not exist
The solution in the doc, you mentioned in your first post. Run the dctxpkg.sql script and pass the correct settings and make sure that it runs successfully.
Thank you
Hussein
-
Compilation of package body failed in 11.2.0.3, 12.1.3
Hello:
We have 11.2.0.3, 12.1.3, Linux system.
I want to recompile the next but no luck. Some help please?
I gave up the link db and re-created, set password apps, tried. The following document tracking "Invalid Package, ORA-04052 FII_AP_INV_PAYMTS_F_C ORA-00604 ORA-01017 ORA-02063 (Doc ID 888253.1) ' I got this when importing a database whold.
SQL > ALTER PACKAGE APPS. BODY OF FII_PA_REVENUE_F_C OF COMPILATION; ALTER PACKAGE APPS. BODY OF COMPILATION FII_PA_REVENUE_F_C
* ERROR at line 1:
ORA-04052: error occurred when searching to the top of the remote object APPS. EDW_LOCAL_INSTANCE@EDW_APPS_TO_WH.ZZZDB
ORA-00604: an error has occurred at the SQL level 1 recursive
ORA-01017: name of user and password invalid. connection refused
ORA-02063: preceding the line of EDW_APPS_TO_WH
Thanks and regards.
Please make sure that you pass the correct host name, port number, SID to the create command.
$ sqlplus apps.
SQL > drop database link EDW_APPS_TO_WH;
SQL > create database EDW_APPS_TO_WH link connect
identified using the "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST=
). (Port =
)) (CONNECT_DATA = (SID = )))'; Thank you
Hussein
-
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.
-
Reg - pl sql conditional compilation
Version details
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi PL/SQL Release 10.2.0.4.0 - Production CORE 10.2.0.4.0 Production TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio NLSRTL Version 10.2.0.4.0 - Production
create or replace package r_dummy_pkg is procedure proc_table_doesnt_exist; procedure proc_valid; end; / show err; create or replace package body r_dummy_pkg is procedure proc_table_doesnt_exist is l_count number; begin select count(*) into l_count from doesnt_exist_tbl; end proc_table_doesnt_exist; procedure proc_valid is begin dbms_output.put_line('Fine'); end proc_valid; end; / show err;
Updated the my code using conditional Compilation and she got well compiledSQL> @"H:\Raghu\INDEX\cc.sql" Package created. No errors. Warning: Package Body created with compilation errors. Errors for PACKAGE BODY R_DUMMY_PKG: 7/3 PL/SQL: SQL Statement ignored 9/8 PL/SQL: ORA-00942: table or view does not exist SQL>
create or replace package r_dummy_pkg is $if $$rgh_cc $then procedure proc_table_doesnt_exist; $end procedure proc_valid; end; / show err; create or replace package body r_dummy_pkg is $if $$rgh_cc $then procedure proc_table_doesnt_exist is l_count number; begin select count(*) into l_count from doesnt_exist_tbl; end proc_table_doesnt_exist; $end procedure proc_valid is begin dbms_output.put_line('Fine'); end proc_valid; end; / show err;
I tried activation conditioning block, but I don't understand howSQL> @"H:\Raghu\INDEX\cc.sql" Package created. No errors. Package body created. No errors. SQL>
Is something wrong with the alter, I published? How to make part of the compiled code?SQL> alter package r_dummy_pkg compile plsql_ccflags='rgh_cc:true'; Warning: Package altered with compilation errors. SQL> show err ERROR: ORA-00907: missing right parenthesis SQL> alter package r_dummy_pkg compile body plsql_ccflags='rgh_cc:true'; Warning: Package Body altered with compilation errors. SQL> show err ERROR: ORA-00907: missing right parenthesis
First of all I don't know how you get:
SQL> alter package r_dummy_pkg compile plsql_ccflags='rgh_cc:true'; Warning: Package altered with compilation errors. SQL> show err ERROR: ORA-00907: missing right parenthesis
I can't reproduce on 10.2.0.4.0 and 11.2.0.1.0:
SQL> alter package r_dummy_pkg compile plsql_ccflags='rgh_cc:true'; Warning: Package altered with compilation errors. SQL> show err SP2-0564: Object "r_dummy_pkgplsql_ccflags='rgh_cc:true'" is INVALID, it may not be described. SQL>
For errors you need:
SQL> select text 2 from user_errors 3 where name = 'R_DUMMY_PKG' 4 / TEXT ------------------------------------------------------------- PL/SQL: ORA-00942: table or view does not exist PL/SQL: SQL Statement ignored SQL>
Now ' is something wrong with the alter, I published? How to make part of the compiled code? ».
There is nothing wrong with the ALTER statement. Since when the package was compiled for the first time $$ rgh_cc has not been set to TRUE proc_table_doesnt_exist procedure was not part of compilation - just part of the source code. But as soon as you issue ALTER that defines $$ rgh_cc was true package is recompiled and procedure proc_table_doesnt_exist becomes a part of the compilation. Obviously the compilation fails because the proc_table_doesnt_exist procedure reference table while no.
SY.
-
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.
-
The SYS application error. Object in SQL Developer
When I run the query [select * from object;] in sql developer with sys as sysdba in oracle 10g, it gives me an error
ORA-04045: errors during recompilation/revalidation of SYS. OBJECT
ORA-06553: PLS-213: STANDARD package is not accessible
04045 00000 - 'errors during recompilation/revalidation of s.%s'
* Cause: This message indicates the object to which the following
errors apply. Errors occurred during implicit
recompilation/revalidation of the object.
* Action: Check the following errors for more information, and
make the necessary corrections to the object.
SQL > SELECT * from dba_objects where owner = 'SYS' and object_name = "object";
OWNER
------------------------------
OBJECT_NAME
--------------------------------------------------------------------------------
SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID, OBJECT_TYPE
------------------------------ ---------- -------------- -------------------
CREATED LAST_DDL_ TIMESTAMP STATUS T G S
--------- --------- ------------------- ------- - - -
SYS
OBJECT
VIEW OF 2369
22 OCTOBER 05 9 OCTOBER 11 2005-10 - 22:21:45:28 VALID N N N
SQL > select object_name, object_type, status, owner of dba_objects where object_name = 'STANDARD ';
OWNER
------------------------------
OBJECT_NAME
--------------------------------------------------------------------------------
OBJECT_TYPE STATUS
------------------- -------
SYS
STANDARD
PACKAGE VALID
SYS
STANDARD
VALID PACKAGE BODY
The ones I found are valid. How to fix the object?
Any help? Thank you.You must check the packaging STANDARD is valid and owned by SYS. Do the
Next:(1) check the status of the STANDARD package using:
connect sys /.
SQL > SELECT * FROM DBA_OBJECTS WHERE OWNER = 'SYS '.
AND OBJECT_NAME = 'STANDARD ';If you find the status is "DISABLED" then:
SQL > ALTER THE STANDARD PACKAGE COMPILATION;
You will find also a number of other packages 'is not valid.
State. They must ALL be (re) compiled.If you find the STANDARD does not exist then:
Check "$ORACLE_HOME/rdbms/admin/standard.sql" exists.
If this file does not exist then:
You probably have not installed PL/SQL.
You must use the Setup program to install PL/SQL.If the file does not exist then:
Make sure your ORACLE_SID is set correctly:
SQL > connect sys /.
SQL > @$ORACLE_HOME/rdbms/admin/catproc.sql(2) check that the STANDARD is owned by SYS:
SQL > SELECT * FROM DBA_OBJECTS WHERE OBJECT_NAME = 'STANDARD ';
If OWNER! = SYS then catproc.sql has not been executed correctly
by SYS. You will have to drop these packets and re-run catproc
as SYS.(3) try to run 'catalog.sql' and 'catproc.sql' at the opening of a spool file
to intercept errors that may have occurred.Look for errors such as:
ORA-00604: an error has occurred at the SQL level 1 recursive
ORA-04031: unable to allocate 2 192 bytes of memory ("pool shared, shared(', ' PROCEDURE$ ', 'KQLS bunch', 'BLOCK the MEM KQLS')
Create or Replace:
*
ORA-06553: PLS-213: STANDARD package is not accessible
Grant execute on STANDARD to the publicORA-04042: procedure, function, package, or package body does not exist
In this case, you need to increase the 'SHARED_POOL_SIZE' in the
"init .ora. Then run back CATALOGUE and CATPROC.
Increase "SHARED_POOL_SIZE" will allocate more resources and
allow scripts to run successfully.Explanation:
============The PL/SQL compiler could not find the STANDARD package in the current
Oracle database. To compile a program, PL/SQL needs package STANDARD.I think that; This is useful to solve your problem.
Maybe you are looking for
-
Windows Mail send random email attachments to unknown recipients without my knowledge.
Windows Mail send random email attachments to unknown recipients without my knowledge. The only reason I know this is a postmaster rejects opinion. How can I stop it? original title: Windows e-mail viruses
-
During video playback system crash
I have x 64 bit vista Home premium, it worked fine for about a year after purchase, but then he started crashing randomly while the video is playing, essentially, I replaced the computer part by part to fix the problem but nothing done. Currently I u
-
Problem in the choice of music for the alarm after update of Marshmallow
Hi all, I am a French and I don't speak English well. I come here to have a solution for my problem. This week, I bought Xperia Z5 because my Xperia Z2 screen was broken. With the change of phone, I fall into the "Marshmallow" 6.0 update. I'm not her
-
What is the safest way to get back to Windows 7 from Windows 10?
Windows 7 Edition Home Premium. Open windows yesterday and it is automatically upgraded to Windows 10. To my dismay, some of the files just disappeared. I do have Windows 10! What is the safest way to get back to Windows 7? Restore help?
-
HP CM2320 PCL XL error, internalerror 0 x 50 on office documents
HP CM2320 does not print office documents. Instead, an error report prints as follows... PCL XL error Subsystem: TEXT Error: InternalError 0 x 50 Operator: BeginChar Position: 46 How can I get this printer to work?