Backup Using RMAN

Figure: RMAN Channel allocation

SQL> archive log list;

Database log mode Archive Mode

Automatic archival Enabled

Archive destination USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence 17

Next log sequence to archive 19

Current log sequence 19

SQL> create table b(name varchar2(100));

Table created.

SQL> insert into b values('**** INSERT BEFORE BACKUP *****');

1 row created.

SQL> commit;

Commit complete.

H:\>set oracle_sid=dba20

H:\>rman

Recovery Manager: Release 10.2.0.1.0 - Production on Mon Jan 18 11:30:00 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

RMAN> connect target sys/sys

connected to target database: DBA20 (DBID=847839442)

RMAN> run{

2> allocate channel c1 type disk;

3> allocate channel c2 type disk;

4> allocate channel c3 type disk;

5> allocate channel c4 type disk;

6> backup database;

7> }

SQL> insert into b values('**** INSERT AFTER BACKUP *****');

1 row created.

SQL> commit;

Commit complete.

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

Delete USERS.DBF/SYSTEM.DBF

SQL> startup;

ORACLE instance started.

Total System Global Area 167772160 bytes

Fixed Size 1247876 bytes

Variable Size 71304572 bytes

Database Buffers 88080384 bytes

Redo Buffers 7139328 bytes

Database mounted.

ORA-01157: cannot identify/lock data file 1 - see DBWR trace file

ORA-01110: data file 1: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\DBA20\SYSTEM01.DBF'

RMAN> run

2> {

3> allocate channel c1 type disk;

4> allocate channel c2 type disk;

5> allocate channel c3 type disk;

6> restore database;

7> recover database;

8> }

SQL> alter database open;

Database altered.

SQL> select * from b;

NAME

-----------------------------------------

**** INSERT BEFORE BACKUP *****

**** INSERT AFTER BACKUP *****

Some Channel Command and Options: