Tuesday, 10 January 2017

ASM

Initialization Parameters and ASM Instance Creation
INSTANCE_TYPE - set to ASM
DB_UNIQUE_NAME - set to +ASM
ASM_POWER_LIMIT - set rebalancing from (0..11)
ASM_DISKGROUPS - list of disk groups to mount
ASM_DISKSTRING - disks considered for discovery


ASM Start/Stop:
export ORACLE_SID=+ASM
sqlplus / as sysdba
startup;
shutdown immediate;

Adding diskgroups:
create diskgroup <DiskGroupName> external redundancy disk '<DISK Name>';
CREATE DISKGROUP disk_group_1 NORMAL REDUNDANCY
  FAILGROUP failure_group_1 DISK
    '/devices/diska1' NAME diska1,
    '/devices/diska2' NAME diska2
  FAILGROUP failure_group_2 DISK
    '/devices/diskb1' NAME diskb1,
    '/devices/diskb2' NAME diskb2;

CREATE DISKGROUP disk_group_1 HIGH REDUNDANCY
  FAILGROUP failure_group_1 DISK
    '/devices/diska1' NAME diska1,
    '/devices/diska2' NAME diska2
  FAILGROUP failure_group_2 DISK
    '/devices/diskb1' NAME diskb1,
    '/devices/diskb2' NAME diskb2;
  FAILGROUP failure_group_3 DISK
    '/devices/diskc1' NAME diskc1,
    '/devices/diskc2' NAME diskc2;

CREATE DISKGROUP disk_group_1 EXTERNAL REDUNDANCY
   DISK '/devices/diska1' NAME diska1,
        '/devices/diska2' NAME diska2;

Recreate diskgroup:
dd if=/dev/zero of=/dev/rdsk/c1t4d0s4 bs=8192 count=12800
create diskgroup orag2 external redundancy disk 'ORCL:VOL5';

Rebalancing:
ALTER DISKGROUP data REBALANCE POWER 11 WAIT;

Convert a database to ASM:
Parameter change
alter system set DB_CREATE_FILE_DEST = '+DATA',
                 DB_RECOVERY_FILE_DEST_SIZE = 17G,
                 DB_RECOVERY_FILE_DEST = '+RECOVER',
                 CONTROL_FILES = '+DATA';

Restore controlfile
rman connect target /
STARTUP NOMOUNT;
RESTORE CONTROLFILE FROM 'old_control_file_name';

Restore datafiles
ALTER DATABASE MOUNT;
CONFIGURE DEVICE TYPE DISK PARALLELISM 8;
BACKUP AS COPY DATABASE FORMAT '+DATA';
SWITCH DATABASE TO COPY;
ALTER DATABASE OPEN;


Convert temp, spfile and redo file
alter tablespace temp add tempfile;
alter database tempfile '...' DROP;
CREATE SPFILE '+DATA' FROM PFILE;
ALTER DATABASE DROP LOGFILE GROUP 1;
ALTER DATABASE ADD LOGFILE GROUP 1 SIZE 100M;

No comments:

Post a Comment