Monday, June 2, 2008

RMAN

Download

resetting RMAN configure parameters to default:-

CONFIGURE RETENTION POLICY CLEAR;
CONFIGURE BACKUP OPTIMIZATION CLEAR;
CONFIGURE DEFAULT DEVICE TYPE CLEAR;
CONFIGURE CONTROLFILE AUTOBACKUP CLEAR;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT CLEAR;
CONFIGURE DEVICE TYPE DISK CLEAR;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK CLEAR;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT CLEAR;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK CLEAR;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT CLEAR;
CONFIGURE CHANNEL DEVICE TYPE DISK CLEAR;
CONFIGURE CHANNEL DEVICE TYPE SBT CLEAR;
CONFIGURE MAXSETSIZE CLEAR;
CONFIGURE SNAPSHOT CONTROLFILE NAME CLEAR;
__________________________________________________________________________________________________
Steps:-

RMAN

TARGET DATABASE (DB_NAME = tree, IP = 192.9.200.174)

SQL>startup;
ORACLE instance started.
Total System Global Area 97588504 bytes
Fixed Size 451864 bytes
Variable Size 46137344 bytes
Database Buffers 50331648 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.

SQL>sho parameter remote_login_passwordfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string EXCLUSIVE

[oracle9i@admin]$ Listener.ora
tar =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.9.200.174)(PORT = 8000))
)
SID_LIST_tar =
(SID_LIST =
(SID_DESC =
(SID_NAME = tree)
(GLOBAL_DBNAME = tree.com)
(ORACLE_HOME = /home/oracle9i/OraHome1)
)
)
:wq!

[oracle9i@admin]$ lsnrctl start tar
LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 27-MAY-2008 16:54:47
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Starting /home/oracle9i/OraHome1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 9.2.0.4.0 - Production
System parameter file is /home/oracle9i/OraHome1/network/admin/listener.ora
Log messages written to /home/oracle9i/OraHome1/network/log/tar.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.9.200.174)(PORT=8000)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.9.200.174)(PORT=8000)))
STATUS of the LISTENER
------------------------
Alias tar
Version TNSLSNR for Linux: Version 9.2.0.4.0 - Production
Start Date 27-MAY-2008 16:54:47
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /home/oracle9i/OraHome1/network/admin/listener.ora
Listener Log File /home/oracle9i/OraHome1/network/log/tar.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.9.200.174)(PORT=8000)))
Services Summary...
Service "tree.com" has 1 instance(s).
Instance "tree", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

RECOVERY CATALOG DATABASE (DB_NAME = mCreating control file:oon, IP = 192.9.200.175)

SQL>startup;
ORACLE instance started.
Total System Global Area 303109300 bytes
Fixed Size 451764 bytes
Variable Size 234881024 bytes
Database Buffers 67108864 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.

SQL>create tablespace rman_ts datafile '/home/vamsi/moon/data/rman1.dbf' size 50m;
Tablespace created.

SQL>create user rman identified by rman
default tablespace rman_ts
temporary tablespace temp1
quota unlimited on rman_ts
quota 0 on system;
User created.

SQL>grant connect,resource to rman;
Grant succeeded.

SQL>grant recovery_catalog_owner to rman;
Grant succeeded.

SQL>conn rman/rman
Connected.

SQL>select * from tab;
no rows selected

[vamsi@vamsi admin]$ Listener.ora
cat =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.9.200.175)(PORT = 9000))
)
SID_LIST_cat =
(SID_LIST =
(SID_DESC =
(SID_NAME = moon)
(GLOBAL_DBNAME = moon.com)
(ORACLE_HOME = /home/vamsi/OraHome1)
)
)

[vamsi@vamsi admin]$ lsnrctl start cat
LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 27-MAY-2008 16:53:14
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Starting /home/vamsi/OraHome1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 9.2.0.4.0 - Production
System parameter file is /home/vamsi/OraHome1/network/admin/listener.ora
Log messages written to /home/vamsi/OraHome1/network/log/cat.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.9.200.175)(PORT=9000)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.9.200.175)(PORT=9000)))

STATUS of the LISTENER

Alias cat
Version TNSLSNR for Linux: Version 9.2.0.4.0 - Production
Start Date 27-MAY-2008 16:53:14
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /home/vamsi/OraHome1/network/admin/listener.ora
Listener Log File /home/vamsi/OraHome1/network/log/cat.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.9.200.175)(PORT=9000)))
Services Summary...
Service "moon.com" has 1 instance(s).
Instance "moon", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

RMAN

[vamsi@vamsi admin]$ tnsmanes.ora
con_tar =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.9.200.174)(PORT = 8000))
)
(CONNECT_DATA =
(SERVICE_NAME = tree.com)
(SID_NAME=tree)
)
)

con_cat =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.9.200.175)(PORT = 9000))
)
(CONNECT_DATA =
(SERVICE_NAME = moon.com)
(SID_NAME=moon)
)
)
:wq!

[vamsi@vamsi admin]$ tnsping con_tar
TNS Ping Utility for Linux: Version 9.2.0.4.0 - Production on 27-MAY-2008 18:44:10
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
/home/vamsi/OraHome1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.9.200.174)(PORT = 8000))) (CONNECT_DATA = (SERVICE_NAME = tree.com) (SID_NAME=tree)))
OK (10 msec)

[vamsi@vamsi admin]$ tnsping con_cat
TNS Ping Utility for Linux: Version 9.2.0.4.0 - Production on 27-MAY-2008 18:44:24
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
/home/vamsi/OraHome1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.9.200.175)(PORT = 9000))) (CONNECT_DATA = (SERVICE_NAME = moon.com) (SID_NAME=moon)))
OK (0 msec)

