Skip to content

1z0-060 Q5

You are administering a database stored in Automatic Storage Management (ASM). You use RMAN to back up the database and the MD_BACKUP command to back up the ASM metadata regularly. You lost an ASM disk group DG1 due to hardware failure. In which three ways can you re-create the lost disk group and restore the data?

A.Use the MD_RESTORE command to restore metadata for an existing disk group by passing the existing disk group name as an input parameter and use RMAN to restore the data.

B.Use the MKDG command to restore the disk group with the same configuration as the backedup disk group and data on the disk group.

C.Use the MD_RESTORE command to restore the disk group with the changed disk group specification, failure group specification, name, and other attributes and use RMAN to restore the data.

D.Use the MKDG command to restore the disk group with the same configuration as the backedup disk group name and same set of disks and failure group configuration, and use RMAN to restore the data.

E.Use the MD_RESTORE command to restore both the metadata and data for the failed disk group.

F.Use the MKDG command to add a new disk group DG1 with the same or different specifications for failure group and other attributes and use RMAN to restore the data.

Answers

Answers C,D,F

-A.Use the MD_RESTORE command to restore metadata for an existing disk group by passing the existing disk group name as an input parameter and use RMAN to restore the data.
>> restore of metadata does not create diskgroup

-B.Use the MKDG command to restore the disk group with the same configuration as the backedup disk group and data on the disk group.
>> mkdg do not recover data

-C.Use the MD_RESTORE command to restore the disk group with the changed disk group specification, failure group specification, name, and other attributes and use RMAN to restore the data.
we cannot change failure group specs or something else exept disk group name

but it we need a three answers IMHO C will be more correct than A

+D.Use the MKDG command to restore the disk group with the same configuration as the backedup disk group name and same set of disks and failure group configuration, and use RMAN to restore the data.

-E.Use the MD_RESTORE command to restore both the metadata and data for the failed disk group.
>>MD RESTORE do not recover data

+F.Use the MKDG command to add a new disk group DG1 with the same or different specifications for failure group and other attributes and use RMAN to restore the data.

add 2 more disk to our vm for +FRA data (12gb) and one for +data (60gb)

create partitions and mark them as fra
[code]
[root@oel7-2 ~]# oracleasm createdisk FRA1 /dev/sdd1
Writing disk header: done
Instantiating disk: done
[root@oel7-2 ~]# oracleasm createdisk FRA2 /dev/sdc1
Writing disk header: done
Instantiating disk: done
[/code]

and one more disk for +DATA DG
[code]
[root@oel7-2 ~]# oracleasm createdisk DISK2 /dev/sde1
Writing disk header: done
Instantiating disk: done
[root@oel7-2 ~]# oracleasm listdisks
DISK1
DISK2
FRA1
FRA2
[/code]

[code language=”sql”]
SQL> select name,path from v$asm_disk;

NAME PATH
—————————— —————————————————————————————————-
/dev/oracleasm/disks/FRA2
/dev/oracleasm/disks/DISK2
/dev/oracleasm/disks/FRA1
DATA_0000 /dev/oracleasm/disks/DISK1

SQL> create diskgroup FRA normal redundancy disk ‘/dev/oracleasm/disks/FRA1′,’/dev/oracleasm/disks/FRA2’;

Diskgroup created.

SQL> alter diskgroup data add disk ‘/dev/oracleasm/disks/DISK2’ rebalance power 4;

Diskgroup altered.
[/code]

after all we have external redundancy for +DATA and normal for FRA =))

[code language=”sql”]
select
g.name "Diskgroup", d.path "Disk", d.failgroup "Fail Group", d.total_mb "Size (MB)"
from v$asm_diskgroup g, v$asm_disk d
where d.GROUP_NUMBER=g.GROUP_NUMBERorder by 1,2;

Diskgroup Disk Fail Group Size (MB)
———- —————————————- —————————— ————
DATA /dev/oracleasm/disks/DISK1 DATA_0000 61,436
DATA /dev/oracleasm/disks/DISK2 DATA_0001 61,436
FRA /dev/oracleasm/disks/FRA1 FRA_0000 12,287
FRA /dev/oracleasm/disks/FRA2 FRA_0001 12,287

select name "Diskgroup", SECTOR_SIZE "Sector Size", ALLOCATION_UNIT_SIZE/1024/1024 "AU Size (MB)",
state "State", type "Redundancy", TOTAL_MB "Size (MB)", FREE_MB "Free (MB)",
FREE_MB/decode(type, ‘HIGH’, 3,’NORMAL’, 2) "Usable (MB)", round (FREE_MB/TOTAL_MB,2)*100 as free_Pct
from v$asm_diskgroup order by total_mb desc;

Diskgroup Sector Size AU Size (MB) State Redundancy Size (MB) Free (MB) Usable (MB) FREE_PCT
———- ———– ———— ———– ———- ———- ———- ———– ———-
DATA 512 4 MOUNTED EXTERN 122872 111360 91
FRA 512 1 MOUNTED NORMAL 24574 24472 12236 100
[/code]

lets check C:

simulate disk chash, but lets backup first

[code]
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP on;
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO compressed backupset ;
RMAN> backup database plus archivelog;
[/code]

=) i’am already do the same while prepare to 11g and had to recreate asm spfile, so now i will be trickier and do backup
[code]
SQL> create pfile=’/home/grid/pfile.ora’ from spfile;
[/code]

and we need to run MD_BACKUP to back up the ASM metadata
[code]
ASMCMD [+] > help md_backup
md_backup
The md_backup command creates a backup file containing metadata
for one or more disk groups.
Volume and Oracle Automatic Storage Management Cluster File System
(Oracle ACFS) file system information is not backed up.

Synopsis
md_backup <backup_file> [-G <diskgroups,…>]

ASMCMD [+] > md_backup /home/grid/all_asm_meta.bcp
Disk group metadata to be backed up: FRA
Disk group metadata to be backed up: DATA
Current alias directory path: ORCL/2195CDCEF39E1574E053480A0A0AD407/BACKUPSET
Current alias directory path: ORCL/ARCHIVELOG
Current alias directory path: ORCL/219BAB6B84D8288AE053480A0A0A6CC1/BACKUPSET
Current alias directory path: ORCL/AUTOBACKUP/2015_10_12
Current alias directory path: ORCL/2195FDBE51A019B9E053480A0A0A05A8
……
[/code]

now lets corrupt some data and, to add a dramatic moment, run singbench test

Screen Shot 2015-10-12 at 17.08.15
and run
[code language=”bash”]
[root@oel7-2 ~]# dd if=/dev/zero of=/dev/oracleasm/disks/DISK1 bs=102400000 count=10
10+0 records in
10+0 records out
1024000000 bytes (1.0 GB) copied, 5.03676 s, 203 MB/s
[/code]

after 30 seconds .. omg !! alarm alarm ))))

[code]
Mon Oct 12 09:38:04 2015
failed to start shared server
Mon Oct 12 09:39:11 2015
failed to start shared server
Mon Oct 12 09:39:15 2015
Hex dump of (file 16, block 2746) in trace file /ora01/app/oracle/diag/rdbms/orcl/ora12c/trace/ora12c_p001_4786.trc
Mon Oct 12 09:39:17 2015
Hex dump of (file 0, block 767) in trace file /ora01/app/oracle/diag/rdbms/orcl/ora12c/trace/ora12c_ckpt_4702.trc
Mon Oct 12 09:39:17 2015
Hex dump of (file 0, block 1) in trace file /ora01/app/oracle/diag/rdbms/orcl/ora12c/trace/ora12c_arc2_4768.trc

Mon Oct 12 09:39:19 2015

Corrupt block relative dba: 0x00400aba (file 16, block 2746)
Completely zero block found during buffer read

Mon Oct 12 09:39:19 2015
….
Reading datafile ‘+DATA/ORCL/21E7DF21DA7E15EBE053480A0A0AC11C/DATAFILE/system.315.892885563′ for corruption at rdba: 0x00404339 (file 16, block 17209)
Reread (file 16, block 17209) found same corrupt data (no logical check)
Hex dump of (file 16, block 17210) in trace file /ora01/app/oracle/diag/rdbms/orcl/ora12c/trace/ora12c_smon_4706.trc
…..
USER (ospid: 4702): terminating the instance due to error 227
[/code]

