http://skrajend.blogspot.in/2007/06/asm-rman-backup-configuration.

html ASM Initialization Parameters Initialization Parameter Description Defines the instance as an ASM instance. This is the onlyrequired parameter to identify an ASM instance; the remainder can be left at their defaults Defines the service provider name for which this ASM instance manages disk groups. +ASM is the default value, and should not be modified unless multiple ASM instances are on the same node Controls rebalance operation speed. Values range from 1 to 11, with 11 being the fastest. If omitted, this value defaults to 1. The number of slaves is derived from the parallelization level specified in a manual rebalance command (POWER), or by the ASM_POWER_LIMIT parameter An operating system dependent value; used by ASM to limit the set of disks considered for discovery Describes the list of ASM disk group names to be mounted by an ASM instance at startup, or whenever the ALTER DISKGROUP ALL MOUNT command is used The LARGE POOL size. This must be set to a minimum of 8MB, but Oracle recommends setting this to 16MB

INSTANCE_TYPE

DB_UNIQUE_NAME

ASM_POWER_LIMIT

ASM_DISKSTRING

ASM_DISK_GROUPS

LARGE_POOL_SIZE

ASM Adding a New DiskGroup **The below Steps for creating Disk are Not Standard** **They are Faking Hardware Steps** [root@lab01 oracle]# cd /asmdisks/ [root@lab01 asmdisks]# dd if=/dev/zero of=/asmdisks/disk6 bs=1024k count=1000 1000+0 records in 1000+0 records out [root@lab01 asmdisks]# dd if=/dev/zero of=/asmdisks/disk7 bs=1024k count=1000 1000+0 records in 1000+0 records out [root@lab01 asmdisks]# /sbin/losetup /dev/loop6 /asmdisks/disk6 [root@lab01 asmdisks]# /sbin/losetup /dev/loop7 /asmdisks/disk7 [root@lab01 asmdisks]# /etc/init.d/oracleasm createdisk ASMD6 /dev/loop6 Marking disk "/dev/loop6" as an ASM disk: [ OK ] [root@lab01 asmdisks]# /etc/init.d/oracleasm createdisk ASMD7 /dev/loop7 Marking disk "/dev/loop7" as an ASM disk: [ OK ] [root@lab01 asmdisks]# **The above Steps for creating Disk are Not Standard** **They are Faking Hardware Steps** SQL> select group_number,disk_number,name,state,mode_status,mount_status,total_mb,free_mb from v$asm_disk;

1

G# D# NAME STATE MODE_ST MOUNT_S TOTAL_MB FREE_MB -. 2 3 Diskgroup created. SQL> SQL> CREATE DISKGROUP DG1 NORMAL REDUNDANCY FAILGROUP failure_group_1 DISK 'ORCL:ASMD6' FAILGROUP failure_group_2 DISK 'ORCL:ASMD7'. SQL> ASM Alert Log File SQL> CREATE DISKGROUP DG1 NORMAL REDUNDANCY FAILGROUP failure_group_1 DISK 'ORCL:ASMD6' FAILGROUP failure_group_2 DISK 'ORCL:ASMD7' Sat Mar 17 21:46:42 2007 NOTE: initializing header on grp 2 disk ASMD6 NOTE: initializing header on grp 2 disk ASMD7 Sat Mar 17 21:46:42 2007 NOTE: PST update: grp = 2 Sat Mar 17 21:46:42 2007 NOTE: group DG1: initial PST locations: disk 0000 (PST copy 0) NOTE: group DG1: initial PST locations: disk 0001 (PST copy 1) Sat Mar 17 21:46:42 2007 NOTE: cache registered group DG1 number=2 incarn=0x54a10c2f NOTE: cache opening disk 0 of grp 2: ASMD6 label:ASMD6 NOTE: cache opening disk 1 of grp 2: ASMD7 label:ASMD7 NOTE: cache creating group 2/0x54A10C2F (DG1) NOTE: cache mounting group 2/0x54A10C2F (DG1) succeeded NOTE: allocating F1X0 on grp 2 disk ASMD6 NOTE: allocating F1X0 on grp 2 disk ASMD7 NOTE: diskgroup must now be re-mounted prior to first use NOTE: cache dismounting group 2/0x54A10C2F (DG1) Sat Mar 17 21:46:53 2007 SUCCESS: diskgroup DG1 was created NOTE: cache registered group DG1 number=2 incarn=0xaf310c31 Sat Mar 17 21:46:53 2007 NOTE: Hbeat: instance first (grp 2) Sat Mar 17 21:46:57 2007 NOTE: start heartbeating (grp 2) NOTE: cache opening disk 0 of grp 2: ASMD6 label:ASMD6 Sat Mar 17 21:46:57 2007 NOTE: F1X0 found on disk 0 fcn 0.------.------.---------.---------0 0 NORMAL ONLINE CLOSED 1000 0 0 1 NORMAL ONLINE CLOSED 1000 0 1 0 ASMD1 NORMAL ONLINE CACHED 1000 516 1 1 ASMD2 NORMAL ONLINE CACHED 1000 509 1 2 ASMD3 NORMAL ONLINE CACHED 1000 509 1 3 ASMD4 NORMAL ONLINE CACHED 1000 514 1 4 ASMD5 NORMAL ONLINE CACHED 1000 516 7 rows selected.-.----.0 NOTE: cache mounting (first) group 2/0xAF310C31 (DG1) 2 .-------.0 NOTE: cache opening disk 1 of grp 2: ASMD7 label:ASMD7 NOTE: F1X0 found on disk 1 fcn 0.

