Posts

Showing posts with the label RMAN

incremental and cumulative backup using RMAN (Examples)

RMAN> backup incremental level 0 database plus archivelog; Starting backup at 05-APR-10 current log archived using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=120 device type=DISK channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=126 RECID=8 STAMP=715445352 input archived log thread=1 sequence=127 RECID=9 STAMP=715447009 input archived log thread=1 sequence=128 RECID=10 STAMP=715447264 input archived log thread=1 sequence=129 RECID=11 STAMP=715471263 input archived log thread=1 sequence=130 RECID=12 STAMP=715513719 channel ORA_DISK_1: starting piece 1 at 05-APR-10 channel ORA_DISK_1: finished piece 1 at 05-APR-10 piece handle=D:\11GSOFTWARE\FLASH_RECOVERY_AREA\SANDEEP\BACKUPSET\2010_04_05\O1_MF_ANNNN_TAG20100405T094842_5VM8ZD15_.BKP tag=TAG20100405T094842 comment=NONE channel ORA_DISK_1: backup set c...

RMAN-06004: ORACLE error from recovery catalog database: RMAN-20020: database incarnation not set

RMAN> backup current controlfile; Starting backup at 04-APR-10 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of backup command at 04/04/2010 22:08:50 RMAN-03014: implicit resync of recovery catalog failed RMAN-06004: ORACLE error from recovery catalog database: RMAN-20020: database incarnation not set RMAN> reset database; database incarnation already registered RMAN> reset database; database incarnation already registered RMAN> backup current controlfile; Starting backup at 04-APR-10 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=134 device type=DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set including current control file in backup set channel ORA_DISK_1: starting piece 1 at 04-APR-10 ...

list failure, advise failure by rman (Example)

This is really nice one. RMAN> shutdown immediate database closed database dismounted Oracle instance shut down I moved to system datafile to system01.dbf.bak. RMAN> startup connected to target database (not started) Oracle instance started database mounted RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of startup command at 04/04/2010 21:28:47 ORA-01157: cannot identify/lock data file 1 - see DBWR trace file ORA-01110: data file 1: 'D:\11GSOFTWARE\ORADATA\SANDEEP\SYSTEM01.DBF' RMAN> list failure 2> ; List of Database Failures ========================= Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- ------- 1882 CRITICAL OPEN 04-APR-10 System datafile 1: 'D:\11GSOFTWARE\ORADATA\SANDE...

Making Faster Backups of Large Files :Using backup section size

RMAN> run 2> { 3> allocate channel d1 device type disk; 4> allocate channel d2 device type disk; 5> allocate channel d3 device type disk; 6> backup section size 200m tablespace system; 7> } released channel: ORA_DISK_1 allocated channel: d1 channel d1: SID=170 device type=DISK allocated channel: d2 channel d2: SID=140 device type=DISK allocated channel: d3 channel d3: SID=130 device type=DISK Starting backup at 04-APR-10 channel d1: starting full datafile backup set channel d1: specifying datafile(s) in backup set input datafile file number=00001 name=D:\11GSOFTWARE\ORADATA\SANDEEP\SYSTEM01.DBF backing up blocks 1 through 25600 channel d1: starting piece 1 at 04-APR-10 channel d2: starting full datafile backup set channel d2: specifying datafile(s) in backup set input datafile file number=00001 name=D:\11GSOFTWARE\ORADATA\SANDEEP\SYSTEM01.DBF backing up blocks 25601 through 51200 channel d2: starting piece 2 at 04-APR-10 channel d3: sta...

compress and Parallelizing Backups

RMAN> run 2> { 3> allocate channel d1 device type disk; 4> allocate channel d2 device type disk; 5> allocate channel d3 device type disk; 6> backup as compressed backupset database; 7> } allocated channel: d1 channel d1: SID=130 device type=DISK allocated channel: d2 channel d2: SID=132 device type=DISK allocated channel: d3 channel d3: SID=134 device type=DISK Starting backup at 04-APR-10 channel d1: starting compressed full datafile backup set channel d1: specifying datafile(s) in backup set input datafile file number=00002 name=D:\11GSOFTWARE\ORADATA\SANDEEP\SYSAUX01.DBF channel d1: starting piece 1 at 04-APR-10 channel d2: starting compressed full datafile backup set channel d2: specifying datafile(s) in backup set input datafile file number=00001 name=D:\11GSOFTWARE\ORADATA\SANDEEP\SYSTEM01.DBF input datafile file number=00004 name=D:\11GSOFTWARE\ORADATA\SANDEEP\USERS01.DBF channel d2: starting piece 1 at 04-APR-10 channel d3: starti...

RMAN> backup as compressed backupset database plus archivelog;

Specify the "as compressed backupset" option with your backup command to direct RMAN to produce a binary compressed backup set, as shown in the following example: RMAN> backup as compressed backupset database plus archivelog; Starting backup at 04-APR-10 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting compressed archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=126 RECID=8 STAMP=715445352 input archived log thread=1 sequence=127 RECID=9 STAMP=715447009 channel ORA_DISK_1: starting piece 1 at 04-APR-10 channel ORA_DISK_1: finished piece 1 at 04-APR-10 piece handle=D:\11GSOFTWARE\FLASH_RECOVERY_AREA\SANDEEP\BACKUPSET\2010_04_04\O1_MF_ANNNN_TAG20100404T151649_5VK7TL8W_.BKP tag=TAG20100404T151649 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15 Finished backup at 04-APR-10 Starting backup at 04-APR-10 using channel ORA_DISK_1 cha...

