Oracle® Database Backup and Recovery Reference 11g Release 1 (11.1) Part Number B28273-01 |
|
|
View PDF |
Purpose
Use the ALTER DATABASE
command to mount or open a database.
Syntax
alterDatabase::=
Prerequisites
Execute this command either within the braces of a RUN
command or at the RMAN prompt. The target instance must be started.
Semantics
Syntax Element | Description |
---|---|
MOUNT |
Mounts the database without opening it. Issuing the command with this option is equivalent to the SQL statement ALTER DATABASE MOUNT . |
OPEN |
Opens the database (see Example 2-13). When you open the database after RECOVER DATABASE , RMAN re-creates any locally managed tempfiles recorded in the RMAN repository if necessary. However, if you perform recovery with a backup control file and no recovery catalog, then RMAN does not record tempfiles created after the control file backup in the RMAN repository. Also, RMAN does not re-create the tempfiles automatically. |
RESETLOGS |
Archives the current online redo logs (or up to the last redo record before redo corruption if corruption is found), clears the contents of the online redo logs, and resets the online redo logs to log sequence 1. The RMAN command ALTER DATABASE OPEN RESETLOGS is equivalent to the SQL statement ALTER DATABASE OPEN RESETLOGS .
If you use a recovery catalog, then RMAN issues an implicit |
Examples
Example 2-13 Making a Consistent Database Backup
Assume that the database is open and you want to make a consistent backup of the whole database. This example shuts down the database consistently, mounts the database, makes a consistent whole database backup, and then opens the database.
SHUTDOWN IMMEDIATE; STARTUP MOUNT; BACKUP DATABASE PLUS ARCHIVELOG; # Now that the backup is complete, open the database. ALTER DATABASE OPEN;
Example 2-14 Mounting the Database After Restoring the Control File
This example restores the control file, mounts it, and performs recovery. Finally, the example resets the online redo logs.
STARTUP FORCE NOMOUNT; RESTORE CONTROLFILE FROM AUTOBACKUP; ALTER DATABASE MOUNT; # you must run the RECOVER command after restoring a control file even if no datafiles # require recovery RECOVER DEVICE TYPE DISK DATABASE; ALTER DATABASE OPEN RESETLOGS;