mode_status.------.-------.-.---------------.total_mb.state.state.mode_status. NAME REDUNDA FAILGROUP PATH ----.NOTE: cache recovered group 2 to fcn 0.---------.------.0 ABA NOTE: seq=2 blk=0 Sat Mar 17 21:46:57 2007 NOTE: cache mounting group 2/0xAF310C31 (DG1) succeeded SUCCESS: diskgroup DG1 was mounted Sat Mar 17 21:46:59 2007 NOTE: recovering COD for group 2/0xaf310c31 (DG1) SUCCESS: completed COD recovery for group 2/0xaf310c31 (DG1) SQL> select group_number.---------1 0 ASMD1 NORMAL ONLINE CACHED 1000 516 1 1 ASMD2 NORMAL ONLINE CACHED 1000 509 1 2 ASMD3 NORMAL ONLINE CACHED 1000 509 1 3 ASMD4 NORMAL ONLINE CACHED 1000 514 1 4 ASMD5 NORMAL ONLINE CACHED 1000 516 2 0 ASMD6 NORMAL ONLINE CACHED 1000 949 2 1 ASMD7 NORMAL ONLINE CACHED 1000 949 7 rows selected. G# D# NAME STATE MODE_ST MOUNT_S TOTAL_MB FREE_MB -.mount_status.failgroup.-------------------ASMD6 UNKNOWN FAILURE_GROUP_1 ORCL:ASMD6 ASMD7 UNKNOWN FAILURE_GROUP_2 ORCL:ASMD7 SQL> SQL> CREATE TABLESPACE T1 DATAFILE '+DG1'.0 Sat Mar 17 21:46:57 2007 NOTE: opening chunk 1 at fcn 0.path from v$asm_disk where group_number=2. SQL> SQL> select name.free_mb from v$asm_disk.name. SQL> AlertLog Content Sat Mar 17 21:53:25 2007 CREATE TABLESPACE T1 DATAFILE '+DG1' Sat Mar 17 21:53:29 2007 SUCCESS: diskgroup DG1 was mounted Sat Mar 17 21:53:48 2007 SUCCESS: diskgroup DG1 was dismounted Sat Mar 17 21:53:48 2007 SUCCESS: diskgroup DG1 was mounted SUCCESS: diskgroup DG1 was dismounted SUCCESS: diskgroup DG1 was mounted Sat Mar 17 21:53:49 2007 Completed: CREATE TABLESPACE T1 DATAFILE '+DG1' SQL> select group_number.----.redundancy.free_mb from v$asm_disk where group_number=2.mount_status.disk_number.total_mb.------.name.disk_number. Tablespace created. 3 .

db_name. 10:00:44 PM .G# D# NAME STATE MODE_ST MOUNT_S TOTAL_MB FREE_MB -.failgroup.------1 0 ASMD1 NORMAL ONLINE CACHED 1000 516 1 1 ASMD2 NORMAL ONLINE CACHED 1000 509 1 2 ASMD3 NORMAL ONLINE CACHED 1000 509 1 3 ASMD4 NORMAL ONLINE CACHED 1000 514 1 4 ASMD5 NORMAL ONLINE CACHED 1000 516 Query to find the Redundancy and FailGroup for Disks SQL> select name. SQL> # .-------.Posted by Senthil Rajendran .---------2 0 ASMD6 NORMAL ONLINE CACHED 1000 846 2 1 ASMD7 NORMAL ONLINE CACHED 1000 846 SQL> SQL> select name from v$datafile where ts# in ( select ts# from v$tablespace where name='T1').status from v$asm_client. INSTANCE DB_NAME STATUS -------.------.Comment [0] V$ASM and useful Queries Query to find the Database that uses the disk group managed by the ASM Instance. G# D# NAME STATE MODE_ST MOUNT_S TOTAL_MB FREE_MB -.redundancy.-----------ODB ODB CONNECTED SQL> Query to find the Disk that are discovered by the ASM Instance SQL> select group_number.mode_status. Table created.256.----.state.-------.disk_number.3/17/07.---------.617493211 SQL> SQL> create user u1 identified by u1 default tablespace t1.-.mount_status.-------.---------ASMD1 UNKNOWN ASMD1 ORCL:ASMD1 ASMD2 UNKNOWN ASMD2 ORCL:ASMD2 ASMD3 UNKNOWN ASMD3 ORCL:ASMD3 ASMD4 UNKNOWN ASMD4 ORCL:ASMD4 ASMD5 UNKNOWN ASMD5 ORCL:ASMD5 SQL> 4 .free_mb from v$asm_disk.----.path from v$asm_disk. SQL> select instance_name. SQL> grant connect.------.------. SQL> connect u1/u1 SQL> create table tt1 as select * from user_objects.---------. NAME REDUNDA FAILGROUP PATH ----.name.-------. NAME -------------------------------------------------------------------------------+DG1/odb/datafile/t1.------.total_mb.resource to u1.------.-.

