My Blog

September 25, 2008

Add new diskgroup in oracle rac

Filed under: Oracle — by enotebook @ 8:56 am

Host information – Linux & Oracle
$ uname -a
Linux rac1.andy.com 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux
SQL> select * from v$version;
BANNER
—————————————————————-
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Prod
PL/SQL Release 10.2.0.1.0 – Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 – Production
NLSRTL Version 10.2.0.1.0 – Production
SQL>

Use sqlplus to connect ASM instance on node1(rac1). Check the value of instance_type to make sure it’s connecting to ASM instance
$ export ORACLE_SID=+ASM1
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 – Production on Wed Sep 24 16:03:19 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> show parameter instance_type;
NAME TYPE VALUE
———————————— ———– ——————————
instance_type string asm
SQL>

Check the raw devices to determine if they have been detected.
SQL> select path from v$asm_disk;
PATH
——————————————————————————–
/dev/raw/raw5 # detected – this is the newly bounded raw device
/dev/raw/raw4
/dev/raw/raw3
/dev/raw/raw2
4 rows selected.
If there is no newly bounded raw devices detected, try to modify the value of parameter – asm_diskstring, and re-check
SQL> show parameter asm_diskstring
NAME TYPE VALUE
———————————— ———– ——————————
asm_diskstring string
SQL> alter system set asm_diskstring=’/dev/raw/raw*’;
System altered.

Issue the command to create diskgroup
SQL> create diskgroup DG2 external redundancy disk ‘/dev/raw/raw5’;
Diskgroup created.
SQL> select group_number,name,state,total_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
———— —————————— ———– ———-
1 DG1 MOUNTED 6134
2 RECOVERYDEST MOUNTED 2047
3 DG2 MOUNTED 3067
SQL>

Diskgroup mounted automatically on this node, but not mounted on node2, need to mount it manually.
$ ssh rac2
Last login: Wed Sep 24 16:00:05 2008 from rac1.andy.com
$ export ORACLE_SID=+ASM2
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 – Production on Wed Sep 24 17:08:31 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SQL> select group_number,name,state,total_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
———— —————————— ———– ———-
1 DG1 MOUNTED 6134
2 RECOVERYDEST MOUNTED 2047
0 DG2 DISMOUNTED 0
SQL> alter diskgroup DG2 mount;
Diskgroup altered.
SQL> select group_number,name,state,total_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
———— —————————— ———– ———-
1 DG1 MOUNTED 6134
2 RECOVERYDEST MOUNTED 2047
3 DG2 MOUNTED 3067
SQL>
Create tablespace.
SQL> create tablespace test datafile ‘+DG2/test.dbf’ size 10M;
Tablespace created.

Done.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: