20 December 2010

Recovery of datafiles and controlfiles

Recovery from Loss of datafile without RMAN:

1. Rename datafile:

[root@rh4as-64 BTTEST1]# ls
control01.ctl example01.dbf redo02.log system01.dbf users02.dbf
control02.ctl mytemp_01.tmp redo03.log undotbs01.dbf
control03.ctl redo01.log sysaux01.dbf users01.dbf
[root@rh4as-64 BTTEST1]# mv users02.dbf users02.dbf_old
[root@rh4as-64 BTTEST1]# ls
control01.ctl example01.dbf redo02.log system01.dbf users02.dbf_old
control02.ctl mytemp_01.tmp redo03.log undotbs01.dbf
control03.ctl redo01.log sysaux01.dbf users01.dbf
[root@rh4as-64 BTTEST1]#


2. Startup database to find Oracle error during Mount stage:

sys@BTTEST1> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@BTTEST1> startup;
ORACLE instance started.

Total System Global Area 419430400 bytes
Fixed Size 1219784 bytes
Variable Size 230687544 bytes
Database Buffers 184549376 bytes
Redo Buffers 2973696 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/u02/app/oracle/oradata/BTTEST1/users02.dbf'


3. Plan for recovery—Make sure you have a Backup(COLD)

Restore the Datafile from your backup

[oracle@rh4as-64 ~]$ cd /u02/app/oracle/bkp_worman/BTTEST1
[oracle@rh4as-64 BTTEST1]$ ls
control01.ctl example01.dbf redo02.log system01.dbf users02.dbf
control02.ctl mytemp_01.tmp redo03.log undotbs01.dbf
control03.ctl redo01.log sysaux01.dbf users01.dbf
[oracle@rh4as-64 BTTEST1]$ cp users02.dbf /u02/app/oracle/oradata/BTTEST1/


4. Open Database

sys@BTTEST1> startup
ORACLE instance started.

Total System Global Area 419430400 bytes
Fixed Size 1219784 bytes
Variable Size 230687544 bytes
Database Buffers 184549376 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
sys@BTTEST1>



Recovery from Loss of Datafile(Database online) without RMAN:


1. sys@BTTEST1> select file_name, tablespace_name, status from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME STATUS
------------------------------ ---------
/u02/app/oracle/oradata/BTTEST1/system01.dbf
SYSTEM AVAILABLE

/u02/app/oracle/oradata/BTTEST1/undotbs01.dbf
UNDOTBS1 AVAILABLE

/u02/app/oracle/oradata/BTTEST1/sysaux01.dbf
SYSAUX AVAILABLE


FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME STATUS
------------------------------ ---------
/u02/app/oracle/oradata/BTTEST1/users01.dbf
USERS AVAILABLE

/u02/app/oracle/oradata/BTTEST1/example01.dbf
EXAMPLE AVAILABLE

/u02/app/oracle/oradata/BTTEST1/users02.dbf
USERS AVAILABLE


6 rows selected.

2. Take USERS tablespace offline

sys@BTTEST1> alter tablespace USERS offline;

Tablespace altered.


3. Copy datafile from backup location

4. Recover tablespace users and bring User tablespace online.

sys@BTTEST1> recover tablespace USERS;
Media recovery complete.
sys@BTTEST1> alter tablespace USERS online;

Tablespace altered.

sys@BTTEST1>

End of Recovery


Recovery from Loss of Datafile( When Database is closed and open during recovery) without RMAN:


1. Rename Datafile.

[oracle@rh4as-64 BTTEST1]$ mv users02.dbf users02.dbf_old
[oracle@rh4as-64 BTTEST1]$ ls
control01.ctl example01.dbf redo02.log system01.dbf users02.dbf_old
control02.ctl mytemp_01.tmp redo03.log undotbs01.dbf
control03.ctl redo01.log sysaux01.dbf users01.dbf
[oracle@rh4as-64 BTTEST1]$







2. Shutdown database and startup

SYS@BTTEST1> alter tablespace users offline;
alter tablespace users offline
*
ERROR at line 1:
ORA-01191: file 6 is already offline - cannot do a normal offline
ORA-01110: data file 6: '/u02/app/oracle/oradata/BTTEST1/users02.dbf'


SYS@BTTEST1> select name, status from v$datafile;

NAME
--------------------------------------------------------------------------------
STATUS
-------
/u02/app/oracle/oradata/BTTEST1/system01.dbf
SYSTEM

/u02/app/oracle/oradata/BTTEST1/undotbs01.dbf
ONLINE

/u02/app/oracle/oradata/BTTEST1/sysaux01.dbf
ONLINE


NAME
--------------------------------------------------------------------------------
STATUS
-------
/u02/app/oracle/oradata/BTTEST1/users01.dbf
RECOVER

/u02/app/oracle/oradata/BTTEST1/example01.dbf
ONLINE

/u02/app/oracle/oradata/BTTEST1/users02.dbf
RECOVER


6 rows selected.

SYS@BTTEST1>



3. Restore datafile users2

[oracle@rh4as-64 BTTEST1]$ cp users02.dbf /u02/app/oracle/oradata/BTTEST1/

4. Recover tablespace USERS.

SYS@BTTEST1> recover tablespace USERS;
Media recovery complete.
SYS@BTTEST1> alter tablespace USERS ONLINE;

Tablespace altered.


5. Check status


SYS@BTTEST1> select name, status from v$datafile;

NAME
--------------------------------------------------------------------------------
STATUS
-------
/u02/app/oracle/oradata/BTTEST1/system01.dbf
SYSTEM

/u02/app/oracle/oradata/BTTEST1/undotbs01.dbf
ONLINE

/u02/app/oracle/oradata/BTTEST1/sysaux01.dbf
ONLINE


NAME
--------------------------------------------------------------------------------
STATUS
-------
/u02/app/oracle/oradata/BTTEST1/users01.dbf
ONLINE

/u02/app/oracle/oradata/BTTEST1/example01.dbf
ONLINE

/u02/app/oracle/oradata/BTTEST1/users02.dbf
ONLINE


6 rows selected.



Restore datafile that was never backed up:

1. List all the datafiles that re in database:

SYS@BTTEST1> select name, status from v$datafile;

NAME
--------------------------------------------------------------------------------
STATUS
-------
/u02/app/oracle/oradata/BTTEST1/system01.dbf
SYSTEM

/u02/app/oracle/oradata/BTTEST1/undotbs01.dbf
ONLINE

/u02/app/oracle/oradata/BTTEST1/sysaux01.dbf
ONLINE


NAME
--------------------------------------------------------------------------------
STATUS
-------
/u02/app/oracle/oradata/BTTEST1/users01.dbf
ONLINE

/u02/app/oracle/oradata/BTTEST1/example01.dbf
ONLINE

/u02/app/oracle/oradata/BTTEST1/users02.dbf
ONLINE


6 rows selected.

SYS@BTTEST1>





2. Add new datafile to USERS tablespace, the new datafile isn’t included in backup:

[oracle@rh4as-64 BTTEST1]$ pwd
/u02/app/oracle/bkp_worman/BTTEST1
[oracle@rh4as-64 BTTEST1]$ ls
control01.ctl example01.dbf redo02.log system01.dbf users02.dbf
control02.ctl mytemp_01.tmp redo03.log undotbs01.dbf
control03.ctl redo01.log sysaux01.dbf users01.dbf
[oracle@rh4as-64 BTTEST1]$


Create DBF users03.dbf:

SYS@BTTEST1> alter tablespace USERS add datafile '/u02/app/oracle/oradata/BTTEST1/users03.dbf' size 110M;

Tablespace altered.

NAME
--------------------------------------------------------------------------------
STATUS
-------
/u02/app/oracle/oradata/BTTEST1/users03.dbf
ONLINE


There is no backup of users03.dbf

3. Rename users03.dbf and Put USERS tablespace offline.

SYS@BTTEST1> alter tablespace USERS offline;
alter tablespace USERS offline
*
ERROR at line 1:
ORA-01116: error in opening database file 7
ORA-01110: data file 7: '/u02/app/oracle/oradata/BTTEST1/users03.dbf'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3


SYS@BTTEST1> alter tablespace USERS offline immediate;  Have to use immediate because Oracle Database does not ensure that tablespace files are available and does not perform a checkpoint. You must perform media recovery on the tablespace before bringing it back online.


Tablespace altered.

SYS@BTTEST1>


4. Check status from v$datafile:

NAME
--------------------------------------------------------------------------------
STATUS
-------
/u02/app/oracle/oradata/BTTEST1/users01.dbf
RECOVER

/u02/app/oracle/oradata/BTTEST1/example01.dbf
ONLINE

/u02/app/oracle/oradata/BTTEST1/users02.dbf
RECOVER


NAME
--------------------------------------------------------------------------------
STATUS
-------
/u02/app/oracle/oradata/BTTEST1/users03.dbf
RECOVER


5. Check satus in v$recover_file

SYS@BTTEST1> select * from v$recover_file;

FILE# ONLINE ONLINE_
---------- ------- -------
ERROR CHANGE#
----------------------------------------------------------------- ----------
TIME
---------
4 OFFLINE OFFLINE
889545
21-JAN-10

6 OFFLINE OFFLINE
889545
21-JAN-10

FILE# ONLINE ONLINE_
---------- ------- -------
ERROR CHANGE#
----------------------------------------------------------------- ----------
TIME
---------

7 OFFLINE OFFLINE
FILE NOT FOUND 0



SYS@BTTEST1>

6. Re-create datafile using the command below:

SYS@BTTEST1> alter database create datafile '/u02/app/oracle/oradata/BTTEST1/users03.dbf';

Database altered.

SYS@BTTEST1> select * from v$recover_file;

FILE# ONLINE ONLINE_
---------- ------- -------
ERROR CHANGE#
----------------------------------------------------------------- ----------
TIME
---------
4 OFFLINE OFFLINE
889545
21-JAN-10

6 OFFLINE OFFLINE
889545
21-JAN-10

FILE# ONLINE ONLINE_
---------- ------- -------
ERROR CHANGE#
----------------------------------------------------------------- ----------
TIME
---------

7 OFFLINE OFFLINE
890175
21-JAN-10


SYS@BTTEST1> recover tablespace USERS;
Media recovery complete.
SYS@BTTEST1> alter tablespace USERS ONLINE;

Tablespace altered.


NAME
--------------------------------------------------------------------------------
STATUS
-------
/u02/app/oracle/oradata/BTTEST1/users03.dbf
ONLINE





























LOSS OF ALL CONTROLFILE:

1. Rename all the controlfiles\

[oracle@rh4as-64 BTTEST1]$ mv control01.ctl control01.ctl_old
[oracle@rh4as-64 BTTEST1]$ mv control02.ctl control02.ctl_old
[oracle@rh4as-64 BTTEST1]$ mv control03.ctl control03.ctl_old
[oracle@rh4as-64 BTTEST1]$ ls
control01.ctl_old example01.dbf redo02.log system01.dbf users02.dbf
control02.ctl_old mytemp_01.tmp redo03.log undotbs01.dbf users03.dbf
control03.ctl_old redo01.log sysaux01.dbf users01.dbf

2. startup database

SYS@BTTEST1> startup

Total System Global Area 419430400 bytes
Fixed Size 1219784 bytes
Variable Size 239076152 bytes
Database Buffers 176160768 bytes
Redo Buffers 2973696 bytes
ORA-00205: error in identifying control file, check alert log for more info


