e.g. the 3rd highest salary/department?
Number the values with
DENSE_RANK () OVER ( PARTITION BY ... ORDER BY ... DESC )
Then filter where the output of this is 3
Manish Sharma demos
e.g. the 3rd highest salary/department?
Number the values with
DENSE_RANK () OVER ( PARTITION BY ... ORDER BY ... DESC )
Then filter where the output of this is 3
Manish Sharma demos
@danischnider.bsky.social compares using
Hashes as CHAR(32) and RAW(16)
Sequences as NUMBER
And finds in Oracle #SQL
NUMBER is faster than RAW
RAW is faster than CHAR
@danischnider.bsky.social compares using
Hashes as CHAR(32) and RAW(16)
Sequences as NUMBER
And finds in Oracle #SQL
NUMBER is faster than RAW
RAW is faster than CHAR
@antikyte.bsky.social shows how to recover in Oracle AI Database when you accidentally remove data with
FLASHBACK TABLE ... TO
BEFORE DROP => restore a dropped table
TIMESTAMP => revert to a point in time
@antikyte.bsky.social shows how to recover in Oracle AI Database when you accidentally remove data with
FLASHBACK TABLE ... TO
BEFORE DROP => restore a dropped table
TIMESTAMP => revert to a point in time
But writing these can be fiddly
To help you with this, @zorantica.bsky.social has built
Data JAM for Oracle (Journaling & Auditing Module)
An #orclAPEX app to automate audt tables and triggers
Get it at
But writing these can be fiddly
To help you with this, @zorantica.bsky.social has built
Data JAM for Oracle (Journaling & Auditing Module)
An #orclAPEX app to automate audt tables and triggers
Get it at
EXCEPTION WHEN OTHERS THEN
Catches all errors
Filling your code with this without reraising the error hides unexpected issues
So the compiler raises PLW-6009 to warn you
If you reraise in custom logging procedures use
PRAGMA SUPPRESSES_WARNING_6009
To skip this warning
EXCEPTION WHEN OTHERS THEN
Catches all errors
Filling your code with this without reraising the error hides unexpected issues
So the compiler raises PLW-6009 to warn you
If you reraise in custom logging procedures use
PRAGMA SUPPRESSES_WARNING_6009
To skip this warning
This browser-based tool enables you to run and share #SQL statements
Even better, you can now connect to your schema from clients on your machine using SQL*Net
So you can run SQL from your favourite IDE
This browser-based tool enables you to run and share #SQL statements
Even better, you can now connect to your schema from clients on your machine using SQL*Net
So you can run SQL from your favourite IDE
See what was added with DBMS_UTILITY.EXPAND_SQL_TEXT
But this may expose sensitive values!
@connormcd.bsky.social shows how to hide them with contexts
See what was added with DBMS_UTILITY.EXPAND_SQL_TEXT
But this may expose sensitive values!
@connormcd.bsky.social shows how to hide them with contexts
@viniciusdba.com.br has built a script that analyzes AWR data to show
The 20 segments with the largest total size increases
A breakdown of the increase per month for each
Get it at
@viniciusdba.com.br has built a script that analyzes AWR data to show
The 20 segments with the largest total size increases
A breakdown of the increase per month for each
Get it at
@jordangoodman.bsky.social covers common anti-patterns you should avoid, including
Case expressions instead of tables
Functions on indexed columns
Overusing DISTINCT to “fix” duplicates
@jordangoodman.bsky.social covers common anti-patterns you should avoid, including
Case expressions instead of tables
Functions on indexed columns
Overusing DISTINCT to “fix” duplicates
At parse time the database merges these with the parent query, replacing parameters with the actual values passed
Macros come in two types
Scalar - use in SELECT, WHERE, ORDER BY, etc.
Table - use in FROM
At parse time the database merges these with the parent query, replacing parameters with the actual values passed
Macros come in two types
Scalar - use in SELECT, WHERE, ORDER BY, etc.
Table - use in FROM
Understanding Archer queries requires
Arithmetic reasoning
Commonsense inference
Hypotheticals and counterfactuals
Bilingual execution (English + Chinese)
Understanding Archer queries requires
Arithmetic reasoning
Commonsense inference
Hypotheticals and counterfactuals
Bilingual execution (English + Chinese)
MIN ( salary ) KEEP ( DENSE_RANK FIRST ORDER BY hire )
=> Get the lowest salary for the first hire
@quanwenzhao.bsky.social explores it & alternatives
MIN ( salary ) KEEP ( DENSE_RANK FIRST ORDER BY hire )
=> Get the lowest salary for the first hire
@quanwenzhao.bsky.social explores it & alternatives
CREATE FLASHBACK ARCHIVE ... RETENTION ...
ALTER TABLE ... FLASHBACK ARCHIVE
Then view the changes with
SELECT * FROM ... VERSIONS BETWEEN ...
@Matt_Mulvaney demos
CREATE FLASHBACK ARCHIVE ... RETENTION ...
ALTER TABLE ... FLASHBACK ARCHIVE
Then view the changes with
SELECT * FROM ... VERSIONS BETWEEN ...
@Matt_Mulvaney demos
But RAW can lead to implicit conversions => poor row estimates
If you're stuck with string comparisons @andrejsql.bsky.social shows how to improve row estimates with
Extended stats
Virtual columns
But RAW can lead to implicit conversions => poor row estimates
If you're stuck with string comparisons @andrejsql.bsky.social shows how to improve row estimates with
Extended stats
Virtual columns
SYS_GUID since "forever", sequential based on host & process
UUID since 23.7, random
But should you store these as RAW(16) or CHAR(32)?
@oyvindisene.bsky.social finds RAW is faster when querying a 100M row table
SYS_GUID since "forever", sequential based on host & process
UUID since 23.7, random
But should you store these as RAW(16) or CHAR(32)?
@oyvindisene.bsky.social finds RAW is faster when querying a 100M row table
SOUNDEX
PHONIC_ENCODE - double metaphone
FUZZY_MATCH - several algorithms, including Jaro-Winkler & Levenshtein
@brendan-tierney.bsky.social compares how they encode spelling variations of Brendan
SOUNDEX
PHONIC_ENCODE - double metaphone
FUZZY_MATCH - several algorithms, including Jaro-Winkler & Levenshtein
@brendan-tierney.bsky.social compares how they encode spelling variations of Brendan
@nakdimon.bsky.social discusses why it's worth using when offline upgrades are OK:
Any time or length upgrades
Separate database & app upgrades
Flexible release of new versions
@nakdimon.bsky.social discusses why it's worth using when offline upgrades are OK:
Any time or length upgrades
Separate database & app upgrades
Flexible release of new versions
But rolling back schema changes is tricky - so plan them
@jasminfluri.bsky.social runs through options
Versioned Migrations with Reversible Scripts
Backups before Changes
Immutable Migrations & Forward Fixes
Restore Points & Flashbacks
But rolling back schema changes is tricky - so plan them
@jasminfluri.bsky.social runs through options
Versioned Migrations with Reversible Scripts
Backups before Changes
Immutable Migrations & Forward Fixes
Restore Points & Flashbacks
Statement in #SQL
Call in PL/SQL
Wrap SYSDATE in a DETERMINISTIC function to trick the compiler into evaluating it once/statement
But beware: this can lead to unwanted behaviour
@salvis.com explores
Statement in #SQL
Call in PL/SQL
Wrap SYSDATE in a DETERMINISTIC function to trick the compiler into evaluating it once/statement
But beware: this can lead to unwanted behaviour
@salvis.com explores
But they change on different dates!
To see when the continents are an hour closer, @kibeha.dk built a pattern-matching query comparing the TIMEZONE_HOUR for dates across the year
But they change on different dates!
To see when the continents are an hour closer, @kibeha.dk built a pattern-matching query comparing the TIMEZONE_HOUR for dates across the year
To do this, set the
ACCESS PARAMETERS (
com.oracle.bigdata.fileformat=parquet
com.oracle.bigdata.credential.name=...
com.oracle.bigdata.access_protocol=iceberg
)
Bryan Grenn demos
To do this, set the
ACCESS PARAMETERS (
com.oracle.bigdata.fileformat=parquet
com.oracle.bigdata.credential.name=...
com.oracle.bigdata.access_protocol=iceberg
)
Bryan Grenn demos
This adds a GRAPHQL table function that
Accepts #GraphQL queries
Maps fields to database tables and columns
Returns JSON
e.g.
SELECT * FROM GRAPHQL ( ' tab { col1 col2 } ' )
This adds a GRAPHQL table function that
Accepts #GraphQL queries
Maps fields to database tables and columns
Returns JSON
e.g.
SELECT * FROM GRAPHQL ( ' tab { col1 col2 } ' )
Kajal Singh runs through the enhancements added to this in 23.6 for
Mathematical & set functions
Sorting & grouping
Views with expressions
Virtual columns in function-based indexes
Kajal Singh runs through the enhancements added to this in 23.6 for
Mathematical & set functions
Sorting & grouping
Views with expressions
Virtual columns in function-based indexes
PARTITION BY LIST ( ... ) AUTOMATIC
Or convert existing tables with
ALTER TABLE ... SET PARTITIONING AUTOMATIC
@antikyte.bsky.social demos
PARTITION BY LIST ( ... ) AUTOMATIC
Or convert existing tables with
ALTER TABLE ... SET PARTITIONING AUTOMATIC
@antikyte.bsky.social demos
This adds the QUALIFY clause
QUALIFY filters window functions after grouping
Like the HAVING clause does for aggregate functions
SELECT ... FROM ...
QUALIFY fn OVER ( ... ) > ...
This adds the QUALIFY clause
QUALIFY filters window functions after grouping
Like the HAVING clause does for aggregate functions
SELECT ... FROM ...
QUALIFY fn OVER ( ... ) > ...