Close

CQ Notification deregistration with java

The Oracle Change Notification or Continuous Query Notification functionality is a useful means of triggering events in remote sessions when a transaction commits. Sometimes though a client may set up a registration and then disappear leaving orphaned registrations. Using the DBMS_CHANGE_NOTIFICATION package (documented by it’s synonym DBMS_CQ_NOTIFICATION) these old entries can be removed easily with…

Licensing changes for Spatial and Advanced Analytics/Machine Learning

Today, Oracle announced both the “Oracle Spatial and Graph” as well as the “Oracle Machine Learning” (formerly Advanced Analytics) database options are now included at no additional cost for on-premises installations of Enterprise Edition and Enterprise Edition on Engineered Systems. These options provide a wealth of functionality that were formerly extra cost options. You can…

Password paper update

I added an appendix for special user accounts that don’t follow the normal password rules to my paper describing the password hashing and storage. Some users have no hash at all but are instead stored with fixed values. ANONYMOUS – SYS.USER$.PASSWORD has a value of exactly 16 spaces.  The SPARE4 column is NULL.  Since the…

Dynamic SQL Templates

Frequently, when dynamic sql is used it takes a form similar to this: v_sql := ‘select ‘ || CASE WHEN choice1 IN (‘A’, ‘B’) THEN ‘col1, col2’ WHEN choice = ‘C’ THEN ‘col2,col3’ ELSE ‘col4,col5’ END || ‘ from ‘ || CASE WHEN choice2 IN (‘X’, ‘Y’, ‘Z’) THEN ‘table1’ ELSE ‘table2’ END || ‘…

Bug in JSON_OBJECT with FORMAT JSON

Normally, when syntax is listed as “optional” there should be no functional difference between the inclusion or omission of that syntax. However, with the JSON_OBJECT function, the optional “FORMAT JSON” clause not only changes functionality if you include it, it actually causes the resulting json output to be invalid! This easily verified with a simple…

Extracting APEX Access Control Users

From the APEX Developer’s Guide: When you export an application with the Access Control feature, the application roles, Administrator, Contributor, and Reader, are exported.  However, the users assigned to these roles are not exported. [spelling correction “your”-“you” mine] If the export option won’t put the users into a script for deployment, the obvious question then…

DDL dump of multiple schemas

A few weeks ago I received a question about how to generate DDL for all the tables, procedures, functions, and packages of a set of schemas. Furthermore, the asker wanted each object’s script to be in a distinct file within a directory hierarchy. Specifically, given a base directory, each schema should have its own subdirectory…

Goodbye to another great Collaborate.

Thank you to all that attended my presentations this year both live or in the virtual conference. As promised here are the links to my slides. https://www.dropbox.com/s/d7kjh5rp70ucul0/2019_352_Stuber_ppt.pptx?dl=0 https://www.dropbox.com/s/lqqhb6m8b3vrv0p/2019_354_Stuber_ppt.pptx?dl=0 For session 354, I mentioned expanded versions of some of the dictionary queries. Those maybe found at the following links… https://seanstuber.com/2018/03/08/who-is-using-temp-and-what-are-they-doing/ https://seanstuber.com/2018/03/04/who-is-blocking-whom-and-what-are-they-doing/ Thank you again to all…

Using collections to create variable parameter functions.

If you’re familiar with java, c, c# (or, I’m sure other languages as well) then you’ve probably encountered functions that allow a variable number of input parameters without requiring a fixed set of overloading. Java int my_variable_function(String str, int …intlist) c int my_variable_function(char *str, …) c# int my_variable_function(string str, params int[] intlist) PL/SQL does not…

Introduction to ASH Data, part 2

What is ASH? AWR and Activity Types (this page) Average Active Sessions Graphical Visualizations Previously I showed a few queries using (G)V$ACTIVE_SESSION_HISTORY, but only mentioned the DBA_HIST_ACTIVE_SESS_HISTORY view. Here I’ll extend the query patterns into this historical repository. Where V$ACTIVE_SESSION_HISTORY is a once-per-second snapshot of sessions from memory and kept in memory, the DBA_HIST_ACTIVE_SESS_HISTORY data…

Looking Through Holes in Time

While testing some date/time functions today I came across an interesting quirk in Oracle’s Gregorian calendar and different date representations. In the Gregorian calendar, the day after October 4, 1582 is October 15, 1582 (not all countries adopted the calendar immediately, so they have different gaps, but Oracle observes the calendar as it was originally…

Introduction to ASH Data

What is ASH? (this page) AWR and Activity Types Average Active Sessions Graphical Visualizations The Oracle database captures session activity approximately once each second. This data can then be used to identify usage patterns and performance problems. Many performance experts have written very good suites of scripts and tools to query, analyze, and chart the…

How to use DBMS_LDAP (part 4: Attributes)

Table of Contents Introduction Establishing a Connection Searching Hierarchical Data Browsing Attributes (this page) Timeouts Modifying Data Searching Hierarchical Data with Attributes Returning attributes with search results The examples in the prior chapter use the “1.1” code to return no attributes. In this example we’ll return two of the attributes associated with an entry. Instead…

LTRIM, RTRIM, and TRIM

The trimming functions in Oracle frequently are used by many developers; but not all know the full set of options available and how they compare to each other. Sometimes I need to remind myself so this post is as much for me as for others. I hope you find it helpful. The LTRIM and RTRIM…

How to use DBMS_LDAP (part 2: Connecting)

Table of Contents Introduction Establishing a Connection (this page) Searching Hierarchical Data Browsing Attributes Timeouts Modifying Data Establishing a Connection The DBMS_LDAP.INIT function is used to connect to an LDAP server. On success, the function returns a session handle of DBMS_LDAP.SESSION type. FUNCTION init (hostname IN VARCHAR2, portnum IN PLS_INTEGER ) RETURN SESSION; DBMS_LDAP.PORT is…

My KScope2018 slides

Finally getting around to posting these, sorry about the delay. My powerpoint slides can be downloaded here. Some of the slides included simplified queries so the text would fit on a single screen and remain legible. To find who is using temp, a more functionally robust query can be found here: /2018/03/08/who-is-using-temp-and-what-are-they-doing/ Similarly, the who…

18c JSON TO_UTC_TIMESTAMP_TZ bug

I tried the following query on 18c via Oracle’s LiveSQL site and the results don’t correspond to the documented functionality; or, at least, not my reading of the functionality. select to_utc_timestamp_tz(‘2018-04-27’) t from dual union all select to_utc_timestamp_tz(‘2018-04-27T17:40:25+00:00’) from dual union all select to_utc_timestamp_tz(‘2018-04-27T17:40:25Z’) from dual union all select to_utc_timestamp_tz(‘20180427T174025Z’) from dual union all select…