restart of asm instance:
[code language=”sql”]
SQL> shutdown immediate;
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup mount pfile=’/home/grid/pfile.ora’;

[grid@oel7-2 ~]$ asmcmd -p
ASMCMD [+] > lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED NORMAL N 512 4096 1048576 24574 11044 0 5522 0 N FRA/
[/code]

as i am erase only one disk restore failed because diskgroup data exists but can’t be mount as not all disks exists

[code language=”sql”]
SQL> drop diskgroup data force including contents;
[/code]

after it

try to recreate diskgroup:
[code language=”bash”]
[grid@oel7-2 dbs]$ asmcmd md_restore –nodg -G data /home/grid/all_asm_meta.bcp
Current Diskgroup metadata being restored: DATA
ORA-15032: not all alterations performed
ORA-15001: diskgroup "DATA" does not exist or is not mounted (DBD ERROR: OCIStmtExecute)
ASMCMD-9360: ADD or ALTER ATTRIBUTE failed
ORA-15032: not all alterations performed
ORA-15001: diskgroup "DATA" does not exist or is not mounted (DBD ERROR: OCIStmtExecute)
[/code]

A is wrong as we heave no DG available for rman.

B is wrong as mkdg do not recover data

check C
[code language=”bash”]
ASMCMD> md_restore -G data /home/grid/all_asm_meta.bcp
Current Diskgroup metadata being restored: DATA
Diskgroup DATA created!
System template INCR XTRANSPORT BACKUPSET modified!
System template VOTINGFILE modified!
…..
System template AUTOLOGIN_KEY_STORE modified!
Directory +DATA/ASM re-created!
….
Directory +DATA/ORCL/FD9AC20F64D244D7E043B6A9E80A2F2F/DATAFILE re-created!
[/code]

so time to resore\recover database:

[code language=”sql”]
RMAN>
run {
startup nomount;
set DBID=1420313729;
restore controlfile from autobackup;
alter database mount;
restore database;
recover database;
sql ‘alter database open resetlogs’; }
[/code]

C.TRUE

Partialy=) we can change disk group name and as result failover diskgroup, but some attributes ( for example stripe size or comatiple level ) are not modified by MD_RESTORE

now to save some time backup controlfile to diskgroup witch one should survive ;
[code language=”sql”]
SQL> alter database backup controlfile to ‘+FRA’;
and
SQL> alter system set control_files=’+FRA/orcl/controlfile/Backup.335.892952295′ scope=spfile;
[/code]

corrupt one more time
[code]
[root@oel7-2 ~]# dd if=/dev/zero of=/dev/oracleasm/disks/DISK1 bs=102400000 count=100
100+0 records in
100+0 records out
10240000000 bytes (10 GB) copied, 157.284 s, 65.1 MB/s
[/code]

shutdown\startup asm
[code language=”bash”]
ASMCMD> mount data
ORA-15032: not all alterations performed
ORA-15040: diskgroup is incomplete
ORA-15042: ASM disk "1" is missing from group number "2" (DBD ERROR: OCIStmtExecute)
[/code]

check D
[code language=”bash”]
[grid@oel7-2 ~]$ asmcmd mkdg /home/grid/data.xml
[grid@oel7-2 ~]$ cat /home/grid/data.xml
<dg name="data" redundancy="NORMAL">
<dsk string="/dev/oracleasm/disks/DISK*"/>
<a name="compatible.asm" value="12.1"/>
<a name="compatible.rdbms" value="12.1"/>
</dg>

[grid@oel7-2 ~]$ asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED NORMAL N 512 4096 1048576 122878 122770 0 61385 0 N DATA/
MOUNTED NORMAL N 512 4096 1048576 24574 5430 0 2715 0 N FRA/
[/code]

restore database:

[code language=”sql”]
RMAN>
run {
startup nomount;
set DBID=1420313729;
restore controlfile from autobackup;
alter database mount;
restore database;
recover database;
sql ‘alter database open resetlogs’; }
[/code]

[свернуть]

Primary Sidebar