type.---------.-----.state.total_mb.----. SQL> create tablespace test1 datafile '/home2/oracle/ora10g/datafile/test1a.--------. 5 .1 DATA MOUNTED NORMAL 5000 2564 782 N SQL> Query to view the ASM File Details SQL> select group_number. Tablespace created. GROUP_# FILE# BYTES SPACE TYPE REDUND STRIPE -----.dbf' size 20m autoextend on next 10m maxsize 100m.type.bytes.-----.-------.-----1 256 503324672 1011875840 DATAFILE MIRROR COARSE 1 257 241180672 487587840 DATAFILE MIRROR COARSE 1 258 26222592 54525952 DATAFILE MIRROR COARSE 1 259 5251072 12582912 DATAFILE MIRROR COARSE 1 260 7061504 25165824 CONTROLFILE HIGH FINE 1 261 7061504 25165824 CONTROLFILE HIGH FINE 1 262 52429312 120586240 ONLINELOG MIRROR FINE 1 263 52429312 120586240 ONLINELOG MIRROR FINE 1 264 52429312 120586240 ONLINELOG MIRROR FINE 1 265 52429312 120586240 ONLINELOG MIRROR FINE 1 266 52429312 120586240 ONLINELOG MIRROR FINE 1 267 52429312 120586240 ONLINELOG MIRROR FINE 1 268 20979712 44040192 TEMPFILE MIRROR COARSE 1 269 2560 2097152 PARAMETERFIL MIRROR COARSE 14 rows selected.unbalanced from v$asm_diskgroup.Query to view the Disk Group and its details SQL> select group_number. NAME -------------------------------------------------------------------------------/home2/oracle/ora10g/datafile/test1a.file_number.redundancy.----.usable_file_mb. SQL> ASM: Migrating Non-ASM Tablespace to ASM Tablespace Introduction: Here we will see how to migrate a Non-ASM Tablespace to ASM Tablespace. G# NAME STATE TYPE TOTAL_MB FREE_MB USABLE_FILE_MB U -. '/home2/oracle/ora10g/datafile/test1b. SQL> select name from v$datafile where ts# in 2 (select ts# from v$tablespace where name='TEST1').-------.striped from v$asm_file.dbf /home2/oracle/ora10g/datafile/test1b.-------------.dbf SQL> SQL> create user test1 identified by test1 default tablespace test1.space.-------.name.-------------.free_mb.dbf' size 20m autoextend on next 10m maxsize 100m extent management local.

Table created.617411381 +DG1/odb/datafile/t1.262.257.258. SQL> create table t1 as select * from all_tables.05b$ rman nocatalog target / RMAN> sql "alter tablespace test1 offline".617493211 /home2/oracle/ora10g/datafile/test1a.256.259. elapsed time: 00:00:07 channel ORA_DISK_1: starting datafile copy input datafile fno=00007 name=/home2/oracle/ora10g/datafile/test1b.dbf output filename=+DG1/odb/datafile/test1. SQL> -bash-2.617749583 tag=TAG20070320T210622 recid=1 stamp=617749585 channel ORA_DISK_1: datafile copy complete.617749589 tag=TAG20070320T210622 recid=2 stamp=617749592 channel ORA_DISK_1: datafile copy complete.617411379 +DATA/odb/datafile/sysaux. TNAME TABTYPE CLUSTERID -----------------------------. SQL> connect test1/test1 Connected. SQL> select * from tab.dbf /home2/oracle/ora10g/datafile/test1b. elapsed time: 00:00:07 Finished backup at 20-MAR-07 6 .261.---------T1 TABLE SQL> SQL> select name from v$datafile. sql statement: alter tablespace test1 offline RMAN> backup as copy tablespace test1 format '+DG1'. SQL> grant connect.256.resource to test1.617411377 +DATA/odb/datafile/users.617411373 +DATA/odb/datafile/undotbs1.------.dbf 7 rows selected. Grant succeeded. Starting backup at 20-MAR-07 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=148 devtype=DISK channel ORA_DISK_1: starting datafile copy input datafile fno=00006 name=/home2/oracle/ora10g/datafile/test1a.User created. NAME -------------------------------------------------------------------------------+DATA/odb/datafile/system.dbf output filename=+DG1/odb/datafile/test1.

