1. Add Disk to ASM Disk Group
List the raw disk from /dev and select the character devices.
ls -l /dev/*asmlv023*
crw-rw—- 1 oracle dba 37, 25 Jun 07 11:35 rasmlv023
brw-rw—- 1 oracle dba 37, 25 Jun 07 11:35 asmlv023

Export the ORACLE_SID variable to +ASM

$export ORACLE_SID=+ASM
SQL> ALTER DISKGROUP DKGRP1 ADD DISK ‘/dev/rasmlv023’;
Diskgroup altered.
SQL>
SQL> select NAME,TOTAL_MB,FREE_MB from v$asm_diskgroup;
NAME TOTAL_MB FREE_MB
—————————— ———- ———- DKGRP1 1633280 108509
DKGRP2 409600 133458
DKGRP3 307200 182711
SQL>
IF 11G Release 2
/ as sysasm
SQL*Plus: Release 11.2.0.1.0 Production on Fri Nov 8 17:50:27 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Enter user-name: / as sysasm
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Automatic Storage Management option
SQL> ALTER DISKGROUP DATA ADD DISK ‘/dev/rhdisk9’;
Diskgroup altered.
SQL>

2. Get Size of ASM Disk
Use this to check for remaining space on disk on ASM Disk
select NAME,TOTAL_MB,FREE_MB from v$asm_diskgroup;
SQL> select NAME,TOTAL_MB,FREE_MB from v$asm_diskgroup;
NAME TOTAL_MB FREE_MB
—————————— ———- ———-
FLASH_RECOVERY_AREA 409594 247053
XMAN_DATA 409594 271648
SQL>

3. Performing Incremental backups with Rman
Oracle Recovery Manager (RMAN) is an Oracle tool for backing up and restoring your oracle Database. It can backup the entire database or part of it e.g a single datafile. It can also backup the archive logs, control files and the spfile. Rman can also be used to restore corrupt blocks in your database. Here are scripts to perform Incremental backups with rman. We will assume you already configured the backup location. We will perform a full backup on Sunday and incrementals throughout the week. Once the backup is done rman will delete the archive logs from your flash recovery area. Use the following 3 scripts:

backup.sh:

######################### ############## #######
# Script to perform full database backup including archivelogs #
# Backup sets copied to /streams/rman #
# Version 1.0 By Stephen Ochieng (xogutu@gmail.com) #
# Provided under GNU GPL #
###############################################

#!/bin/bash
getday=$(date +”%a”)
echo $getday
# rest of script
if [ “$getday” == “Sun” ]
then
clear
echo “@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ”
echo ” ”
echo “Today is `date` therefore starting Full Backup…”
echo ” ”
echo “@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ”
sh /streams/script/full.sh
else
clear
echo “@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ”
echo ” ”
echo “Today is `date` therefore starting Incremental Backup…”
echo ” ”
echo “@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ”
sh /streams/script/incremental.sh
fi

full.sh:

######################### ############## #######
# Script to perform full database backup including archivelogs #
# Backup sets copied to /streams/rman #
# Version 1.0 By Stephen Ochieng (xogutu@gmail.com) #
# Provided under GNU GPL #
###############################################

#!/bin/bash
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/10.2.0
ORACLE_SID=xman
PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
export ORACLE_BASE ORACLE_HOME PATH ORACLE_SID
rman target=/ << EOF
RUN {
crosscheck backup;
DELETE NOPROMPT EXPIRED BACKUP;
crosscheck archivelog all;
delete NOPROMPT obsolete ;
backup incremental level 0 database plus archivelog delete all input;
}
EXIT;
EOF

incremental.sh:

######################### ############## #######
# Script to perform incremental backup including archivelogs #
# Backup sets copied to /streams/rman #
# Version 1.0 By Stephen Ochieng (xogutu@gmail.com) #
# Provided under GNU GPL #
###############################################

#!/bin/bash
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/10.2.0
ORACLE_SID=xman
PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
export ORACLE_BASE ORACLE_HOME PATH ORACLE_SID
rman target=/ << EOF
RUN {
crosscheck backup;
DELETE NOPROMPT EXPIRED BACKUP;
crosscheck archivelog all;
delete NOPROMPT obsolete ;
backup incremental level 1 database plus archivelog delete all input;
}
EXIT;
EOF

Change the script paths and environmental variables to suit your needs.

4. ORA-29701: unable to connect to Cluster Synchronization Service
Login as grid user and execute:
$ crsctl start res ora.cssd


5. Creating ASM on RedHat Enterprise 6 with UDEV
These steps are originally from https://oracle-base.com/articles/linux/udev-scsi-rules-configuration-in-oracle-linux
Step 1:
Check for the SCSI ID of the disk e.g
[root@corebanking1 ~]# /sbin/scsi_id -g -u -d /dev/sdb
1ATA_VBOX_HARDDISK_VB1fb73756-09c38baf
[root@corebanking1 ~]#

Explanation of options
-g, --whitelisted
Treat the device as white listed. The --whitelisted option must be specified on the command line or in the scsi_id configuration file for scsi_id to generate any output.
-u, --replace-whitespace
Reformat the output : replace all whitespaces by underscores.
-d, --device=device
Send SG_IO commands to device, such as /dev/sdc.

Step 2: Make SCSI Devices Trusted
Add the line below to your /etc/scsi_id.config
options=-g

Step 3: Create the udev rules file "/etc/udev/rules.d/99-oracle-asmdevices.rules" and add the line below for each device you want to use
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB1fb73756-09c38baf", NAME="asm-disk1", OWNER="oragrid", GROUP="dba", MODE="0660"
Step 4:
Load updated block device partition tables. # /sbin/partprobe /dev/sdb1

Step 5:
Restart UDEV Service
# udevadm control --reload-rules

Step 6:
Check Ownership and Permissions
[root@corebanking1 ~]# cd /dev
[root@corebanking1 dev]# ls -l *asm*
brw-rw----. 1 oragrid dba 8, 33 Feb 24 16:20 asm-disk1
brw-rw----. 1 oragrid dba 8, 49 Feb 24 16:20 asm-disk2
[root@corebanking1 dev]#


6. Unable to start ASM after running root.sh on RedHat Enterprise 6 after installing Oracle Grid 11.2.0.1
You will get the error:
Adding daemon to inittab
CRS-4124: Oracle High Availability Services startup failed.
CRS-4000: Command Start failed, or completed with errors.
ohasd failed to start: Inappropriate ioctl for device
Get answer from https://community.oracle.com/thread/2410090?tstart=0 by user Anand
Problem is indeed because of upstart/init incompatibility. Here is the working way:
1) Proceed with the installation as usual until root.sh invocation.
2) Before root.sh edit $GRID_HOME/crs/install/s_crsconfig_lib.pm, go to line 1173 (you should find a code like: if ($srv eq "ohasd") { # Start OHASD).
3) Insert a following snippet before starting OHASD part (line 1173)

my $UPSTART_OHASD_SERVICE = "oracle-ohasd";
my $INITCTL = "/sbin/initctl";

($status, @output) = system_cmd_capture ("$INITCTL start $UPSTART_OHASD_SERVICE");
if (0 != $status)
{
error ("Failed to start $UPSTART_OHASD_SERVICE, error: $!");
return $FAILED;
}

4) Create a file /etc/init/oracle-ohasd.conf with the following content inside

# Oracle OHASD startup

start on runlevel [35]
stop on runlevel [!35]
respawn
exec /etc/init.d/init.ohasd run >/dev/null 2>&1
5) Invoke root.sh
6) Finish the installation.

If you previously ran root.sh (not successfully), simply roll it back:
$GRID_HOME/crs/install/roothas.pl -deconfig -force -verbose
Make changes above and continue.




7. Hidden Parameters
Oracle has some hidden parameters that are not documented or supported e.g
_allow_resetlogs_corruption = true
If all fails, you can use it to open your database, at your own RISK!


(C) 2016 ,Ogutu.org. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Red Hat, Red Hat Enterprise Linux, the Shadowman logo and JBoss are registered trademarks of Red Hat, Inc in the U.S. and other countries. Other names may be trademarks of their respective owners.