Tag Archives: RAC

Move Oracle RAC database into Archive log mode

Moving Oracle RAC databases into and out of archive log mode requires a few more steps due to the existence of multiple instances. This procedure covers the steps required to move a non-archive log mode database into archive log mode.

1. Logon to Oracle node1 server as the oracle software owner.

2. Validate the current archive log mode of the database, by logging onto the database and issuing the [archive log list] command.


[oracle@mylinux1 ~]$ export ORACLE_SID=orcl1
[oracle@mylinux1 ~]$ sqlplus ‘/ as sysdba’

SQL*Plus: Release 11.2.0.1.0 Production on Thu Jan 20 22:57:07 2011

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /u05/oradata/orcl/archive
Oldest online log sequence 66
Current log sequence 68

3. Move the node out of cluster mode by changing the parameter cluster_database equal to false and exit.

SQL> alter system set cluster_database=false scope=spfile;

System altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
[oracle@mylinux1 ~]$

4. Stop the clustered database with srvctl utility.

[oracle@mylinux1 ~]$ srvctl stop database -d orcl

5. Logon to sqlplus on node1 and startup the instance in single instance mode with mount option.

[oracle@mylinux1 ~]$ sqlplus ‘/ as sysdba’

SQL*Plus: Release 11.2.0.1.0 Production on Thu Jan 20 22:59:08 2011

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area 367476736 bytes
Fixed Size 2213376 bytes
Variable Size 293603840 bytes
Database Buffers 67108864 bytes
Redo Buffers 4550656 bytes
Database mounted.
SQL>

6. Alter the database to archive log mode.

SQL> alter database archivelog;

Database altered.

SQL>

7. Change the parameter cluster_database back to true, shutdown the instance, and exit.

SQL> alter system set cluster_database=true scope=spfile;

System altered.

SQL> shutdown immediate
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
SQL>

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

8. Use the srvctl utility to startup the clustered database.

[oracle@mylinux1 ~]$ srvctl start database -d orcl

9. Logon to sqlplus on node1 and check the archive log mode with the command [archive log list].

[oracle@mylinux1 ~]$ sqlplus ‘/ as sysdba’

SQL*Plus: Release 11.2.0.1.0 Production on Thu Jan 20 23:01:22 2011

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u05/oradata/orcl/archive
Oldest online log sequence 66
Next log sequence to archive 68
Current log sequence 68
SQL>

This completes moving an Oracle RAC database into archive log mode.

Larry J. Catt, OCP
oracle@allcompute.com
www.allcompute.com

SSH, PING, and RSH – Permissions causing failure on Oracle RAC Installation

Oracle RAC requires permissions to networking components which are typically restricted on most systems. Most notable are permissions to utilities SSH, PING, and RSH. If you are attempting to install Oracle RAC software and you are receiving failures in communications; check the permissions of these utilities for a possible cause.

1. Logon to your Linux server as root.

2. Change the permissions on the following files to u+s.

chmod u+s /bin/ping
chmod u+s /usr/bin/ssh
chmod u+s /usr/bin/rsh

This completes allowing Oracle permissions to SSH, PING, and RSH for RAC configurations.
Larry J. Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

Removing Oracle 10g RAC components from LINUX server

The following procedure is used to remove all RAC components created during the clusterware and RDBMS installation of 10g from a Linux server. NOTE: Once executed, Clusterware will not be usable.

1. Logon to the server as root.

2. Run the following command from any location on your server to remove all Oracle 10g RAC components from your OS layer. Note: RAC will not be useable on the system once executed.