617749589" RMAN> sql "alter tablespace test1 online". Start the ASM Enabled Database 3. Oracle.2.1.259. 2005.0 . COUNT(*) ---------91 SQL> ASM Instance Operational Procedure Operational Procedure for ASM Instance Startup Sequence 1.261. All rights reserved.256. -bash-2. NAME -------------------------------------------------------------------------------+DATA/odb/datafile/system.617749583 +DG1/odb/datafile/test1.05b$ sqlplus "/ as sysdba" SQL*Plus: Release 10.617411381 +DG1/odb/datafile/t1. SQL> select count(*) from t1.258.617749583" datafile 7 switched to datafile copy "+DG1/odb/datafile/test1. SQL> startup ASM instance started Total System Global Area 83886080 bytes Fixed Size 1217836 bytes 7 . datafile 6 switched to datafile copy "+DG1/odb/datafile/test1. Start the Listener for ASM Enabled Database Source the Environment Variable ORACLE_HOME Export ORACLE_SID=+ASM Login as sys dba and issue STARTUP Command $ sqlplus "/ as sysdba" SQL*Plus: Release 10. Start the ASM Instance 2.617411379 +DATA/odb/datafile/sysaux.Production on Tue Mar 20 21:07:32 2007 SQL> select name from v$datafile.261.617749589 7 rows selected.0.256. sql statement: alter tablespace test1 online RMAN> exit Recovery Manager complete.617493211 +DG1/odb/datafile/test1.RMAN> switch tablespace test1 to copy.2.Production on Sat Mar 17 19:41:49 2007 Copyright (c) 1982.0 .1.262.262. SQL> connect test1/test1 Connected.257.0.617411377 +DATA/odb/datafile/users.617411373 +DATA/odb/datafile/undotbs1. Connected to an idle instance.

Variable Size 57502420 bytes ASM Cache 25165824 bytes ASM diskgroups mounted SQL> Background Process: $ ps -ef | grep -i asm ora10g 4682 1 0 19:42 ? 00:00:00 asm_pmon_+ASM ora10g 4684 1 0 19:42 ? 00:00:00 asm_psp0_+ASM ora10g 4686 1 0 19:42 ? 00:00:00 asm_mman_+ASM ora10g 4688 1 0 19:42 ? 00:00:00 asm_dbw0_+ASM ora10g 4690 1 0 19:42 ? 00:00:00 asm_lgwr_+ASM ora10g 4692 1 0 19:42 ? 00:00:00 asm_ckpt_+ASM ora10g 4694 1 0 19:42 ? 00:00:00 asm_smon_+ASM ora10g 4696 1 0 19:42 ? 00:00:00 asm_rbal_+ASM ora10g 4698 1 0 19:42 ? 00:00:00 asm_gmon_+ASM ora10g 4703 4651 0 19:50 pts/0 00:00:00 grep -i asm $ Additional Processes: RBAL .2. Oracle.Starts the ASM instance without mounting any disk groups.0 .Performs a SHUTDOWN ABORT before restarting the ASM instance.Starts the ASM instance and mounts the disk groups specified by the ASM_DISKGROUPS parameter.0. its duty is to rebalance the activity for ASM Disk Groups Starting the ASM Dependent Database Export ORACLE_SID=ODB Login as sys dba and issue STARTUP Command $ export ORACLE_SID=ODB $ sqlplus "/ as sysdba" SQL*Plus: Release 10. Total System Global Area 167772160 bytes Fixed Size 1218316 bytes Variable Size 71305460 bytes Database Buffers 92274688 bytes Redo Buffers 2973696 bytes Database mounted. 8 .ReBalancer . Connected to an idle instance. NOMOUNT . Stop the ASM Enabled Database 3. 2005.1. MOUNT .Production on Sat Mar 17 19:59:23 2007 Copyright (c) 1982. Stop the Listener 2. The options for the STARTUP command are: FORCE . SQL> Starting the Listener of the ASM Dependent Database $ lsnrctl start ODB Shutdown Operation is the reverse of the Startup 1. Stop the ASM Instance Summary Startup and Shutdown of ASM Instances ASM instance are started and stopped in a similar way to normal database instances. SQL> startup ORACLE instance started. Database opened. All rights reserved.

OPEN . RMAN retains all archived logs and incremental backups that are needed to recover the nonobsolete backups. The autobackup enables RMAN to recover the database even if the current control file. catalog.This is not a valid option for an ASM instance. It doesn't wait for sessions to exit. Setting Up a Database for RMAN Setting Up Recovery Area for RMAN Setting Up a Database for RMAN Configuring the Backup Retention Policy Retention Policy is of two options: Window-Based Retention Policy Redundancy-Based Retention Policy Configuring a Recovery Window-Based Retention Policy: The recovery window parameters specifies the number of days between the current time and the earliest point of recoverability. Instead RMAN marks them as OBSOLUTE in the REPORT OBSOLUTE output. The above can recover the database to any point withing the last week. RMAN does not automatically delete backups rendered obsolute by the recovery window. ABORT . The options for the SHUTDOWN command are: NORMAL . RMAN retains all archived logs and incremental backups that are needed to recover the nonobsolete backups. IMMEDIATE . The above will set RMAN to have only 2 backups of the datafile or controlfile. CONFIGURE RETENTION POLICY TO REDUNDANCY 2. RMAN keeps a track of which ones to retain and which are obsoluted. If a backup is taken after that then the older one will be obsoluted. and server parameter file are lost. The following are the steps involved. 9 .The ASM instance waits for all connected ASM instances and SQL sessions to exit then shuts down. if the number of backups for a specific datafile or control file exceeds the Redundancy Setting.The ASM instance shuts down instantly. Enabling : CONFIGURE CONTROLFILE AUTOBACKUP ON. Configuring a Redundancy-Based Retention Policy: The redundancy parameter specified the number of backups that has to be maintained for the Datafile & Controlfile by RMAN. TRANSACTIONAL .The ASM instance waits for any SQL transactions to complete then shuts down.Same as IMMEDIATE. Configuring Control File and Server Parameter File Autobackup RMAN can be configured to automatically back up the control file and server parameter file whenever the database structure metadata in the control file changes and whenever a backup record is added. CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS. ASM : RMAN Backup Configuration Introduction : The following will guide one to take a backup of ASM Enabled Database using RMAN. RMAN will mark the backups to be obsoluted .

