Skip Headers

Oracle9i Recovery Manager Reference
Release 2 (9.2)

Part Number A96565-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

RMAN Commands , 7 of 59


ALTER DATABASE

Syntax

Text description of alterDatabase.gif follows
Text description of the illustration alterDatabase.gif


Purpose

To mount or open a database.

See Also:

Oracle9i 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

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;
} 

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback