Mir Sayeed Hassan – Oracle Blog

Oracle DBA – Tips & Techniques | Learn with real-time examples

  • Translate

  • It’s Me






  • My Certificates

  • Links

    My Acclaim Certification : Credly Profile
    My Oracle ACE Pro Profile

  • Achievements

    Awarded Top 100 Oracle Blogs from Worldwide - #RANK 39
  • VISITORS COUNT

  • Verified International Academic Qualification from World Education Service (WES)

    Verified International Academic Qualification from World Education Service (WES)

  • Jobs

Error while deleting the oracleasm disks from Oracle Server

Posted by Mir Sayeed Hassan on October 20th, 2020

Error while deleting the oracleasm disks from Oracle Server

Check the disk need to delete

[root@pri-db ~]# cd /dev/oracleasm/disks/

[root@pri-db disks]# ls
ORADATA

Delete the oracleasm disk “ORADATA”

[root@pri-db disks]# oracleasm deletedisk ORADATA
Clearing disk header: failed
Unable to clear disk "ORADATA"

As we would see the disk does not deleted due to the header of the disk in unclear

Check the disk Name

[root@pri-db ~]# cd /dev/mapper/
[root@pri-db mapper]# ls
backup-backup control ol-root ol-swap Unity71-Shop-DB Unity71-Shop-DB1
[root@pri-db mapper]# ll

total 0
lrwxrwxrwx. 1 root root 7 Aug 16 20:00 backup-backup -> ../dm-2
crw-------. 1 root root 10, 236 Aug 16 20:00 control
lrwxrwxrwx. 1 root root 7 Aug 16 20:00 ol-root -> ../dm-0
lrwxrwxrwx. 1 root root 7 Aug 16 20:00 ol-swap -> ../dm-1
lrwxrwxrwx. 1 root root 7 Aug 16 20:00 Unity71-Shop-DB -> ../dm-3
lrwxrwxrwx. 1 root root 7 Aug 16 20:00 Unity71-Shop-DB1 -> ../dm-4

Clear the header of the disk by uisng the below command

[root@pri-db mapper]# dd if=/dev/mapper/Unity71-Shop-DB1 of=/tmp/Unity71-Shop-DB1_header_bck bs=4096 count=1
1+0 records in
1+0 records out
4096 bytes (4.1 kB, 4.0 KiB) copied, 0.00112731 s, 3.6 MB/s
[root@pri-db mapper]# dd if=/dev/zero of=/dev/mapper/Unity71-Shop-DB1 bs=4096 count=1
1+0 records in
1+0 records out
4096 bytes (4.1 kB, 4.0 KiB) copied, 0.00063471 s, 6.5 MB/s

Deleted the disk successfully

[root@pri-db mapper]# oracleasm deletedisk ORADATA
Disk "ORADATA" defines an unmarked device
Dropping disk: done

=====Hence deleted the disk, tested & verified in our env=====