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;}

Oracle 11gR2 and 12c etc. – Create a script that will help recreate a controlfile – using: alter database backup controlfile to trace;

The “alter database backup controlfile to trace;” will create a text based file – human readable – that contains the steps necessary to recreate an Oracle controlfile for a specific database (the database you were connected to when you issue the alter command). See Oracle’s documentation on how to use this file. It actually has …

Oracle 11gR2 and 12c etc. – Create a script that will help recreate a controlfile – using: alter database backup controlfile to trace; Read More »

RMAN Recovery Manager Basics

The following link to Oracle-Base provides basic instruction on backups, restore and recover operations. While it applies to 9i and version newer, it is a very good reference. https://oracle-base.com/articles/9i/recovery-manager-9i