Home » RDBMS Server » Server Administration » Switch between disks in a diskgroup (Oracle 11gR1 11.1.0.6)
Switch between disks in a diskgroup [message #521581] Wed, 31 August 2011 06:11 Go to next message
luc_tran
Messages: 31
Registered: October 2010
Location: Viet Nam
Member

Hi experts,

I have an Oracle database 11.1.0.6 with ASM storage.

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Production
CORE    11.1.0.6.0      Production
TNS for Solaris: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production



There is a disk group named +FRA which has only 1 disk (call it disk 0 for later references).
+FRA disk group is in type of EXTERNAL redundancy

I'd like to add another disk to +FRA disk group and copy all files stored in disk 0 to the new disk (call it disk 1 for ex.), then take off disk 0 (not use for +FRA disk group any more).

Expected result: there is only one disk 1 left in the +FRA disk group, with all the data from disk 0 and keep their original file names

Could you please tell me how to do this

Thanks a lot for your supports
Luc
Re: Switch between disks in a diskgroup [message #521586 is a reply to message #521581] Wed, 31 August 2011 06:20 Go to previous messageGo to next message
luc_tran
Messages: 31
Registered: October 2010
Location: Viet Nam
Member

Hi forum admins, please help me delete my duplicated posts as the posting topic page didn't refresh while the article actually posted. Sorry for the inconvenience.

Thanks
Re: Switch between disks in a diskgroup [message #521591 is a reply to message #521581] Wed, 31 August 2011 06:57 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Nothing exotic here.
You just add the new disk to FRA.
alter diskgroup FRA add .. 

ASM will automatically "copy" the data to new disk (actually distributes across all available disks in diskgroup).
Check the status. Could take a while depending on rebalance power and load.
Beware that the "add /drop disk" will immediately return to prompt
but will continue to work in background.
Use ASM command
alter diskgroup FRA drop disk ...


wait, check status and You can drop the Old disk/LUN once the operation is completed.

[Updated on: Wed, 31 August 2011 07:22]

Report message to a moderator

Re: Switch between disks in a diskgroup [message #521592 is a reply to message #521581] Wed, 31 August 2011 07:11 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Here is a sample session.
-- A simple sql to get the status of operations
-- and
-- list the presented disks.
-- the ones that are not used by asm are named CANDIDATE
--
SQL> get asm
  1  set linesize 1000
  2   SELECT group_number, operation, state, power, est_minutes FROM v$asm_operation;
  3  col disk_group_name format a20
  4  col disk_file_path format a60
  5  col disk_file_name format a20
  6  col disk_file_fail_group format a25
  7  SELECT
  8          NVL(a.name, '[CANDIDATE]')      disk_group_name
  9        , b.path                          disk_file_path
 10        , b.name                          disk_file_name
 11        , b.failgroup                     disk_file_fail_group
 12        , b.total_mb                 
 13      FROM
 14          v$asm_diskgroup a RIGHT OUTER JOIN v$asm_disk b USING (group_number)
 15      ORDER BY
 16*         a.name;
 17  
SQL> @asm

no rows selected


DISK_GROUP_NAME      DISK_FILE_PATH                                               DISK_FILE_NAME       DISK_FILE_FAIL_GROUP        TOTAL_MB
-------------------- ------------------------------------------------------------ -------------------- ------------------------- ----------
BAILOUT              /dev/rdsk/c4t000B080010002578d0s1                            BAILOUT_0000         BAILOUT_0000                   99212
FRA                  /dev/rdsk/c4t000B080008002578d0s1                            FRA_0000             FRA_0000                       99212
[CANDIDATE]          /dev/rdsk/c4t000B080006002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080012002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080007002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080009002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080011002578d0s1                                                                                    0

7 rows selected.

-- No operations going on 
-- add the disk

SQL> alter diskgroup FRA add disk '/dev/rdsk/c4t000B080006002578d0s1' rebalance power 11;

Diskgroup altered.

--
-- Check the status and wait. Do it until you see "no rows returned" for the operations.
--
SQL> @asm

GROUP_NUMBER OPERA STAT      POWER EST_MINUTES
------------ ----- ---- ---------- -----------
           1 REBAL RUN          11           0


DISK_GROUP_NAME      DISK_FILE_PATH                                               DISK_FILE_NAME       DISK_FILE_FAIL_GROUP        TOTAL_MB
-------------------- ------------------------------------------------------------ -------------------- ------------------------- ----------
BAILOUT              /dev/rdsk/c4t000B080010002578d0s1                            BAILOUT_0000         BAILOUT_0000                   99212
FRA                  /dev/rdsk/c4t000B080006002578d0s1                            FRA_0001             FRA_0001                       49596
FRA                  /dev/rdsk/c4t000B080008002578d0s1                            FRA_0000             FRA_0000                       99212
[CANDIDATE]          /dev/rdsk/c4t000B080011002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080007002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080009002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080012002578d0s1                                                                                    0

7 rows selected.

SQL> @asm

GROUP_NUMBER OPERA STAT      POWER EST_MINUTES
------------ ----- ---- ---------- -----------
           1 REBAL RUN          11           0


DISK_GROUP_NAME      DISK_FILE_PATH                                               DISK_FILE_NAME       DISK_FILE_FAIL_GROUP        TOTAL_MB
-------------------- ------------------------------------------------------------ -------------------- ------------------------- ----------
BAILOUT              /dev/rdsk/c4t000B080010002578d0s1                            BAILOUT_0000         BAILOUT_0000                   99212
FRA                  /dev/rdsk/c4t000B080006002578d0s1                            FRA_0001             FRA_0001                       49596
FRA                  /dev/rdsk/c4t000B080008002578d0s1                            FRA_0000             FRA_0000                       99212
[CANDIDATE]          /dev/rdsk/c4t000B080011002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080007002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080009002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080012002578d0s1                                                                                    0

7 rows selected.

SQL> @asm

no rows selected


DISK_GROUP_NAME      DISK_FILE_PATH                                               DISK_FILE_NAME       DISK_FILE_FAIL_GROUP        TOTAL_MB
-------------------- ------------------------------------------------------------ -------------------- ------------------------- ----------
BAILOUT              /dev/rdsk/c4t000B080010002578d0s1                            BAILOUT_0000         BAILOUT_0000                   99212
FRA                  /dev/rdsk/c4t000B080006002578d0s1                            FRA_0001             FRA_0001                       49596
FRA                  /dev/rdsk/c4t000B080008002578d0s1                            FRA_0000             FRA_0000                       99212
[CANDIDATE]          /dev/rdsk/c4t000B080011002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080007002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080009002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080012002578d0s1                                                                                    0

7 rows selected.


--
-- Disk is been added. Status all set.
-- Now drop. Check satus and then unpresent the unwanted disk in OS.
--
SQL> alter diskgroup FRA  drop disk FRA_0000 rebalance power 11;

Diskgroup altered.

SQL> @asm

no rows selected


DISK_GROUP_NAME      DISK_FILE_PATH                                               DISK_FILE_NAME       DISK_FILE_FAIL_GROUP        TOTAL_MB
-------------------- ------------------------------------------------------------ -------------------- ------------------------- ----------
BAILOUT              /dev/rdsk/c4t000B080010002578d0s1                            BAILOUT_0000         BAILOUT_0000                   99212
FRA                  /dev/rdsk/c4t000B080006002578d0s1                            FRA_0001             FRA_0001                       49596
[CANDIDATE]          /dev/rdsk/c4t000B080008002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080012002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080007002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080009002578d0s1                                                                                    0
[CANDIDATE]          /dev/rdsk/c4t000B080011002578d0s1                                                                                    0

7 rows selected.

[Updated on: Wed, 31 August 2011 07:11]

Report message to a moderator

Re: Switch between disks in a diskgroup [message #521596 is a reply to message #521592] Wed, 31 August 2011 08:42 Go to previous messageGo to next message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
You can add and drop the discs in one command:
alter diskgroup fra add disk 'newdisc' drop disk 'olddisc';

it saves a lot of time, because only one rebalance operation, not two.
[update: typo]

[Updated on: Wed, 31 August 2011 08:43]

Report message to a moderator

Re: Switch between disks in a diskgroup [message #521690 is a reply to message #521596] Thu, 01 September 2011 02:22 Go to previous message
luc_tran
Messages: 31
Registered: October 2010
Location: Viet Nam
Member

Thank you all for the solution, works perfectly
Previous Topic: create package + function... (2 Merged)
Next Topic: How to find non-indexed queries and columns that require indexes
Goto Forum:
  


Current Time: Thu May 02 08:45:20 CDT 2024