[vamsi@vamsi admin]$ rman
Recovery Manager: Release 9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

RMAN> connect target sys/sys@ con_tar
connected to target database: TREE (DBID=3948310515)

RMAN> connect catalog rman/rman@ con_cat
connected to recovery catalog database
Recovery catalog not installed

RMAN> create catalog;
recovery catalog created

RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

RMAN> report schema;
Report of database schema
File K-bytes Tablespace RB segs Datafile Name
---- ---------- -------------------- ------- -------------------
1 307200 SYSTEM YES /home/oracle9i/tree/data/sys.dba
2 20480 TREE1 NO /home/oracle9i/tree/data/t1.dbf
3 20480 TREE2 NO /home/oracle9i/tree/data/t2.dbf
4 51200 UNDO1 YES /home/oracle9i/tree/data/undo01.dbf
5 20480 TREE3 NO /home/oracle9i/tree/data/t3.dbf

RMAN> show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
RMAN configuration has no stored or default parameters
RMAN configuration has no stored or default parameters
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/vamsi/OraHome1/dbs/snapcf_tree.f'; # default

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> configure channel device type disk format '/home/vamsi/rman/tree_%T_%U';
old RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/home/vamsi/rman/%U';
new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/home/vamsi/rman/tree_%T_%U';
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/vamsi/rman/snapcf_tree.f';
snapshot controlfile name set to: /home/vamsi/rman/snapcf_tree.f
new RMAN configuration parameters are successfully stored

RMAN> show all;
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT ' /home/vamsi/rman/tree_%T_%U ';
RMAN configuration has no stored or default parameters
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO ' /home/vamsi/rman/snapcf_tree.f ';

RMAN> backup database;
Starting backup at 27-MAY-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=12 devtype=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: sid=13 devtype=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: sid=14 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00004 name=/home/oracle9i/tree/data/undo01.dbf
input datafile fno=00002 name=/home/oracle9i/tree/data/t1.dbf
channel ORA_DISK_1: starting piece 1 at 27-MAY-08
channel ORA_DISK_2: starting full datafile backupset
channel ORA_DISK_2: specifying datafile(s) in backupset
input datafile fno=00001 name=/home/oracle9i/tree/data/sys.dba
input datafile fno=00003 name=/home/oracle9i/tree/data/t2.dbf
channel ORA_DISK_2: starting piece 1 at 27-MAY-08
channel ORA_DISK_1: finished piece 1 at 27-MAY-08
piece handle=/home/vamsi/rman/tree_20080527_01jhej5p_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_2: finished piece 1 at 27-MAY-08
piece handle=/home/vamsi/rman/tree_20080527_02jhej5p_1_1 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:22
Finished backup at 27-MAY-08

Starting Control File and SPFILE Autobackup at 27-MAY-08
piece handle=/home/vamsi/OraHome1/dbs/c-3948310515-20080527-00 comment=NONE
Finished Control File and SPFILE Autobackup at 27-MAY-08

RMAN> backup datafile 1;
Starting backup at 27-MAY-08
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/home/oracle9i/tree/data/sys.dba
channel ORA_DISK_1: starting piece 1 at 27-MAY-08
channel ORA_DISK_1: finished piece 1 at 27-MAY-08
piece handle=/home/vamsi/rman/tree_20080527_04jhejea_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 27-MAY-08
Starting Control File and SPFILE Autobackup at 27-MAY-08
piece handle=/home/vamsi/OraHome1/dbs/c-3948310515-20080527-01 comment=NONE
Finished Control File and SPFILE Autobackup at 27-MAY-08

RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
23 Full 364K DISK 00:00:05 27-MAY-08
BP Key: 25 Status: AVAILABLE Tag: TAG20080527T181426
Piece Name: /home/vamsi/rman/tree_20080527_01jhej5p_1_1
List of Datafiles in backup set 23
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
2 Full 66571 27-MAY-08 /home/oracle9i/tree/data/t1.dbf
4 Full 66571 27-MAY-08 /home/oracle9i/tree/data/undo01.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
24 Full 90M DISK 00:00:15 27-MAY-08
BP Key: 26 Status: AVAILABLE Tag: TAG20080527T181426
Piece Name: /home/vamsi/rman/tree_20080527_02jhej5p_1_1
List of Datafiles in backup set 24
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 66572 27-MAY-08 /home/oracle9i/tree/data/sys.dba
3 Full 66572 27-MAY-08 /home/oracle9i/tree/data/t2.dbf

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
32 Full 808K DISK 00:00:00 27-MAY-08
BP Key: 33 Status: AVAILABLE Tag:
Piece Name: /home/vamsi/OraHome1/dbs/c-3948310515-20080527-00
SPFILE Included: Modification time: 27-MAY-08

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
37 Full 90M DISK 00:00:08 27-MAY-08
BP Key: 38 Status: AVAILABLE Tag: TAG20080527T181859
Piece Name: /home/vamsi/rman/tree_20080527_04jhejea_1_1
List of Datafiles in backup set 37
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 66665 27-MAY-08 /home/oracle9i/tree/data/sys.dba

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
41 Full 808K DISK 00:00:00 27-MAY-08
BP Key: 42 Status: AVAILABLE Tag:
Piece Name: /home/vamsi/OraHome1/dbs/c-3948310515-20080527-01
SPFILE Included: Modification time: 27-MAY-08




Differential incremental Backup
form:- n=n (or) n=n-1











cumulative incremental Backup
form:- n=n-1