rm -rf /etc/oracle
rm -rf /etc/oraInst.loc
rm -rf /etc/oratab
rm -rf /etc/init.d/*crs*
rm -rf /etc/init.d/init.cssd
rm -rf /etc/init.d/init.evmd
rm -rf /etc/rc*/*crs*
rm -rf /etc/*crs*
rm -rf /tmp/Ora*
rm -rf /tmp/.oracle


Larry J. Catt
oracle@allcompute.com
www.allcompute.com

Formatting of OCFS2 Shared Storage

The Oracle OCFS2 file system can be used to format shared storage for multiple node access. To accomplish this task, OCFS2 rpm must be installed and configured. Below is the procedure for preparing the shared disks for use, once OCFS2 has been installed and configured.

1. Logon to one of your Oracle servers as the root user.

2. Locate the shared storage presented in the directory /dev/mapper on both nodes.

-mylinux1
[root@mylinux1 ~]# ll /dev/mapper
total 0
crw——- 1 root root 10, 63 Jan 22 17:44 control
brw-rw—- 1 root disk 253, 3 Jan 22 17:45 DATA-50GB-02
brw-rw—- 1 root disk 253, 8 Jan 22 17:45 DATA-50GB-03
brw-rw—- 1 root disk 253, 1 Jan 22 17:45 VOTE-1GB-05
brw-rw—- 1 root disk 253, 2 Jan 22 17:45 VOTE-1GB-06
brw-rw—- 1 root disk 253, 4 Jan 22 17:45 HOME-50GB-02
[root@mylinux1 ~]#

-mylinux2
[root@mylinux2 ~]# ll /dev/mapper
total 0
crw——- 1 root root 10, 63 Jan 22 17:44 control
brw-rw—- 1 root disk 253, 3 Jan 22 17:45 DATA-50GB-02
brw-rw—- 1 root disk 253, 8 Jan 22 17:45 DATA-50GB-03
brw-rw—- 1 root disk 253, 1 Jan 22 17:45 VOTE-1GB-05
brw-rw—- 1 root disk 253, 2 Jan 22 17:45 VOTE-1GB-06
brw-rw—- 1 root disk 253, 4 Jan 22 17:45 HOME-50GB-03
[root@mylinux2 ~]#

3. The shared storage will be mounted on each node of the RAC. In this example our shared storage includes the following:


/dev/mapper/DATA-50GB-02
/dev/mapper/DATA-50GB-03
/dev/mapper/VOTE-1GB-05
/dev/mapper/VOTE-1GB-06

4. As the root user, format each shared storage device with the following command: NOTE: formatting of the share disks is only performed on a single node, repeating on additional nodes will destroy all information.

Example:

/sbin/mkfs.ocfs2 /dev/mapper/DATA-50GB-02

[root@mylinux1 ~]# /sbin/mkfs.ocfs2 /dev/mapper/DATA-50GB-02
mkfs.ocfs2 1.4.4
Cluster stack: classic o2cb
Overwriting existing ocfs2 partition.
Proceed (y/N): y
Label:
Features: sparse backup-super unwritten inline-data strict-journal-super
Block size: 2048 (11 bits)
Cluster size: 4096 (12 bits)
Volume size: 1069252608 (261048 clusters) (522096 blocks)
Cluster groups: 17 (tail covers 7096 clusters, rest cover 15872 clusters)
Extent allocator size: 4194304 (1 groups)
Journal size: 33554432
Node slots: 2
Creating bitmaps: done
Initializing superblock: done
Writing system files: done
Writing superblock: done
Writing backup superblock: 0 block(s)
Formatting Journals: done
Growing extent allocator: done
Formatting slot map: done
Writing lost+found: done
mkfs.ocfs2 successful

[root@mylinux1 ~]#

This procedure is repeated for each shared storage device.

Larry J. Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

Creation of Oracle OS accounts for 11g RAC install on Linux

Deployment of Oracle software requires the creation of multiple groups and users on UNIX and Linux servers to properly configure and administrate. This procedure covers the basic creation of Oracle groups and users for a standard 11g RAC implementation.

1. Create group accounts on all nodes: NOTE: id must be exactly the same

/usr/sbin/groupadd -g 501 oinstall
/usr/sbin/groupadd -g 502 dba
/usr/sbin/groupadd -g 504 asmadmin
/usr/sbin/groupadd -g 506 asmdba
/usr/sbin/groupadd -g 507 asmoper

2. Create user accounts on all nodes: NOTE: id must be exactly the same

/usr/sbin/useradd -u 501 -g oinstall -G asmadmin,asmdba,asmoper grid
/usr/sbin/useradd -u 502 -g oinstall -G dba,asmdba oracle

3. Set password for GRID and ORACLE account to be the same on every node.

passwd oracle
Changing password for user oracle.
New UNIX password: password
retype new UNIX password: password
passwd: all authentication tokens updated successfully.
passwd grid
Changing password for user oracle.
New UNIX password: password
retype new UNIX password: password
passwd: all authentication tokens updated successfully.

This completes the standard configuration creation of Oracle groups and users on Linux.

Larry Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

Change hostname of your Linux server

Oracle RAC depends heavily on the network, hostnames, and DNS service within a network. In this article we will show how to change the hostname of a LINUX server for the use of Oracle RAC to include the domain name.
1. Logon to your LINUX server as the root user.
2. Open the file /etc/sysconfig/network.
3. Update the parameter HOSTNAME to include the domain name.
[root@mylinux1 ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=mylinux1.mydomain.com

[root@mylinux1 ~]#

4. Reboot the server.
5. Issue the command hostname and you will see it is updated.
[root@mylinux1 ~]# hostname
mylinux1.mydomain.com
[root@mylinux1 ~]#

This completes changing the hostname of a LINUX server for Oracle RAC.

Larry J. Catt, OCP9i, 10g
oracle@allcompute.com
www.allcompute.com

Oracle Installation – Add swap space in UNIX or Linux environment

The typical Oracle installation will require more swap space on a system, due to prerequisite checks performed by the installer, than is typical available. The following procedure shows how to create additional swap in Unix or Linux.

1. Create a file on /u01 of 12gb with the dd command. NOTE: Repeat on each RAC node.

dd if=/dev/zero of=/u01/tempswap bs=1k count=12000000

Example:

[root@mylinux1 ~]# dd if=/dev/zero of=/u01/tempswap bs=1k count=12000000
12000000+0 records in
12000000+0 records out
12384000000 bytes (12 GB) copied, 64.2111 seconds, 255 MB/s
[root@mylinux1 ~]#

2. Then format your new file with the mke2fs command. NOTE: Repeat on each RAC node.

/sbin/mke2fs /u01/tempswap

Example:

[root@mylinux1 ~]# /sbin/mke2fs /u01/tempswap
mke2fs 1.39 (29-May-2006)
/u01/tempswap is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2003424 inodes, 4000000 blocks
200000 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4097835008
123 block groups
32768 blocks per group, 32768 fragments per group
12288 inodes per group
Superblock backups stored on blocks:
32768, 98304, 123840, 229376, 294912, 819200, 884736, 1205632, 2654208

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@mylinux1 ~]#

3. Make the additional swap space with the mkswap command. NOTE: Repeat on each RAC node.

/sbin/mkswap /u01/tempswap

Example:

[root@mylinux1 ~]# /sbin/mkswap /u01/tempswap
Setting up swapspace version 1, size = 12383995 kB
[root@mylinux1 ~]#

4. Make the swap space available to the OS with the command swapon. NOTE: This will have to be executed after every reboot. Repeat on each RAC node.

/sbin/swapon /u01/tempswap

Example:

[root@mylinux1 ~]# /sbin/swapon /u01/tempswap
[root@mylinux1 ~]#

Larry J. Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

Unable to mount OCFS2 drives

Oracle provides the file system OCFS2 to support Oracle RAC file storage. This file system provides for a locking mechanism which allows files to be accessed by multiple Oracle instances while avoiding corruption. The OSFS2 file system binaries must be started before any OCFS2 formatted mount points can be accessed. This article shows the error generated when the OCFS2 stack has not been started and how to resolve the problem.

General OS error:

[root@mylinux init.d]# mount /dev/mapper/MPATH10 /u02
mount.ocfs2: Unable to access cluster service while trying initialize cluster

Resolution:

1. Logon to your server as root.
2. Change directory to /etc/init.d

[root@mylinux /]# cd /etc/init.d
[root@mylinux init.d]# pwd
/etc/init.d
[root@mylinux init.d]#

3. Execute the OS layer command ./ocfs2 load.

[root@mylinux init.d]# ./o2cb load
Loading filesystem “configfs”: OK
Mounting configfs filesystem at /sys/kernel/config: OK
Loading filesystem “ocfs2_dlmfs”: OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
[root@mylinux init.d]#

4. Execute the OS layer command ./ocfs2 online

[root@mylinux init.d]# ./o2cb online
Starting O2CB cluster ocfs2: OK
[root@mylinux init.d]#

5. Attempt to mount your ocfs2 storage device.

[root@mylinux init.d]# mount /dev/mapper/MPATH10 /u02
[root@mylinux init.d]#

6. This completes restarting OCFS2 binaries.

Larry J. Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

Disabling Oracle RDBMS RAC features

The determination of Oracle binary support for Real Application Clustering is made during installation on all supported platforms. Thus an installation made for a RAC database install will result in errors for single database instances. However, you can modify the binaries to support single instance database features after installation. This article details the steps to modify your Oracle binaries to support Oracle single instance database.

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directory to your ORACLE_HOME/rdbms/lib.

cd $ORACLE_HOME/rdbms/lib

3. Use make to recreate your Oracle binaries with the option rac_off

make -f ins_rdbms.mk rac_off

4. Change directory to your ORACLE_HOME/bin.

5. Execute the utility relink with option all, to recreate all binary files.

relink all

6. This completes altering your Oracle RDBMS binaries to support Oracle RAC features.

Larry J. Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

Enabling Oracle RDBMS RAC features

The determination of Oracle binary support for Real Application Clustering is made during installation on all supported platforms. Thus, an installation made for a single instance database will not support creation of RAC by default. However, you can modify the binaries to support these features after installation. This article details the steps to modify your Oracle binaries to support Oracle RAC.

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directory to your ORACLE_HOME/rdbms/lib.

cd $ORACLE_HOME/rdbms/lib

3. Use make to recreate your Oracle binaries with the option rac_on

make -f ins_rdbms.mk rac_on

4. Change directory to your ORACLE_HOME/bin.

5. Execute the utility relink with option all, to recreate all binary files.

relink all

6. This completes altering your Oracle RDBMS binaries to support Oracle RAC features.

Larry J. Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com