Skip Headers

Oracle® Database Recovery Manager Reference
10g Release 1 (10.1)

Part Number B10770-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to current chapter
Up
Go to next page
Next
View PDF

ALTER DATABASE

Syntax

alterDatabase::=

Text description of alterDatabase.gif follows


Text description of alterDatabase

Purpose

To mount or open a database.

See Also:

Oracle Database SQL Reference for ALTER DATABASE syntax

Restrictions and Usage Notes

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 RESET DATABASE after the database is opened to make this new incarnation the current one in the catalog. If you execute the SQL statement ALTER DATABASE OPEN RESETLOGS (not the RMAN command of the same name), then you must manually run the RESET DATABASE command.

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;
# if the database uses locally-managed temporary tablespaces, then you must add tempfiles
# to these tablespaces after restoring a backup control file
SQL " ALTER TABLESPACE temp ADD TEMPFILE ''?/oradata/trgt/temp01.dbf'' REUSE";
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;
}