SYS@BTTEST1>

3. SYS@BTTEST1> @/tmp/vij.sql

Control file created.

SYS@BTTEST1> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery


SYS@BTTEST1> alter database open

19 December 2010

Install OEM on RAC database

1. Start the Runinstaller and choose : Install OEM using existing database
2. Enter node name, database name, port, sys password
3. On the same screen, choose prefill tablespace button—This will prompt you that the current database is RAC and it uses ASM as the storage, click OK and then give the datafile location by running this query:

SQL> select file_name, tablespace_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------TABLESPACE_NAME
------------------------------
+DATA/rac/datafile/users.259.708187607
USERS

+DATA/rac/datafile/sysaux.257.708187605
SYSAUX

+DATA/rac/datafile/undotbs1.258.708187607
UNDOTBS1


FILE_NAME
--------------------------------------------------------------------------------TABLESPACE_NAME
------------------------------
+DATA/rac/datafile/system.256.708187601
SYSTEM

+DATA/rac/datafile/example.264.708187819
EXAMPLE

+DATA/rac/datafile/undotbs2.265.708188081
UNDOTBS2


Choose this:

+DATA/rac/datafile/mgmt.dbf

+DATA/rac/datafile/mgmt_ecm_depot1.dbf

4. Click next button, you will get another warning stating that the EMCA was setup using DBCA and you need to deconfigure it from this location $ORACLE_HOME/bin/

Run the command below to deconfigure on all the nodes.

[oracle@node1 bin]$ ./emca -deconfig dbcontrol db -repos drop -cluster

STARTED EMCA at Jan 29, 2010 7:39:38 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.

Enter the following information:
Database unique name: rac
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: y
Jan 29, 2010 7:40:11 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/rac/emca_2010-01-29_07-39-38-PM.log.
Jan 29, 2010 7:40:20 PM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Jan 29, 2010 7:41:17 PM oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
Jan 29, 2010 7:52:21 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jan 29, 2010 7:52:31 PM
[oracle@node1 bin]$




LOG FILE looks like this:

[oracle@node1 ~]$ tail -f /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/rac/emca_2010-01-29_07-39-38-PM.log
Jan 29, 2010 7:40:20 PM oracle.sysman.emcp.util.ClusterUtil getHostName
CONFIG: Specified node: node3
Jan 29, 2010 7:40:20 PM oracle.sysman.emcp.util.DBControlUtil isDBConsoleConfigured
CONFIG: Sid: rac3 Host: node3 Node: node3 OH: /u01/app/oracle/product/10.2.0/db_1 isDBC: true
Jan 29, 2010 7:40:20 PM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Jan 29, 2010 7:40:20 PM oracle.sysman.emcp.util.PlatformInterface executeEMCTL
CONFIG: Executing 'emctl stop dbconsole ' on node node1 with sid rac1
Jan 29, 2010 7:40:34 PM oracle.sysman.emcp.util.PlatformInterface executeEMCTL
CONFIG: Executing 'emctl stop dbconsole ' on node node2 with sid rac2
Jan 29, 2010 7:40:54 PM oracle.sysman.emcp.util.PlatformInterface executeEMCTL
CONFIG: Executing 'emctl stop dbconsole ' on node node3 with sid rac3
Jan 29, 2010 7:41:03 PM oracle.sysman.emcp.util.ClusterUtil getHostName
CONFIG: Specified node: node1
Jan 29, 2010 7:41:05 PM oracle.sysman.emcp.util.ClusterUtil getHostName
CONFIG: Specified node: node2
Jan 29, 2010 7:41:06 PM oracle.sysman.emcp.util.ClusterUtil isShared
CONFIG: Path: /u01/app/oracle/product/10.2.0/db_1/node2_rac2/sysman/emd/targets.xml found in oracleHomeCache. Shared: false
Jan 29, 2010 7:41:06 PM oracle.sysman.emcp.util.ClusterUtil copyFileFromNode
CONFIG: Copying file from /u01/app/oracle/product/10.2.0/db_1/node2_rac2/sysman/emd/targets.xml on node node2 to /u01/app/oracle/product/10.2.0/db_1/node2_rac2/sysman/emd/targets.xml on localnode
Jan 29, 2010 7:41:07 PM oracle.sysman.emcp.util.ClusterUtil getHostName
CONFIG: Specified node: node3
Jan 29, 2010 7:41:09 PM oracle.sysman.emcp.util.ClusterUtil isShared
CONFIG: Path: /u01/app/oracle/product/10.2.0/db_1/node3_rac3/sysman/emd/targets.xml found in oracleHomeCache. Shared: false
Jan 29, 2010 7:41:09 PM oracle.sysman.emcp.util.ClusterUtil copyFileFromNode
CONFIG: Copying file from /u01/app/oracle/product/10.2.0/db_1/node3_rac3/sysman/emd/targets.xml on node node3 to /u01/app/oracle/product/10.2.0/db_1/node3_rac3/sysman/emd/targets.xml on localnode
Jan 29, 2010 7:41:09 PM oracle.sysman.emcp.util.DBControlUtil stopNmccollector
CONFIG: New nodeList: [node1, node2, node3] sidList: [rac1, rac2, rac3]
Jan 29, 2010 7:41:09 PM oracle.sysman.emcp.util.PlatformInterface isInView
CONFIG: IN_VIEW marker not instantiated in /u01/app/oracle/product/10.2.0/db_1/sysman/config/emca.properties
Jan 29, 2010 7:41:09 PM oracle.sysman.emcp.util.PlatformInterface getSortedEnvArray
CONFIG: New Env List: [EMDROOT=/u01/app/oracle/product/10.2.0/db_1, LD_LIBRARY_PATH=/u01/app/oracle/product/10.2.0/db_1/lib32:/u01/app/oracle/product/10.2.0/db_1/lib:/u01/app/oracle/product/10.2.0/db_1/perl/lib:null, PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/bin:/u01/app/oracle/product/10.2.0/db_1/bin, PERL5LIB=/u01/app/oracle/product/10.2.0/db_1/perl/lib:/u01/app/oracle/product/10.2.0/db_1/perl/lib/site_perl:/u01/app/oracle/product/10.2.0/db_1/sysman/admin/scripts:/u01/app/oracle/product/10.2.0/db_1/bin:]
Jan 29, 2010 7:41:09 PM oracle.sysman.emcp.util.ClusterUtil getHostName
CONFIG: Specified node: node1
Jan 29, 2010 7:41:10 PM oracle.sysman.emcp.util.PlatformInterface executeSgastopCONFIG: Executing: /u01/app/oracle/product/10.2.0/db_1/perl/bin/perl args: [/u01/app/oracle/product/10.2.0/db_1/sysman/admin/scripts/db/sgastop.pl, stop, rac1, node1-vip, 1521, /u01/app/oracle/product/10.2.0/db_1]
Jan 29, 2010 7:41:11 PM oracle.sysman.emcp.util.PlatformInterface executeSgastopCONFIG: Command executed successfully
Jan 29, 2010 7:41:11 PM oracle.sysman.emcp.util.ClusterUtil getHostName
CONFIG: Specified node: node2
Jan 29, 2010 7:41:12 PM oracle.sysman.emcp.util.PlatformInterface executeSgastopCONFIG: Executing: /u01/app/oracle/product/10.2.0/db_1/perl/bin/perl args: [/u01/app/oracle/product/10.2.0/db_1/sysman/admin/scripts/db/sgastop.pl, stop, rac2, node2-vip, 1521, /u01/app/oracle/product/10.2.0/db_1]
Jan 29, 2010 7:41:13 PM oracle.sysman.emcp.util.PlatformInterface executeSgastopCONFIG: Command executed successfully
Jan 29, 2010 7:41:13 PM oracle.sysman.emcp.util.ClusterUtil getHostName
CONFIG: Specified node: node3