or maximum space to use for flash recovery area files for this database DB_RECOVERY_FILE_DEST .Disabling: CONFIGURE CONTROLFILE AUTOBACKUP OFF. we need to specify a location. Planning the Size of the Flash Recovery Area: The size should be large enough to hold the following. as used by your chosen backup strategy Online redo logs Archived redo logs not yet backed up to tape Control files Control file autobackups (which include copies of the control file and SPFILE) Setting Initialization Parameters for the Flash Recovery Area Two key initialization Parameters are involved in setting up the flash recovery area.which specifies the location of the flash recovery area 10 . Once you are done with the RMAN Configuration now we have to Setup the Flash Recovery Area. Permanent are the control files and online redolog files . Files That Can Be Stored in the Flash Recovery Area: Files are classified as permanent and transient. Optimizing the RMAN Backup: Backup file optimization can be used to prevent repeat backups of read-only tablespaces and archive logs: Read-only and offline-clean data files are only backed up once per recovery window. A copy of all datafiles Incremental backups. The following command will configure RMAN the autobackup to write to an ASM DiskGroup ASM Instance : (To create the disk group ) CREATE DISKGROUP CONTROL NORMAL REDUNDANCY FAILGROUP failure_group_1 DISK 'ORCL:ASMD6' FAILGROUP failure_group_2 DISK 'ORCL:ASMD7'. RMAN : CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '+CONTROL'. The command BACKUP BACKUPSET ALL copies to tape all backup sets that do not already exist on tape. Setting Up Recovery Area for RMAN The flash recovery area feature lets you set up a location on disk where the database can create and manage a variety of backup and recovery-related files. The Location can be a Directory or ASM Disk Group to hold the files. Choosing a Location for the Flash Recovery Area: When setting up a flash recovery area . Backup optimization is configured using: CONFIGURE BACKUP OPTIMIZATION [ON | OFF | CLEAR]. DB_RECOVERY_FILE_DEST_SIZE . and deleting them when they are no longer needed to restore your database and space is needed for some other backup and recovery-related purpose. retaining them as long as they are needed for restore and recovery activities. Using a flash recovery area simplifies the ongoing administration of your database by automatically naming files. all the other rest of the files are transient as RMAN will delete the files when they become obsoulte based on the retentition policy defined. The command BACKUP ARCHIVELOG ALL only backs up logs that are not already on tape.which specifies the disk quota.

'ORCL:ASMD10'. SQL> Connect to RMAN and configure the Settings RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 2. new RMAN configuration parameters are successfully stored RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON.'ORCL:ASMD10'.'ORCL:ASMD9'. new RMAN configuration parameters are successfully stored 11 . new RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP ON.In our case we are going to use a Disk Group for the Destination which is of 2GB. ASM Instance: CREATE DISKGROUP ARCH EXTERNAL REDUNDANCY DISK 'ORCL:ASMD8'.'ORCL:ASMD11'. new RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '+CONTROL'.'ORCL:ASMD9'. new RMAN configuration parameters are successfully stored RMAN> RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '+CONTROL'. ASM Enabled Instance: SQL> show parameter db_recovery_file_dest NAME TYPE VALUE -----------------------------------. Diskgroup created.--db_recovery_file_dest string +ARCH db_recovery_file_dest_size big integer 2G SQL> LAB: Connect to the ASM Instance and Create the DiskGroup for the Control File Autobackup SQL> CREATE DISKGROUP CONTROL NORMAL REDUNDANCY FAILGROUP failure_group_1 DISK 'ORCL:ASMD6' FAILGROUP failure_group_2 DISK 'ORCL:ASMD7'. SQL> SQL> CREATE DISKGROUP ARCH EXTERNAL REDUNDANCY DISK 'ORCL:ASMD8'. new RMAN configuration parameters: CONFIGURE RETENTION POLICY TO REDUNDANCY 2. Diskgroup created.'ORCL:ASMD11'.

