Wednesday, 17 January 2018

Dropping ASM Disk Group in detail (Step by Step)

--check following parameter before dropping ASM DG:

Before dropping the ASM DiskGroup please check the below parameter as any one of them is pointing to the Disk group which you are going drop, if there are some parameter found point to that DG, we have to set new location for it.

Sqlplus / as sysdba

--Checking Oracle OMF Location

SQL> show parameter create

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
create_bitmap_area_size              integer     8388608
create_stored_outlines               string
db_create_file_dest                  string      +FRA_TESTDB/TESTDB
db_create_online_log_dest_1          string
db_create_online_log_dest_2          string
db_create_online_log_dest_3          string
db_create_online_log_dest_4          string
db_create_online_log_dest_5          string

we have to update the old DG name with new DG as:

alter system set db_create_file_dest='+FRA_TESTDB_01/TESTDB' scope=both;

SQL> show parameter create

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
create_bitmap_area_size              integer     8388608
create_stored_outlines               string
db_create_file_dest                  string      +FRA_TESTDB_01/TESTDB
db_create_online_log_dest_1          string
db_create_online_log_dest_2          string
db_create_online_log_dest_3          string
db_create_online_log_dest_4          string
db_create_online_log_dest_5          string

-- Now check the postion of Flash recovery Area

SQL> show parameter recovery

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest                string      +FRA_TESTDB
db_recovery_file_dest_size           big integer 8016M
recovery_parallelism                 integer     0
remote_recovery_file_dest            string

This location should also be changed to new DG as:

alter system set db_recovery_file_dest='+FRA_TESTDB_01' scope=both;

Similarly check Controlfiles,log_archive_destination if you have set, change it to new disk group.

For controlfile movement (follow the blog moving data accross the disk groups)

-- Checking all the datafiles, there shouldn't exists any datafile on this DG:


select name from v$controlfile
union
select name from v$datafile
union
select name from v$tempfile
union
select member from v$logfile
union
select filename from v$block_change_tracking
union
select name from v$flashback_database_logfile;


-- Delete a directory and all its contents.

ALTER DISKGROUP disk_group_1 DROP DIRECTORY '+FRA_TESTDB/backup' FORCE;

When its all clear that there is no DB parameter pointing to the DG going to be dropped and no live data is there we can drop that disk group.

-- To check dependancy & Remove Dependacny


#./srvctl config database -d DBTESTQ

SQL> drop diskgroup PLAY force including contents;

Or we can do it by Srv utility

Stopping the FRA resources

[root@testdb bin]# ./srvctl stop diskgroup -g FRA

Dropping the Disk

[root@testdb bin]# ./srvctl remove diskgroup -g FRA

Checking the Status

[root@testdb bin]# ./srvctl config database -d testdb
Database unique name: testdb
Database name: testdb
Oracle home: /u01/app/oracle/product/11.2.0
Oracle user: grid
Spfile: +DATA/testdb/spfiletestdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DATA,ARCH
Services:
[root@testdb bin]# 

1 comment:

Installing Oracle 11g on Linux

Unpack Files Unzip the files. # 11.2.0.1 unzip linux.x64_11gR2_database_1of2.zip unzip linux.x64_11gR2_database_2of2.zip #11.2.0.2 u...