5. After you retry you will get this issue:



Soln:


You cannot change this parameter whilst system online, hence create pfile from spfile, change parameter and then restart with pfile and re-create spfile and then restart


Make sure you choose session_cached_cursors more than 200:






SQL> alter SYSTEM set_cached_cursors=210;

Session altered.

Cannot be done at SYS level

session_cached_cursors: Specifies no of session cursors to be cached Repeated parse calls of the same SQL statement cause the session cursor for that statement to be moved into the session cursor cache. Subsequent parse calls will find the cursor in the cache and do not need to reopen the cursor. Oracle uses a least recently used algorithm to remove entries in the session cursor cache to make room for new entries when needed.

5. Issue: DBMS_SHARED_POOL package not executed:

DBMS_SHARED_POOL enables you to display the sizes of objects in the shared pool, and mark them for keeping or unkeeping in order to reduce memory fragmentation.

DO this on all Nodes:


[oracle@node1 ~]$ cd /u01/app/oracle/product/10.2.0/db_1/rdbms/admin/
[oracle@node1 admin]$ sqlplus '/ as sysdba'

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 29 21:24:19 2010

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> @dbmspool.sql

Package created.


Grant succeeded.


View created.


Package body created.

SQL>



6. Specify notification if needed

7. give em passwd and sysman passwd: radar and radar1

8. [root@node1 oms10g]# ./allroot.sh

run ./allroot.sh

Starting to execute allroot.sh .........

Starting to execute /u01/app/oracle/product/10.2.0/oem/oms10g/root.sh ......
Running Oracle10 root.sh script...
\nThe following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/10.2.0/oem/oms10g

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...

Adding entry to /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created


Starting to execute /u01/app/oracle/product/10.2.0/oem/agent10g/root.sh ......
Running Oracle10 root.sh script...

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/10.2.0/oem/agent10g


Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
Finished execution of /u01/app/oracle/product/10.2.0/oem/agent10g/root.sh ......
[root@node1 oms10g]#

RAC Issues

1. transport endpoint is not connected while mounting

Shutdowm firewall

2. Oracle CRS stack is already configured and will be running under init(1M)

Because "root.sh" script check "CRS_OCR_LOCATIONS" /etc/oracle/ocr.loc file (on solaris, /var/opt/oracle/ocr.loc) existed

rename the file

3. Waiting for CRSD and EVMD to start.. Timeout

4. no listener at (ADDRESS=(PROTOCOL=IPC)(KEY=CRSD_UI_SOCKET)) from clsc.log

Trial 1: cd $CRS_HOME/bin/localconfig reset


tools.synctime=TRUE

5. OCR integrity found invalid for nodes
Log file: [ OCRRAW][3086845632]rbkp:2: could not read the free list

[oracle@node1 bin]$ ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 262144
Used space (kbytes) : 1980
Available space (kbytes) : 260164
ID : 853875004
Device/File Name : /u03/oracrs/ocr
Device/File integrity check failed
n
Device/File not configured

Cluster registry integrity check failed


Try Rebooting the node or check for corruption in OCR disk

6. ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA"

ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA"

7.  Oracle CRS stack is already configured and will be running under init(1M)

  Because "root.sh" script check "CRS_OCR_LOCATIONS" /etc/oracle/ocr.loc file (on solaris, /var/opt/oracle/ocr.loc) existed


Soln: Rename the file

8. no listener at (ADDRESS=(PROTOCOL=IPC)(KEY=CRSD_UI_SOCKET)) from clsc.log

If using vmware: try this tools.synctime=TRUE

Add Node in RAC Cluster

Adding Node:

