Oracle recipes
- Redo log switch (switch the current log file)Redo & Archive
- Add a new redo log groupRedo & Archive
- Resize a redo log group (drop + add)Redo & Archive
- Put the database in ARCHIVELOG modeRedo & Archive
- Fix a full FRA / archive destinationRedo & Archive
- View redo log statusRedo & Archive
- Add disks to an ASM diskgroupASM
- Remove a disk from an ASM diskgroupASM
- Set the ASM rebalance POWERASM
- View ASM diskgroup free spaceASM
- Monitor an ASM rebalanceASM
- Add a new tablespaceStorage
- Add a datafile to an existing tablespaceStorage
- Resize a datafile / set autoextendStorage
- Move a datafile onlineStorage
- Add a temp tablespace / change the defaultStorage
- Tablespace free space queryStorage
- Change a parameter (with SCOPE)Memory & Parameters
- Shared pool / buffer cache flushMemory & Parameters
- Create a pfile from the spfile and vice versaMemory & Parameters
- Change SGA / PGA targetsMemory & Parameters
- Kill a session (kill session)Sessions & Processes
- View long-running queries / sessionsSessions & Processes
- Find the blocking sessionSessions & Processes
- Gather statistics (DBMS_STATS)Maintenance
- Rebuild an index onlineMaintenance
- Quick full backup with RMANMaintenance
- Take a controlfile trace backupMaintenance
- Check RAC database, instance and service status with srvctlRAC & Grid
- Stop / start a RAC database or a single instance with srvctl (rolling)RAC & Grid
- Add a RAC service with preferred/available instances (including Application Continuity)RAC & Grid
- Relocate a RAC service to another instanceRAC & Grid
- Check cluster resource status (crsctl stat res -t)RAC & Grid
- Check cluster stack health, the node list and the Clusterware versionRAC & Grid
- Check OCR integrity and take an OCR backup (ocrcheck / ocrconfig)RAC & Grid
- Check voting disks and CSS timeoutsRAC & Grid
- Run pre/post checks with the Cluster Verification Utility (cluvfy)RAC & Grid
- Diagnose the cause of a node eviction / unexpected node rebootRAC & Grid
- Analyze cluster-wide wait events (gc waits) per instance with GV$RAC & Grid
- Show disk group, disk and directory usage with asmcmd (lsdg / lsdsk / du)ASM
- Check ASM disk state, error counters and candidate disks with SQLASM
- View and change ASM disk group attributes (compatible, disk_repair_time)ASM
- Show the Data Guard broker configuration and database status (DGMGRL)Data Guard
- Check primary/standby role and switchover readiness with SQLData Guard
- Measure transport/apply lag, apply rate and Data Guard processes on the standbyData Guard
- Validate the standby with the broker before switchover/failover (VALIDATE DATABASE)Data Guard
- Perform a planned switchover (DGMGRL, role change without data loss)Data Guard
- Perform a failover after losing the primary (DGMGRL)Data Guard
- Recover the old primary as a standby after a failover (REINSTATE)Data Guard
- Stop / start redo apply or redo transport with the broker; configure delayed applyData Guard
- Enable Fast-Start Failover (FSFO) and start the observerData Guard
- Convert a physical standby to a snapshot standby and back (test environment)Data Guard
- Create an RMAN recovery catalog and register the databaseRMAN
- Create a physical standby from the active database with RMAN DUPLICATERMAN
- Validate and clean up RMAN backup records (CROSSCHECK, EXPIRED, OBSOLETE)RMAN
- Validate the database and backups against corruption (VALIDATE)RMAN
- See which backups a restore would use and validate them (PREVIEW / VALIDATE)RMAN
- Repair corrupt blocks online (block media recovery, RECOVER CORRUPTION LIST)RMAN
- Return a tablespace to a point in the past (TSPITR)RMAN
- Recover a single table to a past point in time from an RMAN backup (RECOVER TABLE)RMAN
- Create a new PDB from PDB$SEEDMultitenant
- Clone a PDB within the same CDB (local / hot clone)Multitenant
- Clone a PDB from another CDB over a DB link (remote clone)Multitenant
- Unplug a PDB and plug it into another (or the same) CDBMultitenant
- Open PDBs and keep them open across CDB restarts (SAVE STATE)Multitenant
- Set per-PDB CPU, memory, I/O and storage limitsMultitenant
- Confirm which container you are in and query all PDBs from the root (CDB_ / CONTAINERS)Multitenant
- Create a refreshable PDB, refresh it and convert it to an independent PDBMultitenant
- Take an AWR snapshot and generate an AWR report between two snapshotsPerformance
- AWR diff (compare period) report between two periodsPerformance
- Top wait events and top SQL from ASH for the last minutesPerformance
- Run an ADDM analysis and get its reportPerformance
- Get a SQL Monitor report (running or completed long SQL)Performance
- Enable/disable 10046 trace for a session and summarize with TKPROFPerformance
- Show the actual execution plan with row source statistics (ALLSTATS LAST)Performance
- Create and run a SQL Tuning Advisor task and read its recommendationsPerformance
- Accept, disable and drop a SQL profilePerformance
- Load a good plan from the cursor cache as a SQL plan baselinePerformance
- Evolve unaccepted SQL plan baseline plansPerformance
- Fix, disable or drop a SQL plan baseline planPerformance
- Check bind peeking and adaptive cursor sharing statusPerformance
- Find top SQL by elapsed time/CPU in a past period (AWR + V$SQLAREA)Performance
- Find stale statistics and set per-table statistics preferences (prefs)Statistics
- Lock and unlock table/schema statisticsStatistics
- Restore statistics to a point in the pastStatistics
- Gather statistics as pending, test them and publishStatistics
- Configure incremental statistics for a partitioned tableStatistics
- Split and merge partitions onlinePartitioning
- Bulk load or archive data with exchange partitionPartitioning
- Truncate/drop a partition while keeping global indexes usablePartitioning
- Create interval partitioning and convert an existing range table to intervalPartitioning
- Verify partition keys and partition-wise join usagePartitioning
- Redefine a table online with DBMS_REDEFINITION (full flow)Online Operations
- Move a table or partition online (ALTER TABLE MOVE ONLINE)Online Operations
- Create, open, set the master key of and back up a TDE keystore (19c+)Security
- Encrypt tablespaces with TDE (new and existing, online/offline)Security
- Create a Unified Auditing policy, enable it conditionally, review records, remove itSecurity
- Add a row-level access policy with VPD (DBMS_RLS)Security
- Create a password policy profile and assign it to usersSecurity
- Find unused privileges with privilege analysisSecurity
- Inspect the inventory with OPatch and run pre-patch checksPatching & Lifecycle
- Update the SQL layer with datapatch -verbose after a binary patchPatching & Lifecycle
- Verify SQL patch history, component status and invalid objectsPatching & Lifecycle
- Create, run manually, disable and drop a scheduler jobScheduler
- Monitor scheduler job run history and failuresScheduler
- Create and activate a simple Resource Manager planScheduler