Total Pageviews

Sunday 24 May 2015

ASMCMD - New commands in 11gR1

The ASMCMD cp option allows you to copy files between ASM disk groups and OS file systems and between two ASM servers. 

The following file copy can be performed 

- ASM Diskgroup to OS file system 
- OS file system to ASM Diskgroup 
- ASM Diskgroup to another diskgroup
ASM Diskgroup to OS File system 

ASMCMD> cp +DGEXT/orcl/datafile/tbsext.256.628847401 /home/oracle/tbsext.dbf 
source +DGEXT/orcl/datafile/tbsext.256.628847401 
target /home/oracle/tbsext.dbf 
copying file(s)... 
file, /home/oracle/tbsext.dbf, copy committed. 

OS File system to ASM Diskgroup 

ASMCMD> cp /home/oracle/tbsext.dbf +DGEXTBK/prod/datafile/tbsext.dbf 
source /home/oracle/tbsext.dbf 
target +DGEXTBK/prod/datafile/tbsext.dbf 
copying file(s)... 
file, +DGEXTBK/prod/datafile/tbsext.dbf, copy committed.

SQL> create diskgroup dgext external redundancy disk '/dev/raw/raw1','/dev 
/raw/raw2'; 
Diskgroup created. 

SQL> create diskgroup DGEXTBK external redundancy disk '/dev/raw/raw3','/dev/raw /raw4'; 
Diskgroup created. 

ASMCMD> cd DGEXTBK 
ASMCMD> mkdir prod 
ASMCMD> cd prod 
ASMCMD> mkdir datafile 
ASMCMD> cd datafile 
ASMCMD> pwd 
+DGEXTBK/prod/datafile 

SQL> create tablespace TBSEXT datafile '+DGEXT' size 10m; 
Tablespace created. 

SQL> select name from v$datafile; 

NAME 
------------------------------------------------------------- 
+DGEXT/orcl/datafile/tbsext.256.628847401
cp +DGEXT/orcl/datafile/tbsext.256.628847401 +DGEXTBK/prod/datafile/tbsext  

ASMCMD> cp +DGEXT/orcl/datafile/tbsext.256.628847401 +DGEXTBK/prod/datafile/tbsext  
source +DGEXT/orcl/datafile/tbsext.256.628847401  
target +DGEXTBK/prod/datafile/tbsext  
copying file(s)...file, +DGEXTBK/prod/datafile/tbsext, copy committed.  


The tbsext is alias name created in the folder +DGEXTBK/prod/datafile.


SMCMD md_backup and md_restore 





Disk group to be backed up: DGEXT 

The full mode restores the diskgroup exactly as it was at the time of backup
ASMCMD> md_restore -b dgbk -t full -g dgext 
Current Diskgroup being restored: DGEXT 
ASMCMD-09352: CREATE DISKGROUP failed 
ORA-15018: diskgroup cannot be created 
ORA-15030: diskgroup name "DGEXT" is in use by another diskgroup (DBD ERROR: OCIStmtExecute) 

Diskgroup dropped. 

Current Diskgroup being restored: DGEXT 
Diskgroup DGEXT created! 
System template XTRANSPORT modified! 
System template ONLINELOG modified! 
System template DATAGUARDCONFIG modified! 
System template AUTOBACKUP modified! 
System template TEMPFILE modified! 
System template ARCHIVELOG modified! 
System template ASM_STALE modified! 
System template BACKUPSET modified! 
System template DUMPSET modified! 
System template FLASHBACK modified! 
System template PARAMETERFILE modified! 
System template CONTROLFILE modified! 
System template DATAFILE modified! 
System template CHANGETRACKING modified! 


------------ -------------------- ------ 
           1 DGEXT                EXTERN
The 'nodg' mode restore the attributes,templates, and alias directory structure specified in the backup file to an existing disk group.
ASMCMD> md_restore -b dgbk -t nodg -g dgext 
Current Diskgroup being restored: DGEXT 
System template XTRANSPORT modified! 
System template ONLINELOG modified! 
System template DATAGUARDCONFIG modified! 
System template AUTOBACKUP modified! 
System template TEMPFILE modified! 
System template ARCHIVELOG modified! 
System template ASM_STALE modified! 
System template BACKUPSET modified! 
System template DUMPSET modified! 
System template FLASHBACK modified! 
System template PARAMETERFILE modified! 
System template CONTROLFILE modified! 
System template DATAFILE modified! 
System template CHANGETRACKING modified!
The 'newdg' mode allows the user to override the disk group name,disk, and failgroup specifications as part of a diskgroup creation,but retains 
the attribute,template and, alias directory structure from the backup
ASMCMD>  md_restore -b dgbk -t newdg -o 'DGEXT:DG' 
Current Diskgroup being restored: DGEXT 
Current Diskgroup name replace by: DG 
Diskgroup DG created! 
System template XTRANSPORT modified! 
System template ONLINELOG modified! 
System template DATAGUARDCONFIG modified! 
System template AUTOBACKUP modified! 
System template TEMPFILE modified! 
System template ARCHIVELOG modified! 
System template ASM_STALE modified! 
System template BACKUPSET modified! 
System template DUMPSET modified! 
System template FLASHBACK modified! 
System template PARAMETERFILE modified! 
System template CONTROLFILE modified! 
System template DATAFILE modified! 
System template CHANGETRACKING modified!
SQL> select group_number,name,type from v$asm_diskgroup 

------------ -------------------- ------ 
           1 DG                   EXTERN

1 comment:

  1. Jadwal Sabung Ayam Online SV388 22 Februari 2019 di Situs Judi Sabung Ayam Online Melalui Agen Resmi Taruhan Sabung Ayam Live Asli Thailand.

    Jumat, Palangkaraya 22 Februari 2019 – Pada Hari Tersebut Akan Di Laksanakan Berbagai Pertandingan Sabung Ayam Secara Live di Arena Sabung Ayam Thailand

    Untuk Info Lebih Lanjut Bisa Hub kami Di :
    wechat : bolavita
    line : cs_bolavita
    whatsapp : +628122222995
    BBM: BOLAVITA

    ReplyDelete