DBA Hub

📋Steps in this guide1/5

PL/SQL New Features and Enhancements in Oracle Database 12c Release 1 (12.1)

Learn about the new features and enhancements to PL/SQL in Oracle 12c Release 1 (12.1).

oracle 12cconfigurationintermediate
by OracleDba
15 views
1

Invoker Rights Functions Can Be Result-Cached

The PL/SQL Function Result Cache was introduced in Oracle 11g Release 1. One of the restrictions on its use was that invoker rights functions could not be cached. This restriction has been removed in Oracle Database 12c Release 1.
2

Libraries Defined Using Directory Objects and Credentials

In previous versions of the database, libraries were defined with an explicit path and were run by as the Oracle software owner. In Oracle 12c, the CREATE LIBRARY statement has been enhanced to allow libraries to be optionally defined using directory objects and credentials ( DBMS_CREDENTIAL ).

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- Pre-12c : Still valid in 12c.
CREATE OR REPLACE LIBRARY my_lib IS '/path/to/my_lib.so';
/

-- 12c : Using Directory to specify path to object.
CREATE OR REPLACE DIRECTORY my_dir AS '/path/to/";

CREATE LIBRARY my_lib AS 'my_lib.so' IN my_dir;
/

--12c : Using credential.
BEGIN
  DBMS_CREDENTIAL.create_credential(
    credential_name => 'my_cred',
    username        => 'me',
    password        => 'my_password');
END;
/

CREATE OR REPLACE LIBRARY my_lib IS '/path/to/my_lib.so' CREDENTIAL my_cred;
/
3

New Predefined Inquiry Directives ($$PLSQL_UNIT_OWNER, $$PLSQL_UNIT_TYPE)

Oracle introduced Conditional Compilation in Oracle 10g. Oracle database 12c includes two new Predefined Inquiry Directives called and , so the list now includes the following. - : The line number of the source code where this directive is located. - : The name of the current PL/SQL program unit. - : The owner of the current PL/SQL program unit. - : The type (procedure, function, package etc.) of the current PL/SQL program unit. - : One of the PL/SQL compilation parameters ( , , , , , , ).
4

PLSQL_DEBUG Compilation Parameter is Deprecated

The compilation parameter is now deprecated. Using now includes compilation of PL/SQL for debugging. This change in functionality of the PLSQL_OPTIMIZE_LEVEL is not listed in parameter documentation itself, but it is mentioned in the PL/SQL Compilation Parameters list.
5

PL/SQL Packages and Types Reference

Although not directly listed as PL/SQL new features, the PL/SQL Packages and Types Reference manual is always filled with lots of changes for each database release. It is worth spending some time looking at the changes that have been introduced with the new release. For more information see: Hope this helps. Regards Tim...

Comments (0)

Please to add comments

No comments yet. Be the first to comment!