How to generate an entity-relationship (ER) diagram using Oracle SQL Developer

Create a diagram for existing database schema or its subset as follows: Click File → Data Modeler → Import → Data Dictionary. Select a DB connection (add one if none). Click Next. Check one or more schema names. Click Next. Check one or more objects to import. Click Next. Click Finish. The ERD is displayed. … Read more

ORA-06508: PL/SQL: could not find program unit being called

I suspect you’re only reporting the last error in a stack like this: ORA-04068: existing state of packages has been discarded ORA-04061: existing state of package body “schema.package” has been invalidated ORA-04065: not executed, altered or dropped package body “schema.package” ORA-06508: PL/SQL: could not find program unit being called: “schema.package” If so, that’s because your … Read more

Sql*plus always returns exit code 0?

You have to explicitly tell sqlplus to do that, in your script. Basically, there are two statements that you can use: WHENEVER SQLERROR EXIT SQL.SQLCODE WHENEVER OSERROR EXIT For example: WHENEVER SQLERROR EXIT SQL.SQLCODE begin SELECT COLUMN_DOES_NOT_EXIST FROM DUAL; END; / And for OS errors: WHENEVER OSERROR EXIT FAILURE START no_such_file For more information, see … Read more

creating parameterized views in oracle11g

The context method is described here: http://docs.oracle.com/cd/B28359_01/network.111/b28531/app_context.htm e.g. (example adapted from the above link) CREATE CONTEXT dates_ctx USING set_dates_ctx_pkg; CREATE OR REPLACE PACKAGE set_dates_ctx_pkg IS PROCEDURE set(d1 in date, d2 in date); END; / CREATE OR REPLACE PACKAGE BODY set_dates_ctx_pkg IS PROCEDURE set(d1 in date, d2 in date) IS BEGIN DBMS_SESSION.SET_CONTEXT(‘dates_ctx’, ‘d1′, TO_CHAR(d1,’DD-MON-YYYY’)); DBMS_SESSION.SET_CONTEXT(‘dates_ctx’, ‘d2’, … Read more

Spring Batch ORA-08177: can’t serialize access for this transaction when running single job, SERIALIZED isolation level

From official doc – 4.3.1 The default isolation level for that method is SERIALIZABLE, which is quite aggressive: READ_COMMITTED would work just as well; READ_UNCOMMITTED would be fine if two processes are not likely to collide in this way. However, since a call to the create* method is quite short, it is unlikely that the … Read more