Tuesday, 26 January 2016

Oracle Flashback Source PLSQL Code

Aaaaarrgh! Just modified some PLSQL in the database and lost what the previous version, with lots of cool stuff in I did this morning! :-(

Luckily, using the AS OF flashback clause I can rewind time and get the code back.
(NB: To get this to work I had to SSH to the server and connect as SYS via SqlPlus)

SELECT text FROM sys.dba_source AS OF TIMESTAMP TO_TIMESTAMP('2016-01-26 12:34:00', 'YYYY-MM-DD HH24:MI:SS') WHERE owner = 'schema' AND name = 'object name' AND type = 'PACKAGE BODY' ORDER BY line ;
Change as required and carry on.