Tag Archives: Recovery

Basic RMAN Commands

Here is a list of some RMAN commands I frequently use:

1. To connect to RMAN without a repository:

rman target /

2. To crosscheck backups:

crosscheck backup;

3. To list expired backups:

list expired backup;

4. To delete expired backups:

delete expired backup;

5. To set a disk destination for backups:

CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   ‘E:backupDEV1%U’;

6. To include a maximum size of 2GB for backupset pieces:

CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 2G FORMAT ‘E:backupDEV1%U’;

7. To execute a backup to the default location:

backup database;

8. To restore and recover datafile 30:

run {

restore datafile 30;

recover datafile 30;

}

Database Media Recovery of 11i Instance

Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
C:Documents and Settingsoracle>f:
F:>cd oracleproddb9.2.0
F:oracleproddb9.2.0>PROD_hostname.cmd
ECHO is off.
ECHO is off.
Tue 05/19/2009 09:49 AM
PROD_hostname.cmd exiting with status 0
F:oracleproddb9.2.0>sqlplus apps/apps
SQL*Plus: Release 9.2.0.7.0 - Production on Tue May 19 09:49:27 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
ERROR:
ORA-01033: ORACLE initialization or shutdown in progress
Enter user-name: / as sysdba
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 831725752 bytes
Fixed Size 454840 bytes
Variable Size 411041792 bytes
Database Buffers 409600000 bytes
Redo Buffers 10629120 bytes
Database mounted.
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: 'E:ORACLEPRODDATASYSTEM01.DBF'
SQL> recover automatic database
Media recovery complete.
SQL> alter database open;
Database altered.
SQL> select * from v$database;
NAME
---------
PROD
SQL>