617411381 channel ORA_DISK_1: starting piece 1 at 30-MAR-07 channel ORA_DISK_1: finished piece 1 at 30-MAR-07 piece handle=+ARCH/odb/backupset/2007_03_30/nnndf0_tag20070330t092148_0.256.258. new RMAN configuration parameters are successfully stored RMAN> RMAN> BACKUP DATABASE PLUS ARCHIVELOG.259.257. new RMAN configuration parameters: CONFIGURE BACKUP OPTIMIZATION ON.617411373 input datafile fno=00003 name=+DATA/odb/datafile/sysaux. Starting backup at 30-MAR-07 current log archived allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=151 devtype=DISK channel ORA_DISK_1: starting archive log backupset channel ORA_DISK_1: specifying archive log(s) in backup set input archive log thread=1 sequence=6 recid=1 stamp=617555015 input archive log thread=1 sequence=7 recid=2 stamp=617743035 input archive log thread=1 sequence=8 recid=3 stamp=617744460 input archive log thread=1 sequence=9 recid=4 stamp=617747694 input archive log thread=1 sequence=10 recid=5 stamp=618009531 input archive log thread=1 sequence=11 recid=6 stamp=618356756 input archive log thread=1 sequence=12 recid=7 stamp=618357083 input archive log thread=1 sequence=13 recid=8 stamp=618360354 input archive log thread=1 sequence=14 recid=9 stamp=618360687 input archive log thread=1 sequence=15 recid=10 stamp=618567572 input archive log thread=1 sequence=16 recid=11 stamp=618571214 channel ORA_DISK_1: starting piece 1 at 30-MAR-07 channel ORA_DISK_1: finished piece 1 at 30-MAR-07 piece handle=+ARCH/odb/backupset/2007_03_30/annnf0_tag20070330t092016_0.287. elapsed time: 00:01:29 Finished backup at 30-MAR-07 Starting backup at 30-MAR-07 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00001 name=+DATA/odb/datafile/system.618571311 tag=TAG20070330T092148 comment=NONE channel ORA_DISK_1: backup set complete.RMAN> RMAN> CONFIGURE BACKUP OPTIMIZATION ON.617411379 input datafile fno=00004 name=+DATA/odb/datafile/users.618571219 tag=TAG20070330T092016 comment=NONE channel ORA_DISK_1: backup set complete. elapsed time: 00:03:50 Finished backup at 30-MAR-07 Starting backup at 30-MAR-07 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting archive log backupset channel ORA_DISK_1: specifying archive log(s) in backup set input archive log thread=1 sequence=17 recid=12 stamp=618571546 12 .617411377 input datafile fno=00002 name=+DATA/odb/datafile/undotbs1.286.

elapsed time: 00:00:03 Finished backup at 30-MAR-07 Starting Control File and SPFILE Autobackup at 30-MAR-07 piece handle=+CONTROL/odb/autobackup/2007_03_30/s_618571551.1 root root 1231 Aug 11 2005 README -rw-r--r-.1.0.0.2.283.1.zip [root@in asm_command]# unzip asmcmd_10.2.0.256.618571557 comment=NONE Finished Control File and SPFILE Autobackup at 30-MAR-07 RMAN> ASM : Command Line Utility Introduction : Here we will see how to Instance ASM Command Line Utility and its features Pre-Requisite : Download a Copy of ASM Command Line Utility for ASM Release 10.zip inflating: README inflating: asmcmd inflating: asmcmd.618571549 tag=TAG20070330T092547 comment=NONE channel ORA_DISK_1: backup set complete.0.1.0.bat -rw-r--r-. Command to List all the Files and Directories ASMCMD> ls ARCH/ CONTROL/ DATA/ ASMCMD> ASMCMD> ls -l State Type Rebal Unbal Name 13 .1 root root 48359 Mar 31 09:33 asmcmd_10.1 root root 3099 Aug 11 2005 asmcmd -r--r----.2.1 root root 214856 Aug 11 2005 asmcmdcore -r-xr-x--.1 Installation Steps: [root@in asm_command]# ls -lrt total 48 -rw-r--r-.bat inflating: asmcmdcore [root@in asm_command]# ls -lrt total 276 -r-xr-x--.channel ORA_DISK_1: starting piece 1 at 30-MAR-07 channel ORA_DISK_1: finished piece 1 at 30-MAR-07 piece handle=+ARCH/odb/backupset/2007_03_30/annnf0_tag20070330t092547_0.zip [root@in asm_command]# Usage Steps: ora10g$ export ORACLE_SID=+ASM ora10g$ asmcmd ASMCMD> Commands: 1.0.1.1 root root 1728 Aug 11 2005 asmcmd.0.zip Archive: asmcmd_10.1 root root 48359 Mar 31 09:33 asmcmd_10.0.2.

617411607 +DATA/ODB/DATAFILE/: SYSAUX.617411379 14 .269.617411609 Current.618010785 UNDOTBS1.260.ora => +DATA/DB_UNKNOWN/PARAMETERFILE/SPFILE.618010569 T1.258.257.256.273.617411377 SYSTEM.617411373 T1.272. Command to Change Directory ASMCMD> cd +DATA 3.617745979 ASMCMD> ASMCMD> ls * +DATA/ODB/CONTROLFILE/: Current.261. Command to List the Present Working Direcoty ASMCMD> pwd +DATA ASMCMD> Advanced Commands ASMCMD> cd ODB ASMCMD> ls -l Type Redund Striped Time Sys Name Y DB_UNKNOWN/ Y ODB/ ASMCMD> cd ODB ASMCMD> ls -l Type Redund Striped Time Sys Name Y CONTROLFILE/ Y DATAFILE/ Y ONLINELOG/ Y TEMPFILE/ N spfileodb.271.617752879 T1.MOUNTED EXTERN N N ARCH/ MOUNTED NORMAL N N CONTROL/ MOUNTED NORMAL N N DATA/ ASMCMD> ASMCMD> ls -lrt * Type Redund Striped Time Sys Name +ARCH/: Y ODB/ +CONTROL/: Y ODB/ +DATA/: Y DB_UNKNOWN/ Y ODB/ ASMCMD> 2.

ora ASMCMD> ASM : RMAN Restoration and Recovery Introduction: In the below steps we will Restore the Database which is ASM Enabled.263.264.------.-.617411381 channel ORA_DISK_1: reading from backup piece 15 .259.267.265.268.--9 B A A DISK 30-MAR-07 1 1 NO TAG20070330T092016 10 B F A DISK 30-MAR-07 1 1 NO TAG20070330T092148 11 B A A DISK 30-MAR-07 1 1 NO TAG20070330T092547 12 B F A DISK 30-MAR-07 1 1 NO TAG20070330T092551 13 B A A DISK 30-MAR-07 1 1 NO TAG20070330T220423 14 B F A DISK 30-MAR-07 1 1 NO TAG20070330T220455 15 B A A DISK 30-MAR-07 1 1 NO TAG20070330T221048 16 B F A DISK 30-MAR-07 1 1 NO TAG20070330T221058 17 B A A DISK 31-MAR-07 1 1 NO TAG20070331T083321 18 B F A DISK 31-MAR-07 1 1 NO TAG20070331T083331 19 B A A DISK 31-MAR-07 1 1 NO TAG20070331T083742 20 B F A DISK 31-MAR-07 1 1 NO TAG20070331T083747 RMAN> SHUTDOWN the Database and Startup NoMount RMAN> restore database from tag='TAG20070330T092148'.USERS. Starting restore at 31-MAR-07 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile backupset restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set restoring datafile 00001 to +DATA/odb/datafile/system.617411613 group_1.data_d-odb_i-2580585621_ts-t1_fno-5_0cidc5u7 t. List of Backups =============== Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag ------. LAB RMAN> list backup summary.258.---------.259.617411665 group_2.617412065 spfileodb.617411719 group_2.-.617411377 restoring datafile 00004 to +DATA/odb/datafile/users.617411773 group_3.617411381 t.data_d-odb_i-2580585621_ts-t1_fno-5_0didc651 t1_5_db_odb +DATA/ODB/ONLINELOG/: group_1.262.617411845 group_3.617411373 restoring datafile 00002 to +DATA/odb/datafile/undotbs1.----------.617411379 restoring datafile 00003 to +DATA/odb/datafile/sysaux.256.--------------..617411929 +DATA/ODB/TEMPFILE/: TEMP.257.------.266.

291.283.286.618657397 recid=18 stamp=618657407 archive log filename=+ARCH/odb/archivelog/2007_03_30/thread_1_seq_19. elapsed time: 00:00:15 archive log filename=+ARCH/odb/archivelog/2007_03_31/thread_1_seq_18.263.263. database opened 16 .618571549 tag=TAG20070330T092547 channel ORA_DISK_1: restore complete.618617069 channel ORA_DISK_1: restored backup piece 1 piece handle=+ARCH/odb/backupset/2007_03_30/annnf0_tag20070330t220423_0. elapsed time: 00:00:53 Finished recover at 31-MAR-07 RMAN> RMAN> alter database open.618617445 archive log thread 1 sequence 20 is already on disk as file +ARCH/odb/archivelog/2007_03_31/thread_1_seq_20.291.618571311 channel ORA_DISK_1: restored backup piece 1 piece handle=+ARCH/odb/backupset/2007_03_30/nnndf0_tag20070330t092148_0.263.618617445 thread=1 sequence=19 media recovery complete.618657391 recid=17 stamp=618657393 channel ORA_DISK_1: starting archive log restore to default destination channel ORA_DISK_1: restoring archive log archive log thread=1 sequence=18 channel ORA_DISK_1: reading from backup piece +ARCH/odb/backupset/2007_03_30/annnf0_tag20070330t220423_0.286.263.280.283.618657391 thread=1 sequence=17 channel default: deleting archive log(s) archive log filename=+ARCH/odb/archivelog/2007_03_31/thread_1_seq_17.618654795 archive log thread 1 sequence 21 is already on disk as file +ARCH/odb/archivelog/2007_03_31/thread_1_seq_21.618617069 tag=TAG20070330T220423 channel ORA_DISK_1: restore complete. Starting recover at 31-MAR-07 using channel ORA_DISK_1 starting media recovery archive log thread 1 sequence 19 is already on disk as file +ARCH/odb/archivelog/2007_03_30/thread_1_seq_19.618657397 thread=1 sequence=18 channel default: deleting archive log(s) archive log filename=+ARCH/odb/archivelog/2007_03_31/thread_1_seq_18.618655059 channel ORA_DISK_1: starting archive log restore to default destination channel ORA_DISK_1: restoring archive log archive log thread=1 sequence=17 channel ORA_DISK_1: reading from backup piece +ARCH/odb/backupset/2007_03_30/annnf0_tag20070330t092547_0.280.618571549 channel ORA_DISK_1: restored backup piece 1 piece handle=+ARCH/odb/backupset/2007_03_30/annnf0_tag20070330t092547_0.265.618571311 tag=TAG20070330T092148 channel ORA_DISK_1: restore complete.+ARCH/odb/backupset/2007_03_30/nnndf0_tag20070330t092148_0. elapsed time: 00:02:33 Finished restore at 31-MAR-07 RMAN> RMAN> recover database delete archivelog maxsize 50m. elapsed time: 00:00:03 archive log filename=+ARCH/odb/archivelog/2007_03_31/thread_1_seq_17.293.

