Oracle® Database Backup and Recovery Reference 10g Release 2 (10.2) Part Number B14194-02 |
|
|
View PDF |
Syntax
alterDatabase::=
Purpose
To mount or open a database.
Restrictions and Usage Notes
Execute this command either within the braces of a RUN command or at the RMAN prompt.
The target instance must be started.
Keywords and Parameters
Syntax Element | Description |
---|---|
MOUNT |
Mounts the database without opening it. This option is equivalent to the SQL statement ALTER DATABASE MOUNT . |
OPEN |
Opens the database. |
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 RESETLOGS option is equivalent to the SQL statement ALTER DATABASE OPEN RESETLOGS .
If you use a recovery catalog, then RMAN performs an implicit |
Examples
Opening the Database After a Backup: Example This example mounts the database, takes a whole database backup, then opens the database. At the RMAN prompt enter:
STARTUP MOUNT; BACKUP DATABASE; # now that the backup is complete, open the database. ALTER DATABASE OPEN;
Mounting the Database After Restoring the Control File: Example To restore the control file to its default location when connected to a recovery catalog, enter the following:
STARTUP NOMOUNT; RESTORE CONTROLFILE; ALTER DATABASE MOUNT; # you must run the RECOVER command after restoring a control file even if no datafiles # require recovery RECOVER DATABASE; ALTER DATABASE OPEN RESETLOGS;
Performing RESETLOGS After Incomplete Recovery: Example This example uses a manually allocated channel to perform incomplete recovery and then resets the online redo logs:
RUN { ALLOCATE CHANNEL ch1 DEVICE TYPE sbt; SET UNTIL SCN 1024; RESTORE DATABASE; RECOVER DATABASE; ALTER DATABASE OPEN RESETLOGS; }