Tag Archives: asm

Changing attributes on ASM Diskgroups

You can see the attributes set on your ASM diskgroups in 2 ways, via the view  v$asm_attribute

SQL> select a.name, b.name, b.value from v$asm_attribute b, v$asm_diskgroup a where a.group_number=b.group_number and a.name='DATAX6C1' ;

Or via asmcmd and the lsattr

grid@sc7ach00pd00-d1:~$ asmcmd

ASMCMD> cd DATAX6C1
ASMCMD> lsattr -G DATAXC1 -l

Attributes you might want to pay attention to in an Exadata environment are

  • compatible.advm
  • cell.smart_scan_capable
  • appliance.mode
  • compatible.asm
  • compatible.rdbms

If you manually create a diskgroup via asmca these attributes will not normally be set, and so you may want to go manually set them.

SQL> ALTER DISKGROUP DATAX6C1 SET ATTRIBUTE 'appliance.mode'='TRUE';

The attribute is set immediately, but based on my experience, it does not come into effect until the disk group has  been rebalanced.

SQL> alter diskgroup DATAX6C1 rebalance power 2;
Advertisements

Moving a datafile from filesystem to ASM

I had a database where someone had created a datafile outside of ASM and on the Oracle Home filesystem. Whilst this would not cause a problem for backups as they are done via RMAN and it knows where all the files are thanks to the control file, it will have performance implications as my ASM area is on Exadata cells, and the Oracle Home filesystem is on an internal disk.

The method I am going to describe assumes that you can take the tablespace offline to carry out the maintenance.

 

Find out the filename name of your mis-located datafile

SQL> select tablespace_name, file_name from dba_data_files where file_name not like '%DATA%';
TABLESPACE_NAME
------------------------------
FILE_NAME
--------------------------------------------------------------------------------
CMPIND_XX
/u01/app/oracle/product/11.2.0.3/dbhome_1/dbs/.ora

 

Alter the affected tablespace offline so no changes will be made to the datafile while we move it.


SQL> alter tablespace cmpind_xx offline;

 

Use RMAN to copy the file (in bold below).

oracle@mydbhost:~/mel$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Tue Apr 1 08:11:53 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: mydb (DBID=3455727309)
RMAN> copy datafile '/u01/app/oracle/product/11.2.0.3/dbhome_1/dbs/.ora' to '+DATA_EXPA';
Starting backup at 01-APR-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=856 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=916 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00172 name=/u01/app/oracle/product/11.2.0.3/dbhome_1/dbs/.ora
output file name=+DATA_EXPA/mydb/datafile/cmpind_xx.657.843725535 tag=TAG20140401T081214 RECID=511 STAMP=843725535
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 01-APR-14
Starting Control File and SPFILE Autobackup at 01-APR-14
piece handle=/stage/rman/12Mar14/c-3455727309-20140401-00 comment=NONE
Finished Control File and SPFILE Autobackup at 01-APR-14

Next step is to rename the datafile from the original name to the new OMF name that was generated during the RMAN copy (highlighted in red above) and bring the tablespace back online.

oracle@mydbhost:~/mel$ sqlplus '/ as sysdba'
SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 1 08:12:46 2014
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> alter database rename file '/u01/app/oracle/product/11.2.0.3/dbhome_1/dbs/.ora' to '+DATA_EXPA/mydb/datafile/cmpind_xx.657.843725535';
Database altered.
SQL> alter tablespace cmpind_xx online;
Tablespace altered.

 

 

Moving your voting disks

11gr2 provides some good facilities for moving voting disks. http://download.oracle.com/docs/cd/E11882_01/rac.112/e10717/votocr.htm#BGBBIGJH describes the various options for you.

root@c1718-3-50 # ./crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   23da5a8ec4fe4f7abf87392211a614ab (/dev/rdsk/c20t600A0B8000475BDC0000F5CA4C03684Cd0s6) [DATA1]
Located 1 voting disk(s)

I need to migrate the voting disks from disk group +DATA, which has external redundancy set, (hence only a single voting disk) to disk group +DATA1 which has normal redundancy

root@c1718-3-50 # ./crsctl replace votedisk +DATA1

That gives me the following voting disks…

root@c1718-3-50 # ./crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   23da5a8ec4fe4f7abf36197331a614ff (/dev/rdsk/c20t600A0B8000475BDC0000F5CA4C063B1Dd0s6) [DATA1]
 2. ONLINE   02e77b8b7af04f6dbfb0bd7af1604eee (/dev/rdsk/c20t600A0B8000475BDC0000F5CD4C063B2Fd0s6) [DATA1]
 3. ONLINE   21a6741b7d0e4fafbf7a81d22c177521 (/dev/rdsk/c20t600A0B8000475BDC0000F5D04C063B43d0s6) [DATA1]
Located 3 voting disk(s).