Oracle ASM is part of Grid Infrastructure and resides in its own ORACLE_HOME directory. Backup of the ASM software is the same as any other Oracle installation. The backup of any database using the ASM instance can be done using RMAN, which is the standard tool to backup all Oracle Databases. To access or copy individual files from the OS command line you can use the ASMCMD command. However, you cannot use TAR or any other backup software to access the data on ASM disks.
What type of backup will be taken by md_backup command?
will it take all files/directory/DG of ASM?
I still confused what type of metadata will be backed up?
There is two different things:
1: Backup of Database stored on ASM
2: Backup of ASM configuration
Backup of Database stored on ASM should be done using RMAN.
When you are not using ASM, how do you take a backup of Oracle Database using RMAN?
The same way you will take backup of database on stored on ASM. Using RMAN just run "Backup Database Plus Archivelog....".
About Backup ASM Configuration:
You can backup structure (metadata) of ASMDISK Group to a File, that can be used only to recreate ASMDISK GROUP and it's configuration (i.e No Data). To restore data you will need use RMAN as you would on normal filesystem.
How do I backup my ASM instance?
ASM has no files to backup, as its does not contain controlfile,redo logs etc.
ASM is a Filesystem that has it's particular concept.
Oracle Database are Files stored on filesystem supported by Oracle ( such as ASM, EXT3 and so on)
You must learn about two concepts that are different from one to another.
First of all you need to understand that RDBMS & ASM instance both is different but yes both are running on the same machine.
ASM Includes basically two things: (1) ASM instance and (2) ASM storage.
1) ASM instance
It is just an instance so that we need not to take any backup but yes if you want to preserve the configuration file of ASM instance then just do like this:
[grid@host01 ~]$ . oraenv
ORACLE_SID = [+ASM1] ? +ASM1
The Oracle base for ORACLE_HOME=/u01/app/11.2.0/grid is /u01/app/grid
SQL> create pfile='/home/grid/init+ASM1.ora' from spfile;
2) ASM STORAGE
- ASM storage basically includes ASM diskgroups which is again collection of multiple disks.
- Whenever we do create ASM diskgroup that diskgroup contains again three things:
a) ASM disks
b) Templates and Metadata
c) ASM files (basically datafile or any files of database)
- We need to take backup of two things out of three things of ASM diskgroup :
1) ASM files- using RMAN because these are database files.
2) ASM diskgroup Templates & Metadata- using MD_BACKUP command from ASMCMD.
Now, MD_BACKUP will create a backup file as your specified location and that file will includes all the templates and metadata of that diskgroup. Benefit of taking diskgroup metadata is, if we lost the diskgroup then we need not to worry about the configuration details just use MD_RESTORE command to recreate the diskgroup with the same configuration. But remember it will not restore datafile or any other files which was there on that diskgroup we'll have to use RMAN to restore those missing files.
See the sample:
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 11742 11643 0 11643 0 N ABC/ MOUNTED NORMAL N 512 4096 1048576 15656 10661 1259 4701 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 15656 13874 0 13874 0 N FRA/
ASMCMD> md_backup /home/grid/data_backup_file -G DATA
Disk group metadata to be backed up: DATA
Current alias directory path: cluster01
Current alias directory path: ORCL
Current alias directory path: ORCL/PARAMETERFILE
Current alias directory path: ORCL/DATAFILE
Current alias directory path: cluster01/OCRFILE
Current alias directory path: ORCL/CONTROLFILE
Current alias directory path: ORCL/TEMPFILE
Current alias directory path: ORCL/ONLINELOG
Current alias directory path: cluster01/ASMPARAMETERFILE