Can you explain how the following query works?
"alter database recover automatic using backup control file until cancel;"
This really isn't a query but rather a command. Basically, the command above will recover from a situation where you lost your control files and have to use a backup control file, which is out of sync with the database. The USING BACKUP CONTROLFILE clause instructs Oracle that recovery of the database will be performed with incomplete information. If you had a current control file, it would know the last transaction number (SCN) and stop recovery once that transaction has been reached. Since you do not know the last SCN, Oracle does not know when to stop. So it is up to the DBA to tell Oracle when to cancel the application of recovery, hence the UNTIL CANCEL clause.
Dig Deeper on Oracle database administration
Oracle expert Brian Peasland answers one reader's question about common pitfalls when connecting Oracle to outside programs.
One reader asks expert Brian Peasland a question about datafile sizes with the Oracle RMAN duplicate 10g command.
Managing parent table-child table relations in Oracle SQL environments is key to efficient programming.