Oracle

Simple SQL windowing functions

Here is an example function showing the maximum difference between a timestamp field in row for a given partition (the SQL dialect is old Oracle 11gR2): cat fgreat.sql set line 232 SELECT process_running, run_number, exec_seq, exec_timestamp as station_time, lead(exec_timestamp) OVER (partition by run_number order by exec_timestamp) – exec_timestamp as time_to_next_row FROM benchmark where run_number=&1 order …

Simple SQL windowing functions Read More »

Oracle RMAN restore & recover until – assuming you don’t have redo or just want to recover to an earlier point

assuming you have the control FILE and after a “startup mount;” using the controlfile to restore/RECOVERABLE rman target /restore database UNTIL TIME“to_date(’12/31/2021 11:34:50 am’,’mm/dd/yyyy hh:mi:ss am’)”; recover database UNTIL TIME“to_date(’12/31/2021 11:34:50 am’,’mm/dd/yyyy hh:mi:ss am’)”; alter database open resetlogs; OR run{set UNTIL TIME “to_date(’12/31/2021 11:34:50 am’,’mm/dd/yyyy hh:mi:ss am’)”;restore database;recover database;alter database open resetlogs;}