Running Sql command from RMAN and example of tablespace restore and recovery;

you can’t issue a select statement from within RMAN. RMAN> sql 'alter system switch logfile'; sql statement: alter system switch logfile RMAN> run 2> { 3> sql "alter tablespace users offline immediate"; 4> restore tablespace users; 5> recover tablespace users; 6> sql "alter tablespace users online"; 7> } sql statement: alter tablespace users offline immediate Starting restore at 04-APR-10 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set channel ORA_DISK_1: restoring datafile 00004 to D:\11GSOFTWARE\ORADATA\SANDEEP\USERS01.DBF channel ORA_DISK_1: reading from backup piece D:\11GSOFTWARE\FLASH_RECOVERY_AREA\SANDEEP\BACKUPSET\2010_04_04\O1_MF_NNNDF_TAG20100404T142507_5VK4SOZ0_.BKP channel ORA_DISK_1: piece handle=D:\11GSOFTWARE\FLASH_RECOVERY_AREA\SANDEEP\BACKUPSET\2010_04_04\O1_MF_NNNDF_TAG20100404T142507_5V...

Backup database using Rman with default configuration on windows in FRA

RMAN> backup database; Starting backup at 04-APR-10 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00002 name=D:\11GSOFTWARE\ORADATA\SANDEEP\SYSAUX01.DBF input datafile file number=00001 name=D:\11GSOFTWARE\ORADATA\SANDEEP\SYSTEM01.DBF input datafile file number=00005 name=D:\11GSOFTWARE\ORADATA\SANDEEP\EXAMPLE01.DBF input datafile file number=00003 name=D:\11GSOFTWARE\ORADATA\SANDEEP\UNDOTBS01.DBF input datafile file number=00004 name=D:\11GSOFTWARE\ORADATA\SANDEEP\USERS01.DBF channel ORA_DISK_1: starting piece 1 at 04-APR-10 channel ORA_DISK_1: finished piece 1 at 04-APR-10 piece handle=D:\11GSOFTWARE\FLASH_RECOVERY_AREA\SANDEEP\BACKUPSET\2010_04_04\O1_MF_NNNDF_TAG20100404T142507_5VK4SOZ0_.BKP tag=TAG20100404T142507 comm channel ORA_DISK_1: backup set complete, elapsed time: 00:04:05 Finished backup at 04-APR-10 Starting Control File and SPFILE Autob...

Executing Operating System Commands from Within RMAN

s you can see in the two examples, you can use the host command with or without an operating system command as a parameter. If you run the host command as part of a series of RMAN commands, RMAN executes the host command and continues with the rest of the commands. When you execute the host command by itself, RMAN displays the operating system command prompt and resumes after you exit the command-line subshell. RMAN> host 'tnsping sandeep' 2> ; TNS Ping Utility for 32-bit Windows: Version 11.1.0.7.0 - Production on 04-APR-2010 14:43:06 Copyright (c) 1997, 2008, Oracle. All rights reserved. Used parameter files: D:\11gsoftware\product\11.1.0\db_1\network\admin\sqlnet.ora Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = Sandeep-PC)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = sandeep))) OK (30 msec) host command complete RMAN> RMAN> OR RMAN> host;...

Delete archive logs and backup

eleting acrhive logs RMAN> delete noprompt archivelog all; released channel: ORA_DISK_1 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=152 device type=DISK List of Archived Log Copies for database with db_unique_name SANDEEP ===================================================================== Key Thrd Seq S Low Time ------- ---- ------- - --------- 1 1 119 A 02-APR-10 Name: D:\11GSOFTWARE\FLASH_RECOVERY_AREA\SANDEEP\ARCHIVELOG\2010_04_02\O1_MF_1_119_5VD7V6Z6_.ARC 2 1 120 A 02-APR-10 Name: D:\11GSOFTWARE\FLASH_RECOVERY_AREA\SANDEEP\ARCHIVELOG\2010_04_02\O1_MF_1_120_5VDQ0YOR_.ARC 3 1 121 A 02-APR-10 Name: D:\11GSOFTWARE\FLASH_RECOVERY_AREA\SANDEEP\ARCHIVELOG\2010_04_02\O1_MF_1_121_5VDTLZOZ_.ARC 4 1 122 A 02-APR-10 Name: D:\11GSOFTWARE\FLASH_RECOVERY_AREA\SANDEEP\ARCHIVELOG\2010_04_03\O1_MF_1_122_5VF6FVQ6_.ARC 5 1 123 A 03-APR-10 Name: D:\11...

Use RMAN to restore and recover your database

Scenario 1: Rman : Sandeep Panchal: You’ve experienced a failure and want to use RMAN to restore and recover your database. You have a current and good backup in the default location, and all needed control files, archived redo log files, and online redo log files are available. How It Works If you have a good backup of your database, it’s fairly simple to use RMAN to restore and recover your database. RMAN uses information stored in the control file to determine where to retrieve backups and which files to restore and recover. C:\Users\Sandeep>rman target / Recovery Manager: Release 11.1.0.7.0 - Production on Sun Apr 4 13:40:15 2010 Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: SANDEEP (DBID=4225970695) RMAN> list backup 2> ; using target database control file instead of recovery catalog List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- ...