.617493211' to COPY.617751709 tag=TAG20070320T214148 recid=5 stamp=617751751 channel ORA_DISK_1: datafile copy complete.-------------------. Report of database schema List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---.270.270.256.617493211' to '+DATA'.270. Report of database schema List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---. RMAN> sql 'alter database datafile 5 offline'.617493211 output filename=+DATA/odb/datafile/t1.-----------------------5 100 T1 ** +DG1/odb/datafile/t1.-------.256. elapsed time: 00:00:57 Finished backup at 20-MAR-07 RMAN> report schema. RMAN> switch datafile '+DG1/odb/datafile/t1.-----------------------5 100 T1 ** +DG1/odb/datafile/t1.-------------------.-------------------.-------.256.617751709 RMAN> sql 'alter database datafile 5 online'.------. Starting backup at 20-MAR-07 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile copy input datafile fno=00005 name=+DG1/odb/datafile/t1.RMAN> ASM: Move DataFile from One DiskGroup to Another Introduction : We will use RMAN commands to move a ASM Based DataFile from One Disk to Another.256... datafile 5 switched to datafile copy "+DATA/odb/datafile/t1..------.617493211 . sql statement: alter database datafile 5 online RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03009: failure of sql command on default channel at 03/20/2007 21:47:02 17 .256.------.-------. sql statement: alter database datafile 5 offline RMAN> copy datafile '+DG1/odb/datafile/t1. Report of database schema List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---.617493211 .-----------------------5 100 T1 ** +DATA/odb/datafile/t1.617751709" RMAN> report schema. RMAN> report schema.

617411381 18 .617411381 +DATA/odb/datafile/t1. NAME -------------------------------------------------------------------------------+DATA/odb/datafile/system.617751709'.257.617749589 7 rows selected.617749583 +DG1/odb/datafile/test1. File Size(MB) Tablespace RB segs Datafile Name . sql statement: alter database datafile 5 online RMAN> SQL> select name from v$datafile.617411377 +DATA/odb/datafile/users.259. 4 5 USERS ** +DATA/odb/datafile/users.617411379 +DATA/odb/datafile/sysaux.270.Using RMAN Copy command we have copied the datafile from its DiskGroup to the New DiskGroup.270. Starting recover at 20-MAR-07 using channel ORA_DISK_1 starting media recovery media recovery complete. elapsed time: 00:00:03 Finished recover at 20-MAR-07 RMAN> sql 'alter database datafile 5 online'. Then using SWITCH Command the DataFile is Renamed .617411373 +DATA/odb/datafile/undotbs1.617751709' RMAN> recover datafile '+DATA/odb/datafile/t1.258. Starting backup at 18-APR-07 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=149 devtype=DISK channel ORA_DISK_1: starting datafile copy input datafile fno=00004 name=+DATA/odb/datafile/users.617411381 +TEST is the new ASM Disk Group RMAN> BACKUP AS COPY DATAFILE 4 FORMAT '+TEST'. RMAN> REPORT SCHEMA.261. SQL> Summary: Here we have taken the datafile offline.. Recovered and Onlined.256. some of the RMAN Commands are Deprecated. Like "COPY" Command is replaced by "BACKUP AS COPY" Deprecated RMAN Commands in 10g Let me explain how to go about the same step using BACKUP AS COPY option.270.262.RMAN-11003: failure during parse/execution of SQL statement: alter database datafile 5 online ORA-01113: file 5 needs media recovery ORA-01110: data file 5: '+DATA/odb/datafile/t1.259.617751709 +DG1/odb/datafile/test1. RMAN Copy Command Syntax ( Release 9i) From Release 10g .259.

-----------------------. 19 ..256.620211179 tag=TAG20070418T085257 re cid=16 stamp=620211184 channel ORA_DISK_1: datafile copy complete.620211191 commen t=NONE Finished Control File and SPFILE Autobackup at 18-APR-07 RMAN> RMAN> switch datafile 4 to COPY.620211179 Summary: Here we have Backup As Copy Option to move a datafile from one Disk Group to Another.-------------------. elapsed time: 00:00:08 Finished backup at 18-APR-07 Starting Control File and SPFILE Autobackup at 18-APR-07 piece handle=+CONTROL/odb/autobackup/2007_04_18/s_620211185.output filename=+TEST/odb/datafile/users.------.256.256.256. datafile 4 switched to datafile copy "+TEST/odb/datafile/users.-------. 4 5 USERS +TEST/odb/datafile/users.620211179" RMAN> RMAN> REPORT SCHEMA. Report of database schema List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---.

Sign up to vote on this title
UsefulNot useful