[root@node1 ~]# cd /home/oracle/oracle/product/10.2.0/crs/install
[root@node1 install]# ls
cluster.ini make.log rootaddnode.sh rootinstall
cmdllroot.sh paramfile.crs rootconfig rootlocaladd
envVars.properties preupdate.sh rootdeinstall.sh rootupgrade
install.excl readme.txt rootdeletenode.sh templocal
install.incl rootaddnode.sbs rootdelete.sh
[root@node1 install]# ./rootaddnode.sh
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Attempting to add 1 new nodes to the configuration
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 3: node3 node3-priv node3
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
/home/oracle/oracle/product/10.2.0/crs/bin/srvctl add nodeapps -n node3 -A node3-vip/255.255.255.0/eth0 -o /home/oracle/oracle/product/10.2.0/crs
[root@node1 install]#



[root@node3 crs]# ./root.sh
WARNING: directory '/home/oracle/oracle/product/10.2.0' is not owned by root
WARNING: directory '/home/oracle/oracle/product' is not owned by root
WARNING: directory '/home/oracle/oracle' is not owned by root
WARNING: directory '/home/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
OCR LOCATIONS = /u03/oracrs/ocr
OCR backup directory '/home/oracle/oracle/product/10.2.0/crs/cdata/crs' does not exist. Creating now
Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/home/oracle/oracle/product/10.2.0' is not owned by root
WARNING: directory '/home/oracle/oracle/product' is not owned by root
WARNING: directory '/home/oracle/oracle' is not owned by root
WARNING: directory '/home/oracle' is not owned by root
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
assigning default hostname node1 for node 1.
assigning default hostname node2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: node1 node1-priv node1
node 2: node2 node2-priv node2
clscfg: Arguments check out successfully.

NO KEYS WERE WRITTEN. Supply -force parameter to override.
-force is destructive and will destroy any previous cluster
configuration.
Oracle Cluster Registry for cluster has already been initialized
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
node1
node2
node3
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
Oracle CRS stack installed and running under init(1M)
Running vipca(silent) for configuring nodeapps
IP address "node1-vip" has already been used. Enter an unused IP address.


[root@node3 crs]# cd bin/
[root@node3 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@node3 bin]#


Configure node specific info:

[root@node1 conf]# pwd
/home/oracle/oracle/product/10.2.0/crs/opmn/conf
[root@node1 conf]# vi ons.config

localport=6100
remoteport=6200
loglevel=3
useocr=on




[root@node1 conf]# cd /home/oracle/oracle/product/10.2.0/crs/bin
[root@node1 bin]# ./racgons add_config node3:6200
[root@node1 bin]#

If successful, command executes silently

Run ./addNode.sh from $ORACLE_HOME/oui/bin --- Database Home

Run ./addNode.sh from $ORACLE_HOME/oui/bin --- ASM Home

Run DBCA from node1 or node2 and first setup ASM instance by selecting RAC in first page and then configure ASM in 2nd page.. This will prompt for extending ASM to new node and then provide sys password. ASM instance is now setup.

Run DBCA again from Node1 or Node2 and this time in 2nd page select instance management then click on add instance – This will add instance..

Final output


SQL> select * from v$active_instances;

INST_NUMBER INST_NAME
----------- ------------------------------------------------------------
1 node1:rac1
2 node2:rac2
3 node3:rac3

SQL>

RAC Install on Linux Part5

Post Clusterware installation:


[root@node1 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@node1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 262144
Used space (kbytes) : 1980
Available space (kbytes) : 260164
ID : 853875004
Device/File Name : /u03/oracrs/ocr
Device/File integrity check succeeded

Device/File not configured

Cluster registry integrity check succeeded

[root@node1 bin]# olsnodes
bash: olsnodes: command not found
[root@node1 bin]# ./olsnodes
node1
node2
[root@node1 bin]#



[root@node2 ~]# cd /home/oracle/oracle/product/10.2.0/crs/bin/
[root@node2 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@node2 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 262144
Used space (kbytes) : 1980
Available space (kbytes) : 260164
ID : 853875004
Device/File Name : /u03/oracrs/ocr
Device/File integrity check succeeded

Device/File not configured

Cluster registry integrity check succeeded

[root@node2 bin]# ./olsnodes
node1
node2
[root@node2 bin]#


[oracle@node1 ~]$ cd /home/oracle/oracle/product/10.2.0/crs/cfgtoollogs
[oracle@node1 cfgtoollogs]$ ls
cfgfw configToolAllCommands configToolFailedCommands oui vipca
[oracle@node1 cfgtoollogs]$ ./configToolAllCommands
WARNING: node1:6200 already configured.
WARNING: node2:6200 already configured.
PRIF-50: duplicate interface is given in the input
PRIF-50: duplicate interface is given in the input

Performing post-checks for cluster services setup

Checking node reachability...
Node reachability check passed from node "node1".


Checking user equivalence...
User equivalence check passed for user "oracle".

Checking Cluster manager integrity...


Checking CSS daemon...
Daemon status check passed for "CSS daemon".

Cluster manager integrity check passed.

Checking cluster integrity...


Cluster integrity check passed


Checking OCR integrity...

Checking the absence of a non-clustered configuration...
All nodes free of non-clustered, local-only configurations.

Uniqueness check for OCR device passed.

Checking the version of OCR...
OCR of correct Version "2" exists.

Checking data integrity of OCR...
Data integrity check for OCR passed.

OCR integrity check passed.

Checking CRS integrity...

Checking daemon liveness...
Liveness check passed for "CRS daemon".

Checking daemon liveness...
Liveness check passed for "CSS daemon".

Checking daemon liveness...
Liveness check passed for "EVM daemon".

Checking CRS health...
CRS health check passed.

CRS integrity check passed.

Checking node application existence...


Checking existence of VIP node application (required)
Check passed.

Checking existence of ONS node application (optional)
Check passed.

Checking existence of GSD node application (optional)
Check passed.


Post-check for cluster services setup was successful.
[oracle@node1 cfgtoollogs]$


ASM

root.sh

The following J2EE Applications have been deployed and are accessible at the URLs listed below.

iSQL*Plus URL:
http://node1:5560/isqlplus

iSQL*Plus DBA URL:
http://node1:5560/isqlplus/dba

Enterprise Manager 10g Database Control URL:



DB

The following J2EE Applications have been deployed and are accessible at the URLs listed below.

iSQL*Plus URL:
http://node1:5560/isqlplus

iSQL*Plus DBA URL:
http://node1:5560/isqlplus/dba

Enterprise Manager 10g Database Control URL:
http://node1:1158/em


Final check

[root@node1 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
[root@node1 ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@node1 ~]# cd /home/oracle/oracle/product/10.2.0/crs/bin/
[root@node1 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@node1 bin]# su - oracle
[oracle@node1 ~]$ ps -ef | grep pmon
oracle 12294 11729 0 17:26 pts/1 00:00:00 grep pmon
[oracle@node1 ~]$ . oraenv
ORACLE_SID = [oracle] ? +ASM1
[oracle@node1 ~]$ sqlplus '/ as sysdba'

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 13 17:26:20 2010

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

Connected to an idle instance.

SQL> startup
ASM instance started

Total System Global Area 92274688 bytes
Fixed Size 1217884 bytes
Variable Size 65890980 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@node1 ~]$ asmcmd
ASMCMD> lsdg
State Type Rebal Unbal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED NORMAL N N 512 4096 1048576 9208 6688 0 3344 0 DATA/
ASMCMD> exit


[oracle@node1 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/10.2.0/asm
[oracle@node1 ~]$ . oraenv
ORACLE_SID = [+ASM1] ? rac1
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/10.2.0/db_1
[oracle@node1 ~]$ sqlplus '/ as sysdba'

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 13 17:28:19 2010

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 104859216 bytes
Database Buffers 176160768 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> select * from v$active_instances;

INST_NUMBER INST_NAME
----------- ------------------------------------------------------------
1 node1:rac1
2 node2:rac2

SQL>

RAC Install on Linux Part4

12. Clusterware installation:

[root@node1 clusterware]# su - oracle
[oracle@node1 ~]$ cd /mnt/hgfs/clus/clusterware
[oracle@node1 clusterware]$ ls
cluvfy doc install response rpm runInstaller stage upgrade welcome.html
[oracle@node1 clusterware]$ ./runInstaller

First page select NEXT, then select inventory location

Select CRS HOME location as shown below:



Make sure all the checkings are passed:




next Page, add all the nodes with their, public, private, vip info



Next Page, select eth0 as public

Next pages select OCR and Voting disk location Choose External redundancy

Review summary page and then click Install.

After successful install, you will be asked to run root.sh


[root@node1 ~]# cd /u02/app/oracle/oraInventory/
[root@node1 oraInventory]# ls
Contents logs orainstRoot.sh
ContentsXML oraInstaller.properties oui
install.platform oraInst.loc sessionContext.ser
[root@node1 oraInventory]# ./orainstRoot.sh
Changing permissions of /u02/app/oracle/oraInventory to 770.
Changing groupname of /u02/app/oracle/oraInventory to oinstall.
The execution of the script is complete
[root@node1 oraInventory]# cd /u02/app/oracle/product/10.2.0/crs/

[root@node1 crs]# ./root.sh
WARNING: directory '/u02/app/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u02/app/oracle/product' is not owned by root
WARNING: directory '/u02/app/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
/etc/oracle does not exist. Creating it now.

Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/u02/app/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u02/app/oracle/product' is not owned by root
WARNING: directory '/u02/app/oracle' is not owned by root
assigning default hostname node1 for node 1.
assigning default hostname node2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: node1 node1-priv node1
node 2: node2 node2-priv node2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /u04/voting
Format of 1 voting devices complete.
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
node1
CSS is inactive on these nodes.
node2
Local node checking complete.
Run root.sh on remaining nodes to start CRS daemons.
[root@node1 crs]#


NOW run the same on Node2

[root@node2 crs]# ./root.sh
WARNING: directory '/u02/app/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u02/app/oracle/product' is not owned by root
WARNING: directory '/u02/app/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
/etc/oracle does not exist. Creating it now.

Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/u02/app/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u02/app/oracle/product' is not owned by root
WARNING: directory '/u02/app/oracle' is not owned by root
assigning default hostname node1 for node 1.
assigning default hostname node2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: node1 node1-priv node1
node 2: node2 node2-priv node2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /u04/voting
Format of 1 voting devices complete.
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.

RAC Install on Linux Part3

Install OCFS2 as root

[root@node1 ocf]# rpm -ivh ocfs2console-1.2.7-1.el4.i386.rpm \
> ocfs2-2.6.9-78.ELsmp-1.2.9-1.el4.i686.rpm \
> ocfs2-tools-1.2.7-1.el4.i386.rpm
Preparing... ########################################### [100%]
1:ocfs2-tools ########################################### [ 33%]
2:ocfs2console ########################################### [ 67%]
3:ocfs2-2.6.9-78.ELsmp ########################################### [100%]
[root@node1 ocf]#




Enable OCFS2 at startup:

[root@node1 ~]# /etc/init.d/o2cb enable
Writing O2CB configuration: OK
Loading module "configfs": OK
Creating directory '/config': OK
Mounting configfs filesystem at /config: OK
Loading module "ocfs2_nodemanager": OK
Loading module "ocfs2_dlm": OK
Loading module "ocfs2_dlmfs": OK
Creating directory '/dlm': OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK


Create OCFS2 filesystem for OCR and Votingdisk:

[root@node1 /]# mkdir /u03
[root@node1 /]# mkdir /u04
[root@node1 /]# ls
bin dev home lost+found mnt root srv tmp u03 var
boot dlm initrd media opt sbin sys u01 u04
config etc lib misc proc selinux tftpboot u02 usr
[root@node1 /]# mkfs.ocfs2 -b 4k -C 32k -N 4 -L /u03 /dev/sdc1
mkfs.ocfs2 1.2.7
Filesystem label=/u03
Block size=4096 (bits=12)
Cluster size=32768 (bits=15)
Volume size=2146762752 (65514 clusters) (524112 blocks)
3 cluster groups (tail covers 1002 clusters, rest cover 32256 clusters)
Journal size=67108864
Initial number of node slots: 4
Creating bitmaps: done
Initializing superblock: done
Writing system files: done
Writing superblock: done
Writing backup superblock: 1 block(s)
Formatting Journals: done
Writing lost+found: done
mkfs.ocfs2 successful

[root@node1 /]# mkfs.ocfs2 -b 4k -C 32k -N 4 -L /u04 /dev/sdd1
mkfs.ocfs2 1.2.7
Filesystem label=/u04
Block size=4096 (bits=12)
Cluster size=32768 (bits=15)
Volume size=3216048128 (98146 clusters) (785168 blocks)
4 cluster groups (tail covers 1378 clusters, rest cover 32256 clusters)
Journal size=67108864
Initial number of node slots: 4
Creating bitmaps: done
Initializing superblock: done
Writing system files: done
Writing superblock: done
Writing backup superblock: 1 block(s)
Formatting Journals: done
Writing lost+found: done
mkfs.ocfs2 successful

[root@node1 /]#


Mount OCFS2 Filesystem:

[root@node1 ~]# mount -t ocfs2 -L /u03 -o datavolume /u03
[root@node1 ~]# mount -t ocfs2 -L /u04 -o datavolume /u04
[root@node1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
9.0G 6.9G 1.7G 82% /
/dev/sda1 99M 14M 81M 15% /boot
none 506M 0 506M 0% /dev/shm
/dev/mapper/VolGroup00-LogVol02
9.9G 55M 9.3G 1% /u01
.host:/ 299G 195G 104G 66% /mnt/hgfs
/dev/sdb1 12G 63M 12G 1% /u02
/dev/sdc1 2.0G 263M 1.8G 13% /u03
/dev/sdd1 3.0G 263M 2.8G 9% /u04
[root@node1 ~]#

Add to /etc/fstab

LABEL=/u03 /u03 ocfs2 _netdev,datavolume,nointr 0 0
LABEL=/u04 /u04 ocfs2 _netdev,datavolume,nointr 0 0




Create Directories for OCR and VD an set permissions:

[root@node1 /]# mkdir /u03/ocacrs
[root@node1 /]# mkdir /u04/votingdisk
[root@node1 /]# chown oracle:oinstall /u03/ocacrs/
[root@node1 /]# chown oracle:oinstall /u04/votingdisk/
[root@node1 /]# chmod 775 /u03/ocacrs/
[root@node1 /]# chmod 775 /u04/votingdisk/


10.
Download and Configure ASM libraries and DISK:
[root@node1 asm]# rpm -Uvh oracleasm-2.6.9-78.ELsmp-2.0.5-1.el4.i686.rpm #
[root@node1 asm]# rpm -Uvh oracleasm-2.6.9-78.ELsmp-2.0.5-1.el4.i686.rpm \
> oracleasmlib-2.0.4-1.el4.i386.rpm \
> oracleasm-support-2.1.3-1.el4.i386.rpm
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.9-78.ELsm########################################### [ 67%]
3:oracleasmlib ########################################### [100%]
[root@node1 asm]#


Configure ASM:

[root@node1 asm]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting without typing an
answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@node1 asm]#



[root@node1 asm]# /etc/init.d/oracleasm createdisk VOL1 /dev/sde1
Marking disk "VOL1" as an ASM disk: [ OK ]
[root@node1 asm]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdf1
Marking disk "VOL2" as an ASM disk: [ OK ]
[root@node1 asm]#


[root@node1 asm]# /etc/init.d/oracleasm listdisks
VOL1
VOL2




10. Clone RAC Node1 to RAC Node 2

Copy and Change settings .vmx file of VMWARE in both the nodes.

disk.locking = "FALSE"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.dataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "0"
scsi1.sharedBus = "virtual"
scsi0:1.deviceType = “disk”
scsi0:1.deviceType = “disk”
scsi0:2.deviceType = “disk”
scsi0:3.deviceType = “disk”
scsi0:4.deviceType = “disk”
scsi0:5.deviceType = “disk”




Change Ip address, Host name in /etc/sysconfig/network and enable both Ethernet adaptors.


11. Setup Oracle User equivalency – This is needed for clusterware daemons to communicate with each other without password prompt


[oracle@node1 ~]$ chmod 755 .ssh
[oracle@node1 ~]$ cd /home/oracle/.ssh/
[oracle@node1 .ssh]$ ls
[oracle@node1 .ssh]$ chmod 755 /home/oracle/.ssh/
[oracle@node1 .ssh]$


Change the X11Forwarding to no in order to avoid a WARNING: no xauth data; using fake authtication data for x11 forwarding

[root@node1 ]$ vi /etc/ssh/ssh_config



[oracle@node1 .ssh]$ /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
c2:35:d6:bf:e6:32:25:09:20:9f:22:e6:4e:68:3e:71 oracle@node1
[oracle@node1 .ssh]$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
c9:19:6f:c4:7c:60:3e:d6:9a:c5:f1:ff:b6:03:e0:9c oracle@node1
[oracle@node1 .ssh]$ ls
id_dsa id_dsa.pub id_rsa id_rsa.pub
[oracle@node1 .ssh]$ cat id_rsa.pub id_dsa.pub > node1.pub
[oracle@node2 .ssh]$ /usr/bin/ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
45:25:46:49:0c:b6:29:78:74:3a:4a:e6:84:29:e8:6d oracle@node2
[oracle@node2 .ssh]$ /usr/bin/ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
41:f7:6f:12:68:e7:ce:b2:d1:43:70:e3:fd:27:b7:e6 oracle@node2
[oracle@node2 .ssh]$ ls
id_dsa id_dsa.pub id_rsa id_rsa.pub node1.pub
[oracle@node2 .ssh]$ cat id_rsa.pub id_dsa.pub > node2.pub
[oracle@node2 .ssh]$ ls
id_dsa id_dsa.pub id_rsa id_rsa.pub node1.pub node2.pub


[oracle@node2 .ssh]$ cat node1.pub node2.pub > authorized_keys
[oracle@node2 .ssh]$ chmod 644 authorized_keys
[oracle@node2 .ssh]$

[oracle@node2 .ssh]$ scp authorized_keys node1:/home/oracle/.ssh
The authenticity of host 'node1 (192.168.200.71)' can't be established.
RSA key fingerprint is 97:74:ed:c9:7c:5a:c7:c5:f3:b8:a7:5f:7f:5b:6e:3f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node1,192.168.200.71' (RSA) to the list of known hosts.
oracle@node1's password:
authorized_keys 100% 1648 1.6KB/s 00:00

[oracle@node2 .ssh]$ ssh node1 date
Fri Feb 5 23:01:33 IST 2010
[oracle@node2 .ssh]$ ssh node2 date
The authenticity of host 'node2 (192.168.200.72)' can't be established.
RSA key fingerprint is 97:74:ed:c9:7c:5a:c7:c5:f3:b8:a7:5f:7f:5b:6e:3f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'node2,192.168.200.72' (RSA) to the list of known hosts.
Fri Feb 5 23:01:39 IST 2010
[oracle@node2 .ssh]$

RAC Install on Linux Part2

Disk partitioning using fdisk:


a. create partition for storing RAC software:

Add Partition for storing RAC and mount it

Mkdir /u02

[root@node1 /]# mkfs -t ext3 /dev/sdb1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1572864 inodes, 3144715 blocks
157235 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=3221225472
96 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

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

Mount it and add it in /etc/fstab

[root@node1 /]# mount -t ext3 /dev/sdb1 /u02
[root@node1 /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
9.0G 6.9G 1.7G 81% /
/dev/sda1 99M 14M 81M 15% /boot
none 506M 0 506M 0% /dev/shm
/dev/mapper/VolGroup00-LogVol02
9.9G 55M 9.3G 1% /u01
/dev/sdb1 12G 63M 12G 1% /u02
[root@node1 /]#

/dev/sdb1 /u02 ext3 defaults 1 1  /etc/fstab – to boot at startup



b. create partiotions for OCR, VD and ASM files.
[root@node1 ~]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):
Using default value 261

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@node1 ~]#

Do this similarly for all the partitions


[root@node1 ~]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2610 20860402+ 8e Linux LVM

Disk /dev/sdb: 12.8 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 1566 12578863+ 83 Linux

Disk /dev/sdc: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 261 2096451 83 Linux

Disk /dev/sdd: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdd1 1 391 3140676 83 Linux

Disk /dev/sde: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sde1 1 391 3140676 83 Linux

Disk /dev/sdf: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdf1 1 522 4192933+ 83 Linux



9. Download OCFS2 and ASM libraries from oracle site
http://oss.oracle.com/projects/ocfs2/files/RedHat/
—This should be based on your kernel and OS version


Make sure you have shared the folders from vmware to access them




My kernel version is:
[root@node1 /]# uname -r
2.6.9-78.ELsmp

RAC Install on Linux Part1

Oracle RAC setup on Linux Redhat 4 Install guide:

Introduction:

This document presents the installation of Oracle 10 RAC on Linux environment.
The setup is done based on the following options:

1. Oracle Clusterware: 10.2.0.1 version
2. File system used for clusterware storage is OCFS2
3. ASM is used for RAC database storage – 10.2.0.1

Pre-Install Steps:

1. Install VMWARE on your PC, make sure you have atlease 3 GB RAM if ypu are planning for 3 Node RAC
2. Install Linux OS using ISO image disc or CD/DVD.
3. After logging in for the first time, Install vmware tools.
4. Configure Hang check timer:

[root@rh4as-64 oracle]# modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
[root@rh4as-64 oracle]# cat >> /etc/rc.d/rc.local << EOF
> modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
> EOF
[root@rh4as-64 oracle]#


Reason: Oracle needs to rapidly detect and isolate any occurrence of node failure within the cluster. This is mainly used to evict the failed nodes and hence preventing them from corrupting the disk. On linux this eviction is done by Hang-check timer module. This module periodically checks for the delay during last interval, after a threshold value is exceeded then hang check timer reboots the system.

5. Shutdown the server and then Add extra Ethernet card for private address and extra disk for storing 10g RAC software(Needed for my install)
6. Add disks for ASM, OCR and Voting disk. Based on my experience, make sure you have a separate disk for Voting disk and OCR(Can be done under same) and mount them separately later.
7. Add VMware time synchronization:














Edit /boot/grub/grub.conf and add the following options to the kernel /boot/ line of your default (SMP) kernel:





8. Switch on your server and configure your disks with fdisk and set /etc/hosts with IP addresses for public, private and VIP as shown below:




Change Hostname under /etc/sysconfig/network:
NETWORKING=yes
HOSTNAME=v_prd1

Edit /etc/hosts to look like this:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost
192.168.100.51 node1-priv
192.168.100.52 node2-priv
192.168.200.71 node1
192.168.200.72 node2
192.168.200.91 node1-vip
192.168.200.92 node2-vip


Set Ip address for Ethernet Cards (Public and Private) and then activate both