In sweet memories of my ever loving brother "kutty thambi " ARUN KUMAR
Showing posts with label 10g concepts. Show all posts
Showing posts with label 10g concepts. Show all posts

Sunday, October 31, 2010

RMAN TSPITR DEMO

Recovery Manager (RMAN) automatic tablespace point-in-time recovery (commonly abbreviated TSPITR) enables you to quickly recover one or more tablespaces in an Oracle database to an earlier time, without affecting the state of the rest of the tablespaces and other objects in the database.for theoritical part please refer oracle documentation.

Here in this demo i am going to create and truncate a table in tablespace USERS for schema(username) RAJESH and recover truncated table TEST1 of users RAJESH schema in tablespace USERS.

We can use RMAN TSPITR in the following conditions

1. Recovering data lost after an erroneous TRUNCATE TABLE statement;
2. Recovering from logical corruption of a table;
3. Undoing the effects of an incorrect batch job or other DML statement that has affected only a subset of the database;
4. Recovering a logical schema to a point different from the rest of the physical database, when multiple schemas exist in separate tablespaces of one physical database.

SQL> select name from v$tablespace;

NAME
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
USERS
TEMP

SQL> alter user rajesh identified by rajesh default tablespace users;

User altered.

SQL> conn rajesh/rajesh;
Connected.
SQL> create table test1(id number);

Table created.

SQL> insert into test1 values(123);

1 row created.

SQL> /

1 row created.

SQL> /

1 row created.

SQL> /

1 row created.

SQL> commit;

Commit complete.

SQL> select * from test1;

        ID
----------
       123
       123
       123
       123

SQL>

[oracle@rac1 ~]$ . oraenv
ORACLE_SID = [cdbs1] ? rev1
[oracle@rac1 ~]$ rlrman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Sun Oct 31 15:48:18 2010

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

connected to target database: REV1 (DBID=1886963043)

RMAN> backup full database plus archivelog;


Starting backup at 31-OCT-10
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=153 devtype=DISK
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=18 recid=109 stamp=733321071
input archive log thread=1 sequence=19 recid=110 stamp=733321246
input archive log thread=1 sequence=20 recid=111 stamp=733321261
input archive log thread=1 sequence=21 recid=112 stamp=733351761
input archive log thread=1 sequence=22 recid=113 stamp=733351877
input archive log thread=1 sequence=23 recid=114 stamp=733851812
input archive log thread=1 sequence=24 recid=115 stamp=733851923
input archive log thread=1 sequence=25 recid=116 stamp=733852130
input archive log thread=1 sequence=26 recid=117 stamp=733852142
channel ORA_DISK_1: starting piece 1 at 31-OCT-10
channel ORA_DISK_1: finished piece 1 at 31-OCT-10
piece handle=/u01/app/oracle/backup/13lrrcfp_1_1 tag=TAG20101031T154911 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:05
Finished backup at 31-OCT-10

Starting backup at 31-OCT-10
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u01/app/oracle/oradata/rev1/system01.dbf
input datafile fno=00003 name=/u01/app/oracle/oradata/rev1/sysaux01.dbf
input datafile fno=00002 name=/u01/app/oracle/oradata/rev1/undotbs01.dbf
input datafile fno=00004 name=/u01/app/oracle/oradata/rev1/users01.dbf
channel ORA_DISK_1: starting piece 1 at 31-OCT-10
channel ORA_DISK_1: finished piece 1 at 31-OCT-10
piece handle=/u01/app/oracle/backup/14lrrcg2_1_1 tag=TAG20101031T154920 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:36
Finished backup at 31-OCT-10

Starting backup at 31-OCT-10
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=27 recid=118 stamp=733852258
channel ORA_DISK_1: starting piece 1 at 31-OCT-10
channel ORA_DISK_1: finished piece 1 at 31-OCT-10
piece handle=/u01/app/oracle/backup/15lrrcj4_1_1 tag=TAG20101031T155059 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 31-OCT-10

Starting Control File and SPFILE Autobackup at 31-OCT-10
piece handle=/u01/app/oracle/flash_recovery_area/REV1/autobackup/2010_10_31/o1_mf_s_733852263_6dtjrkts_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 31-OCT-10

RMAN> exit


Recovery Manager complete.
[oracle@rac1 ~]$

SQL> conn sys/oracle as sysdba;
Connected.
SQL> alter system switch logfile;

System altered.

SQL> create tablespace demo datafile '/u01/app/oracle/oradata/rev1/demo01.dbf' size 2m;

Tablespace created.

SQL> create user sai identified by sai default tablespace demo;

User created.

SQL> grant connect, resource to sai;

Grant succeeded.

SQL> conn sai/sai;
Connected.
SQL> create table test2(id number);

Table created.

SQL> insert into test2 values(555);

1 row created.

SQL> /

1 row created.

SQL> /

1 row created.

SQL> commit;

Commit complete.

SQL> select * from test2;

        ID
----------
       555
       555
       555

SQL> set time on;
15:54:48 SQL> conn rajesh/rajesh;
Connected.
15:54:57 SQL> select * from test1;

        ID
----------
       123
       123
       123
       123

15:55:15 SQL> truncate table test1;

Table truncated.

15:55:26 SQL> select * from test1;

no rows selected

15:55:32 SQL>

15:55:32 SQL> conn sys/oracle as sysdba;
Connected.
15:59:30 SQL> col name format a51;
15:59:45 SQL> col status for a10;
15:59:51 SQL> select name,status from v$datafile;

NAME                                                STATUS
--------------------------------------------------- ----------
/u01/app/oracle/oradata/rev1/system01.dbf           SYSTEM
/u01/app/oracle/oradata/rev1/undotbs01.dbf          ONLINE
/u01/app/oracle/oradata/rev1/sysaux01.dbf           ONLINE
/u01/app/oracle/oradata/rev1/users01.dbf            RECOVER
/u01/app/oracle/oradata/rev1/demo01.dbf             ONLINE


16:00:08 SQL> conn sai/sai;
Connected.
16:00:55 SQL> create table test3(id number);

Table created.

16:01:08 SQL> insert into test3 values(666);

1 row created.

16:01:22 SQL> /

1 row created.

16:01:22 SQL> commit;

Commit complete.

16:01:25 SQL> select * from test3;

        ID
----------
       666
       666

16:01:30 SQL>

[oracle@rac1 ~]$ . oraenv
ORACLE_SID = [rev1] ?
[oracle@rac1 ~]$ rlrman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Sun Oct 31 15:56:19 2010

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

connected to target database: REV1 (DBID=1886963043)

RMAN> recover tablespace USERS until time "to_date('31-OCT-2010 15:55:00','DD-MON-YYYY HH24:MI:SS')" AUXILIARY DESTINATION='/u01/app/oracle';

Starting recover at 31-OCT-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=136 devtype=DISK
RMAN-05026: WARNING: presuming following set of tablespaces applies to specified point in time

List of tablespaces expected to have UNDO segments
tablespace SYSTEM
tablespace UNDOTBS1

Creating automatic instance, with SID='huEl'

initialization parameters used for automatic instance:
db_name=REV1
compatible=10.2.0.1.0
db_block_size=8192
db_files=200
db_unique_name=tspitr_REV1_huEl
large_pool_size=1M
shared_pool_size=110M
#No auxiliary parameter file used
db_create_file_dest=/u01/app/oracle
control_files=/u01/app/oracle/cntrl_tspitr_REV1_huEl.f


starting up automatic instance REV1

Oracle instance started

Total System Global Area     201326592 bytes

Fixed Size                     1218508 bytes
Variable Size                146802740 bytes
Database Buffers              50331648 bytes
Redo Buffers                   2973696 bytes
Automatic instance created

contents of Memory Script:
{
# set the until clause
set until  time "to_date('31-OCT-2010 15:55:00','DD-MON-YYYY HH24:MI:SS')";
# restore the controlfile
restore clone controlfile;
# mount the controlfile
sql clone 'alter database mount clone database';
# archive current online log for tspitr to a resent until time
sql 'alter system archive log current';
# avoid unnecessary autobackups for structural changes during TSPITR
sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;';
}
executing Memory Script

executing command: SET until clause

Starting restore at 31-OCT-10
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=36 devtype=DISK

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/REV1/autobackup/2010_10_31/o1_mf_s_733852408_6dtjx0yz_.bkp
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/u01/app/oracle/flash_recovery_area/REV1/autobackup/2010_10_31/o1_mf_s_733852408_6dtjx0yz_.bkp tag=TAG20101031T155328
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04
output filename=/u01/app/oracle/cntrl_tspitr_REV1_huEl.f
Finished restore at 31-OCT-10

sql statement: alter database mount clone database

sql statement: alter system archive log current

sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end;
released channel: ORA_DISK_1
released channel: ORA_AUX_DISK_1

contents of Memory Script:
{
# generated tablespace point-in-time recovery script
# set the until clause
set until  time "to_date('31-OCT-2010 15:55:00','DD-MON-YYYY HH24:MI:SS')";
plsql <<<-- tspitr_2
declare
  sqlstatement       varchar2(512);
  offline_not_needed exception;
  pragma exception_init(offline_not_needed, -01539);
begin
  sqlstatement := 'alter tablespace '||  'USERS' ||' offline for recover';
  krmicd.writeMsg(6162, sqlstatement);
  krmicd.execSql(sqlstatement);
exception
  when offline_not_needed then
    null;
end; >>>;
# set an omf destination filename for restore
set newname for clone datafile  1 to new;
# set an omf destination filename for restore
set newname for clone datafile  2 to new;
# set an omf destination tempfile
set newname for clone tempfile  1 to new;
# set a destination filename for restore
set newname for datafile  4 to
 "/u01/app/oracle/oradata/rev1/users01.dbf";
# rename all tempfiles
switch clone tempfile all;
# restore the tablespaces in the recovery set plus the auxilliary tablespaces
restore clone datafile  1, 2, 4;
switch clone datafile all;
#online the datafiles restored or flipped
sql clone "alter database datafile  1 online";
#online the datafiles restored or flipped
sql clone "alter database datafile  2 online";
#online the datafiles restored or flipped
sql clone "alter database datafile  4 online";
# make the controlfile point at the restored datafiles, then recover them
recover clone database tablespace  "USERS", "SYSTEM", "UNDOTBS1" delete archivelog;
alter clone database open resetlogs;
# PLUG HERE the creation of a temporary tablespace if export fails due to lack
# of temporary space.
# For example in Unix these two lines would do that:
#sql clone "create tablespace aux_tspitr_tmp
#           datafile ''/tmp/aux_tspitr_tmp.dbf'' size 500K";
}
executing Memory Script

executing command: SET until clause

sql statement: alter tablespace USERS offline for recover

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed temporary file 1 to /u01/app/oracle/TSPITR_REV1_HUEL/datafile/o1_mf_temp_%u_.tmp in control file

Starting restore at 31-OCT-10
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=40 devtype=DISK

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/app/oracle/TSPITR_REV1_HUEL/datafile/o1_mf_system_%u_.dbf
restoring datafile 00002 to /u01/app/oracle/TSPITR_REV1_HUEL/datafile/o1_mf_undotbs1_%u_.dbf
restoring datafile 00004 to /u01/app/oracle/oradata/rev1/users01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/backup/14lrrcg2_1_1
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/u01/app/oracle/backup/14lrrcg2_1_1 tag=TAG20101031T154920
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:17
Finished restore at 31-OCT-10

datafile 1 switched to datafile copy
input datafile copy recid=17 stamp=733852877 filename=/u01/app/oracle/TSPITR_REV1_HUEL/datafile/o1_mf_system_6dtk9896_.dbf
datafile 2 switched to datafile copy
input datafile copy recid=18 stamp=733852877 filename=/u01/app/oracle/TSPITR_REV1_HUEL/datafile/o1_mf_undotbs1_6dtk98by_.dbf

sql statement: alter database datafile  1 online

sql statement: alter database datafile  2 online

sql statement: alter database datafile  4 online

Starting recover at 31-OCT-10
using channel ORA_AUX_DISK_1

starting media recovery

archive log thread 1 sequence 27 is already on disk as file /u01/app/oracle/flash_recovery_area/REV1/archivelog/2010_10_31/o1_mf_1_27_6dtjrbnj_.arc
archive log thread 1 sequence 28 is already on disk as file /u01/app/oracle/flash_recovery_area/REV1/archivelog/2010_10_31/o1_mf_1_28_6dtk80s9_.arc
archive log filename=/u01/app/oracle/flash_recovery_area/REV1/archivelog/2010_10_31/o1_mf_1_27_6dtjrbnj_.arc thread=1 sequence=27
archive log filename=/u01/app/oracle/flash_recovery_area/REV1/archivelog/2010_10_31/o1_mf_1_28_6dtk80s9_.arc thread=1 sequence=28
media recovery complete, elapsed time: 00:00:03
Finished recover at 31-OCT-10

database opened

contents of Memory Script:
{
# export the tablespaces in the recovery set
host 'exp userid =\"/@\(DESCRIPTION=\(ADDRESS=\(PROTOCOL=beq\)\(PROGRAM=/u01/app/oracle/product/10.2.0/db_1/bin/oracle\)\(ARGV0=oraclehuEl\)\(ARGS=^'\(DESCRIPTION=\(LOCAL=YES\)\(ADDRESS=\(PROTOCOL=beq\)\)\)^'\)\(ENVS=^'ORACLE_SID=huEl^'\)\)\(CONNECT_DATA=\(SID=huEl\)\)\) as sysdba\" point_in_time_recover=y tablespaces= USERS file=
tspitr_a.dmp';
# shutdown clone before import
shutdown clone immediate
# import the tablespaces in the recovery set
host 'imp userid =\"/@ as sysdba\" point_in_time_recover=y file=
tspitr_a.dmp';
# online/offline the tablespace imported
sql "alter tablespace  USERS online";
sql "alter tablespace  USERS offline";
# enable autobackups in case user does open resetlogs from RMAN after TSPITR
sql 'begin dbms_backup_restore.AutoBackupFlag(TRUE); end;';
}
executing Memory Script


Export: Release 10.2.0.1.0 - Production on Sun Oct 31 16:02:07 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 and OLAP options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)
Note: table data (rows) will not be exported

About to export Tablespace Point-in-time Recovery objects...
For tablespace USERS ...
. exporting cluster definitions
. exporting table definitions
. . exporting table                              A
EXP-00091: Exporting questionable statistics.
. . exporting table                            NEW
EXP-00091: Exporting questionable statistics.
. . exporting table                          TEST1
. exporting referential integrity constraints
. exporting triggers
. end point-in-time recovery
Export terminated successfully with warnings.
host command complete

database closed
database dismounted
Oracle instance shut down


Import: Release 10.2.0.1.0 - Production on Sun Oct 31 16:02:54 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 and OLAP options

Export file created by EXPORT:V10.02.01 via conventional path
About to import Tablespace Point-in-time Recovery objects...
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses WE8ISO8859P1 character set (possible charset conversion)
. importing SYS's objects into SYS
. importing SCOTT's objects into SCOTT
. . importing table                            "A"
. importing RAJESH's objects into RAJESH
. . importing table                          "NEW"
. . importing table                        "TEST1"
. importing SYS's objects into SYS
Import terminated successfully without warnings.
host command complete

sql statement: alter tablespace  USERS online

sql statement: alter tablespace  USERS offline

sql statement: begin dbms_backup_restore.AutoBackupFlag(TRUE); end;

Removing automatic instance
Automatic instance removed
auxiliary instance file /u01/app/oracle/cntrl_tspitr_REV1_huEl.f deleted
auxiliary instance file /u01/app/oracle/TSPITR_REV1_HUEL/datafile/o1_mf_system_6dtk9896_.dbf deleted
auxiliary instance file /u01/app/oracle/TSPITR_REV1_HUEL/datafile/o1_mf_undotbs1_6dtk98by_.dbf deleted
auxiliary instance file /u01/app/oracle/TSPITR_REV1_HUEL/datafile/o1_mf_temp_6dtkdg6g_.tmp deleted
auxiliary instance file /u01/app/oracle/TSPITR_REV1_HUEL/onlinelog/o1_mf_1_6dtkd95j_.log deleted
auxiliary instance file /u01/app/oracle/TSPITR_REV1_HUEL/onlinelog/o1_mf_2_6dtkdbmb_.log deleted
auxiliary instance file /u01/app/oracle/TSPITR_REV1_HUEL/onlinelog/o1_mf_3_6dtkdbrn_.log deleted
Finished recover at 31-OCT-10

RMAN>

16:03:06 SQL> select name,status from v$datafile;

NAME                                                STATUS
--------------------------------------------------- ----------
/u01/app/oracle/oradata/rev1/system01.dbf           SYSTEM
/u01/app/oracle/oradata/rev1/undotbs01.dbf          ONLINE
/u01/app/oracle/oradata/rev1/sysaux01.dbf           ONLINE
/u01/app/oracle/oradata/rev1/users01.dbf            OFFLINE
/u01/app/oracle/oradata/rev1/demo01.dbf             ONLINE

16:03:06 SQL> select name,status from v$datafile;

NAME                                                STATUS
--------------------------------------------------- ----------
/u01/app/oracle/oradata/rev1/system01.dbf           SYSTEM
/u01/app/oracle/oradata/rev1/undotbs01.dbf          ONLINE
/u01/app/oracle/oradata/rev1/sysaux01.dbf           ONLINE
/u01/app/oracle/oradata/rev1/users01.dbf            OFFLINE
/u01/app/oracle/oradata/rev1/demo01.dbf             ONLINE

16:03:45 SQL> conn rajesh/rajesh;
Connected.
16:05:26 SQL> select * from test1;
select * from test1
              *
ERROR at line 1:
ORA-00376: file 4 cannot be read at this time
ORA-01110: data file 4: '/u01/app/oracle/oradata/rev1/users01.dbf'


16:05:32 SQL> conn sys/oracle as sysdba;
Connected.
16:05:42 SQL> alter tablespace users online;

Tablespace altered.

16:05:52 SQL> conn rajesh/rajesh;
Connected.
16:05:58 SQL> select * from test1;

        ID
----------
       123
       123
       123
       123

16:06:05 SQL> conn sai/sai;
Connected.
16:06:11 SQL> select * from test2;

        ID
----------
       555
       555
       555

16:06:16 SQL> select * from test3;

        ID
----------
       666
       666

16:06:20 SQL> conn sys/oracle as sysdba;
Connected.
16:06:32 SQL> select name,status from v$datafile;

NAME                                                STATUS
--------------------------------------------------- ----------
/u01/app/oracle/oradata/rev1/system01.dbf           SYSTEM
/u01/app/oracle/oradata/rev1/undotbs01.dbf          ONLINE
/u01/app/oracle/oradata/rev1/sysaux01.dbf           ONLINE
/u01/app/oracle/oradata/rev1/users01.dbf            ONLINE
/u01/app/oracle/oradata/rev1/demo01.dbf             ONLINE

16:06:38 SQL>

hope, this will helps you.

reference:
http://download.oracle.com/docs/cd/B14117_01/server.101/b10734/rcmtspit.htm

Monday, May 31, 2010

OUI-35000: Fatal cluster error encountered while adding a node.

PROBLEM:
OU1-35000: Fatal cluster error encountered ().
Correct the problem and try the operation again.

Solution:
Occurs during installation or adding a node in RAC environment.
Make sure the private node name or virtual hostnames are reachable. If they are not reachable, make sure they exist in DNS or /etc/hosts file.

Due to non availability or communication with clusterware. or wrong entry of host name, public IP, private IP or Virtual IP address during installation.
action: stop and start the CRS in all nodes. or correct the host IP Address.

[root@rac1 bin]# ./crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.demo.db    application    ONLINE    UNKNOWN   rac3
ora....o1.inst application    ONLINE    OFFLINE
ora....o2.inst application    ONLINE    OFFLINE
ora....osrv.cs application    ONLINE    UNKNOWN   rac1
ora....mo1.srv application    ONLINE    UNKNOWN   rac3
ora....mo2.srv application    ONLINE    UNKNOWN   rac1
ora....SM2.asm application    ONLINE    UNKNOWN   rac1
ora....C1.lsnr application    ONLINE    UNKNOWN   rac1
ora.rac1.gsd   application    ONLINE    UNKNOWN   rac1
ora.rac1.ons   application    ONLINE    UNKNOWN   rac1
ora.rac1.vip   application    ONLINE    ONLINE    rac1
ora....SM1.asm application    ONLINE    UNKNOWN   rac3
ora....C3.lsnr application    ONLINE    UNKNOWN   rac3
ora.rac3.gsd   application    ONLINE    UNKNOWN   rac3
ora.rac3.ons   application    ONLINE    UNKNOWN   rac3
ora.rac3.vip   application    ONLINE    ONLINE    rac3

[root@rac1 bin]# ./crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.

[root@rac3 bin]# ./crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.

[root@rac1 bin]# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly

[root@rac3 bin]# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly

[root@rac3 bin]# ./crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.demo.db    application    ONLINE    ONLINE    rac3
ora....o1.inst application    ONLINE    ONLINE    rac3
ora....o2.inst application    ONLINE    ONLINE    rac1
ora....osrv.cs application    ONLINE    ONLINE    rac1
ora....mo1.srv application    ONLINE    ONLINE    rac3
ora....mo2.srv application    ONLINE    ONLINE    rac1
ora....SM2.asm application    ONLINE    ONLINE    rac1
ora....C1.lsnr application    ONLINE    ONLINE    rac1
ora.rac1.gsd   application    ONLINE    ONLINE    rac1
ora.rac1.ons   application    ONLINE    ONLINE    rac1
ora.rac1.vip   application    ONLINE    ONLINE    rac1
ora....SM1.asm application    ONLINE    ONLINE    rac3
ora....C3.lsnr application    ONLINE    ONLINE    rac3
ora.rac3.gsd   application    ONLINE    ONLINE    rac3
ora.rac3.ons   application    ONLINE    ONLINE    rac3
ora.rac3.vip   application    ONLINE    ONLINE    rac3


Due to entering wrong IP address also OU1-35000 Fatal error occurs:
figure 1: mismatching of ip addresses
correcting the ip address: after correcting the ip address , no fatal cluster error occurs, lets try  as show in below figure.
hope, it will helps you. 
regards,
Rajeshkumar.

Sunday, April 4, 2010

Automated Storage Management (ASM) Pocket Reference Guide

 Automated Storage Management (ASM) Pocket Reference Guide
 by charles kim

ASM Diskgroups
Create Diskgroup
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;

Drop disk groups
DROP DISKGROUP DATA INCLUDING CONTENTS;

Add disks
ALTER DISKGROUP DATA ADD DISK '/dev/sda3';

Drop a disk
ALTER DISKGROUP DATA DROP DISK DATA_0001;

Resize all disks in a disk group
ALTER DISKGROUP DATA RESIZE ALL SIZE 100G;

UNDROP DISKS clause of the ALTER DISKGROUP
ALTER DISKGROUP DATA UNDROP DISKS;

Rebalance diskgroup
ALTER DISKGROUP DATA REBALANCE POWER 5;

Check Diskgroup
ALTER DISKGROUP DATA CHECK;
ALTER DISKGROUP DATA CHECK NOREPAIR;

Diskgroup Metadata Backup
md_backup -b asm_backup.mdb.txt -g data,fra

ASM Specific Init.ora Parameters
*.cluster_database=true
*.asm_diskstring='/dev/sd*1'
*.instance_type=asm
*.shared_pool_size=100M
*.large_pool_size=80M
*.db_cache_size=60M
*.asm_diskgroups='DATA','FRA'

Initialize ASM for non-RAC
./localconfig add

Manually start CSSD (non-RAC)
/etc/init.d/init.cssd start

Manually stop CSSD ( non-RAC)
/etc/init.d/init.cssd stop

Resetting CSS to new Oracle Home
localconfig reset /apps/oracle/product/11.1.0/ASM

ASM Dictionary Views
v$asm_alias  ---list all aliases in all currently mounted diskgroups
v$asm_client ---list all the databases currently accessing the diskgroups
v$asm_disk ----lists all the disks discovered by the ASM instance.
v$asm_diskgroup ---Lists all the diskgroups discovered by the ASM instance.
v$asm_file ---Lists all files that belong to diskgroups mounted by the ASM instance.
v$asm_operation ---Reports information about current active operations. Rebalance activity is reported in this view.
v$asm_template ---Lists all the templates currently mounted by the ASM instance.
v$asm_diskgroup_stat ---same as v$asm_diskgroup but does discover new disgroups. Use this view instead of v$asm_diskgroup.
v$asm_disk_stat ---same as v$asm_disk but does not discover new disks. Use this view instead of v$asm_disk.

srvctl commands
ADD
srvctl add asm -n rac3 -i +ASM3 -o /opt/oracle/app/product/10.2.0/asm

ENABLE
srvctl enable asm -n rac3 -i +ASM3

DISABLE
srvctl disable asm -n rac3 -i +ASM3

START
srvctl start asm -n rac3

STOP
srvctl stop asm -n rac3

CONFIG
srvctl config asm -n rac1

REMOVE
srvctl remove asm -n rac1
STATUS
srvctl status asm
srvctl status asm -n rac1

MODIFY
srvctl modify asm -o -n rac1

ASMLIB commands ( as root)
/etc/init.d/oracleasm start
/etc/init.d/oracleasm stop
/etc/init.d/oracleasm restart
/etc/init.d/oracleasm configure
/etc/init.d/oracleasm status
/etc/init.d/oracleasm enable
/etc/init.d/oracleasm disable
/etc/init.d/oracleasm listdisks
/etc/init.d/oracleasm deletedisk
/etc/init.d/oracleasm scandisks
/etc/init.d/oracleasm querydisk /dev/sdb1
/etc/init.d/oracleasm createdisk /dev/sdb1 VOL1
/etc/init.d/oracleasm renamedisk /dev/sdb1 VOL1

asmcmd Commands
cd -----changes the current directory to  the specified directory
du -----Displays the total disk space occupied by ASM files in the specified
           ASM directory and all its subdirectories, recursively.
find -----Lists the paths of all occurrences of the specified name ( with wildcards) under the specified directory.
ls +data/testdb ----Lists the contents of an ASM  director, the attributes of the specified file, or the names and attributes of all disk groups.
lsct -----Lists information about current ASM clients.
lsdg ----Lists all disk groups and their attributes
mkalias ----Creates an alias for a system generated filename.
mkdir -----Creates ASM directories.
pwd --------Displays the path of the current ASM directory.
rm        -------Deletes the specified ASM Files or directories.
rm -f       
rmalias ---------Deletes the specified alias, retaining the file that the alias points to
lsdsk ----------Lists disks visible to ASM.
md_backup ------Creates a backup of all of the mounted disk groups.
md_restore ------Restores disk groups from a backup.
remap ----repairs a range of physical blocks on a disk.
cp ------copies files into and out of ASM.
           **ASM diskgroup to OS file system.
           **OS file system to ASM diskgroup.
           **ASM diskgroup to another ASM diskgroup on the same server.
           **ASM disk group to ASM diskgroup on a remote server.

SYSASM Role (Starting in Oracle Database 11g)
SQL> Grant sysasm to sys; ---sysdba deprecated sqlplus / as sysasm

ASM Rolling Upgrades START
alter system start rolling migration to 11.2.0.2;

DISABLE
alter system stop rolling migration;

Database INIT parameters for ASM.
*.control_files='+DATA/orcl/controlfile/control1.ctl','+FRA/orcl/controlfile/control2.ctl'
*.db_create_file_dest='+DATA'
*.db_create_online_log_dest_1='+DATA'
*.db_recovery_file_dest='+DATA'
*.log_archive_dest_1='LOCATION=+DATA'
*.log_file_name_convert='+DATA/VISKDR','+DATA/VISK' ##added for DG

MIGRATE to ASM using RMAN
run
{
backup as copy database format '+DATA';
switch database to copy;
#For each logfile
sql "alter database rename '/data/oracle/VISK/redo1a.rdo' to '+DATA' ";
alter database open resetlogs;
#For each tempfile
sql "alter tablespace TEMP add tempfile" ;
}

Restore Database to ASM using SET NEWNAME 
run
{
allocate channel d1 type disk;
#For each datafile
set newname for datafile 1 to '+DATA';
restore database;
switch datafile all;
release channel d1;
}

source and reference:
http://www.dbaexpert.com



  

Monday, March 29, 2010

Why should we apply 10.2.0.4 patch set?

by Syed Jaffar Hussain

At least for us, it is not really necessary to apply every latest Oracle patch set on our databases unless we really need them. After knowing about the release of 10.2.0.4 patch set from Laurent and Mr.Doug's blogs, I thought of reading a metalink note that describes the list of bugs/issues fixed by this patch set. (ML Note : 401436.1).

While reading the note, following bug fixes really caught my attention:

- SYSTEM RESET of an spfile parameter can corrupt the SPFILE
- /*append parallel*/ can corrupt an index

-deadlock hang on "cursor: pin S wait on X" (typically from DBMS_STATS)

I have come across of many DBAs complaing about this behavior. Few links:

http://momendba.blogspot.com/2007/06/cursor-pin-s-wait-on-x-wait-event-in.html
http://www.dbaportal.eu/?q=node/49/print

I am really interested in the following bugs fix:

+ Higher CPU / Higher "cache buffer chains" latch gets / Higher "consistent gets" after truncate/Rebuild.

Jonathan Lewis and others have talked about this bug at their respective blogs

http://jonathanlewis.wordpress.com/2008/02/09/index-rebuild-10g/


Few other bugs fixed in this patch set:
+ Wrong results with bind variables/CURSOR_SHARING
5079978 High US enqueue contention in RAC
5387030 Automatic tuning of undo_retention causes unusual extra space allocation
5439554 "buffer busy wait" timeouts with automatic undo management and in memory undo
5442919 Expired extents not being reused (ORA-30036)
5512921 Instance crash caused by SMON OERI[kcblus_1] / dump

It been really a long list of bugs fixed in this patch set. From my personal experience prospective, I would say, first study the bugs fixed in the patch set before applying on a production database. If all resolving majority of your issues.

source and reference:
http://jaffardba.blogspot.com/2008/02/why-should-we-apply-10204-patch-set.html

Friday, March 26, 2010

Oracle 10gR2 RAC Installation in Linux 5, RHEL5 using VMware Server2

Oracle 10gR2 RAC Installation in RedHat 5 Linux Using VMware.
Important points to install 10gR2 oracle RAC in linux5.
1.LINUX 5(Redhat 5) doesn't have /etc/sysconfig/rawdevices file. so we have to configure it.
2. Edit the /etc/redhat-release version to redhat-4 and and to invoke the runInstaller  use the command
$runInstaller -ignoreSysPrereqs. //this will bypass the os check //
3. Next during clusterware installation at the end of root.sh in node 2 end with error message.So we have adjust the parameters in vipca and srvctl files.
4. vipca will fail to run. so we have to adjust some parameters and configure it manually.

rest of things are similar like RAC 11gR1 installation in linux5 using VMware.
please refer the documentation installing oracle 11gR1 RAC in LINUX5 using vmware. if you have any doubts in my installation steps.

step 1: vmware installation
step 2: guest 0S (LINUX 5) INSTALLATION.
step 3: pre installation steps for installing clusterware.
step 4: Install Vmware tools
step 5: creating  shared storage.
step 6: clone virtual machine.
step 7: Installing clusterware.
step 8: Installing oracle software.

Step 1.for vmware installation refer below link to install.


Step 2.Guest Operating system installation: Redhat 5 Linux .




















note: create tmp and swap with enough space. 
Continue through the OEL 5 installation as you would for a normal server. A general pictorial guide to the installation can be found here. More specifically, it should be a server installation with a minimum of 2G swap, firewall and SELinux disabled and the following package groups installed:
  • GNOME Desktop Environment
  • Editors
  • Graphical Internet
  • Text-based Internet
  • Development Libraries
  • Development Tools
  • Server Configuration Tools
  • Administration Tools
  • Base
  • System Tools
  • X Window System
To be consistent with the rest of the article, the following information should be set during the installation:
  • hostname: rac1.localdomain
  • IP Address eth0: 192.168.1.121 (public address)
  • Default Gateway eth0: 192.168.1.102
  • IP Address eth1: 192.168.2.131 (private address)
  • Default Gateway eth1: none
You are free to change the IP addresses to suit your network, but remember to stay consistent with those adjustments throughout the rest of the article.

Once the basic installation is complete, install the following packages whilst logged in as the root user.
# From Enterprise Linux 5 Disk 1
cd /media/cdrom/Server
rpm -Uvh binutils-2.*
rpm -Uvh elfutils-libelf-0.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh libaio-0.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh make-3.*
cd /
eject

# From Enterprise Linux 5 Disk 2
cd /media/cdrom/Server
rpm -Uvh compat-libstdc++-33*
rpm -Uvh elfutils-libelf-devel-*
rpm -Uvh glibc-headers*
rpm -Uvh glibc-devel-2.*
rpm -Uvh libgomp*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*
cd /
eject

# From Enterprise Linux 5 Disk 3
cd /media/cdrom/Server
rpm -Uvh sysstat-7.*
cd /
eject
if you have any doubts in installing 10g in linux please refer below link:

3. Pre Installation steps for installing clusterware and oracle software.
Oracle Installation Prerequisites
Perform the following steps whilst logged into the RAC1 virtual machine as the root user.

The /etc/hosts file must contain the following information.

    127.0.0.1       localhost.localdomain   localhost
    # Public
    192.168.1.121   rac1.localdomain        rac1
    192.168.1.122   rac2.localdomain        rac2
    #Private
    192.168.2.131   rac1-priv.localdomain   rac1-priv
    192.168.2.132   rac2-priv.localdomain   rac2-priv
    #Virtual
    192.168.1.111   rac1-vip.localdomain    rac1-vip
    192.168.1.112   rac2-vip.localdomain    rac2-vip

Add the following lines to the /etc/sysctl.conf file.

    kernel.shmmni = 4096
    # semaphores: semmsl, semmns, semopm, semmni
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 1024 65000
    net.core.rmem_default=4194304
    net.core.rmem_max=4194304
    net.core.wmem_default=262144
    net.core.wmem_max=262144

Run the following command to change the current kernel parameters.

    /sbin/sysctl -p

Add the following lines to the /etc/security/limits.conf file.

    oracle               soft    nproc   2047
    oracle               hard    nproc   16384
    oracle               soft    nofile  1024
    oracle               hard    nofile  65536

Add the following lines to the /etc/pam.d/login file, if it does not already exist.

    session    required     pam_limits.so

Disable secure linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows.

    SELINUX=disabled

Create the new groups and users.

    groupadd oinstall
    groupadd dba
    groupadd oper
    groupadd asmadmin

    useradd -u 500 -g oinstall -G dba,oper,asmadmin oracle
    passwd oracle

Create the directories in which the Oracle software will be installed.

    mkdir -p /u01/crs/oracle/product/10.2..0/crs
    mkdir -p /u01/app/oracle/product/10.2.0/db_1
    chown -R oracle:oinstall /u01

Edit the /etc/redhat-release file replacing the current release information (Red Hat Enterprise Linux Server release 5) with the following:
redhat-4
eg:
[root@rac1 ~]# vi /etc/redhat-release
redhat-4

Login as the oracle user and add the following lines at the end of the .bash_profile file.

    # Oracle Settings
    TMP=/tmp; export TMP
    TMPDIR=$TMP; export TMPDIR

    ORACLE_HOSTNAME=rac1.localdomain; export ORACLE_HOSTNAME
    ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
    ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
    ORACLE_TERM=xterm; export ORACLE_TERM
    PATH=/usr/sbin:$PATH; export PATH
    PATH=$ORACLE_HOME/bin:$PATH; export PATH

    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
    CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

    if [ $USER = "oracle" ]; then
      if [ $SHELL = "/bin/ksh" ]; then
        ulimit -p 16384
        ulimit -n 65536
      else
        ulimit -u 16384 -n 65536
      fi
    fi

The packages listed in this section (or later versions) are required for Oracle Clusterware 10g Release 2 and Oracle RAC 10g Release 2 running on the Oracle Enterprise Linux 5 platform.

32-bit (x86) Installations

    * binutils-2.17.50.0.6-2.el5
    * compat-libstdc++-296-2.96-138
    * compat-libstdc++-33-3.2.3-61
    * elfutils-libelf-0.125-3.el5
    * elfutils-libelf-devel-0.125
    * gcc-4.1.1-52
    * gcc-c++-4.1.1-52
    * glibc-2.5-12
    * glibc-common-2.5-12
    * glibc-devel-2.5-12
    * glibc-headers-2.5-12
    * libaio-0.3.106
    * libaio-devel-0.3.106
    * libgcc-4.1.1-52
    * libstdc++-4.1.1
    * libstdc++-devel-4.1.1-52.e15
    * libXp-1.0.0-8
    * make-3.81-1.1
    * openmotif-2.2.3
    * sysstat-7.0.0
    * unixODBC-2.2.11
    * unixODBC-devel-2.2.11

Step 4: Installing VMware tools

Login as the root user on the RAC1 virtual machine, then select the "Install VMware Tools" as shown in below picture.






Once the package is loaded, the CD should unmount automatically. You must then run the "vmware-config-tools.pl" script as the root user.
# vmware-config-tools.pl
Accept all the default settings and pick the screen resolution of your choice. Ignore any warnings or errors. The VMware client tools are now installed. Reboot the server before proceeding. After the reboot, it is possible the monitor will not be recognised. If this is the case don't panic. Follow the instructions provided on the screen and reconfigure the monitor setting, which will allow the XServer to function correctly.
Shut down the RAC1 virtual machine using the following command.
# shutdown -h now

Step 5: CREATE SHARED STORAGE DISKS

creating a shared storage disks
ocr 
votingdisk
asm1
asm2
asm3

here is a steps to create a ocr disk of size 1GB. follow the same steps to create voting disk and asm disks.

select add hardware button and then select HARD DISK.
Click browse button to select the shared storage disk.
create a folder shared for storage storage and select shared and type ocr.
select allocate all disk button.
its very important to select Independent persistent
select virtual device mode scsi1
select optimize for performance
and then click finish after than you can see the new added hard disk with size 1 gb and its properties.

Repeat the previous hard disk creation steps 4 more times, using the following values:
  • File Name: votingdisk
    Virtual Device Node: SCSI 1:1
    Mode: Independent and Persistent
  • File Name: asm1
    Virtual Device Node: SCSI 1:2
    Mode: Independent and Persistent
  • File Name: asm2
    Virtual Device Node: SCSI 1:3
    Mode: Independent and Persistent
  • File Name: asm3
    Virtual Device Node: SCSI 1:4
    Mode: Independent and Persistent
At the end of this process, the virtual machine should look something like the picture below.
Edit the contents of the "/u01/VM/RAC1/RAC1.vmx" file using a text editor, making sure the following entries are present. Some of the tries will already be present, some will not.
disk.locking = "FALSE"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.dataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"

scsi1.present = "TRUE"
scsi1.virtualDev = "lsilogic"
scsi1.sharedBus = "VIRTUAL"

scsi1:0.present = "TRUE"
scsi1:0.mode = "independent-persistent"
scsi1:0.fileName = "/u01/VM/shared/ocr.vmdk"
scsi1:0.deviceType = "plainDisk"
scsi1:0.redo = ""

scsi1:1.present = "TRUE"
scsi1:1.mode = "independent-persistent"
scsi1:1.fileName = "/u01/VM/shared/votingdisk.vmdk"
scsi1:1.deviceType = "plainDisk"
scsi1:1.redo = ""

scsi1:2.present = "TRUE"
scsi1:2.mode = "independent-persistent"
scsi1:2.fileName = "/u01/VM/shared/asm1.vmdk"
scsi1:2.deviceType = "plainDisk"
scsi1:2.redo = ""

scsi1:3.present = "TRUE"
scsi1:3.mode = "independent-persistent"
scsi1:3.fileName = "/u01/VM/shared/asm2.vmdk"
scsi1:3.deviceType = "plainDisk"
scsi1:3.redo = ""

scsi1:4.present = "TRUE"
scsi1:4.mode = "independent-persistent"
scsi1:4.fileName = "/u01/VM/shared/asm3.vmdk"
scsi1:4.deviceType = "plainDisk"
scsi1:4.redo = ""
Start the RAC1 virtual machine by clicking the "Power on this virtual machine" button on the VMware Server Console. When the server has started, log in as the root user so you can partition the disks. The current disks can be seen by issueing the following commands.
# cd /dev
# ls sd*
sda  sda1  sda2  sdb  sdc  sdd  sde  sdf
#
Use the "fdisk" command to partition the disks sdb to sdf. The following output shows the expected fdisk output for the sdb disk.
# fdisk /dev/sdb
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.


The number of cylinders for this disk is set to 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
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-1305, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305):
Using default value 1305

Command (m for help): p

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1305    10482381   83  Linux

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

Calling ioctl() to re-read partition table.
Syncing disks.
#
In each case, the sequence of answers is "n", "p", "1", "Return", "Return", "p" and "w".

Once all the disks are partitioned, the results can be seen by repeating the previous "ls" command.
# cd /dev
# ls sd*
sda  sda1  sda2  sdb  sdb1  sdc  sdc1  sdd  sdd1  sde  sde1  sdf  sdf1
#
/etc/sysconfig/rawdevices file is not available in the Linux 5 OS. SO we have to create a below file.

[root@rac1 ~]# vi /etc/udev/rules.d/63-oracle-raw.rules                                             
ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"                  
ACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw2 %N"                  
ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw3 %N"                  
ACTION=="add", KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw4 %N"                  
ACTION=="add", KERNEL=="sdf1", RUN+="/bin/raw /dev/raw/raw5 %N"                   
KERNEL=="raw[1]*", OWNER="root", GROUP="oinstall", MODE="640"                      
KERNEL=="raw[2-5]*", OWNER="oracle", GROUP="oinstall", MODE="644"                


[root@rac1 ~]# /bin/raw /dev/raw/raw1 /dev/sdb1                                                    
/dev/raw/raw1:  bound to major 8, minor 17                                                              
[root@rac1 ~]# /bin/raw /dev/raw/raw2 /dev/sdc1                                                    
/dev/raw/raw2:  bound to major 8, minor 33                                                              
[root@rac1 ~]# /bin/raw /dev/raw/raw3 /dev/sdd1                                                    
/dev/raw/raw3:  bound to major 8, minor 49                                                              
[root@rac1 ~]# /bin/raw /dev/raw/raw4 /dev/sde1                                                    
/dev/raw/raw4:  bound to major 8, minor 65                                                              
[root@rac1 ~]# /bin/raw /dev/raw/raw5 /dev/sdf1                                                     
/dev/raw/raw5:  bound to major 8, minor 81                                                              
[root@rac1 ~]# chown root:oinstall /dev/raw/raw1                                                   
[root@rac1 ~]# chown oracle:oinstall /dev/raw/raw2                                                
[root@rac1 ~]# chown oracle:oinstall /dev/raw/raw3                                                
[root@rac1 ~]# chown oracle:oinstall /dev/raw/raw4                                                
[root@rac1 ~]# chown oracle:oinstall /dev/raw/raw5                                                
[root@rac1 ~]# chmod 640 /dev/raw/raw1                                                               
[root@rac1 ~]# chmod 640 /dev/raw/raw2                                                               
[root@rac1 ~]# chmod 640 /dev/raw/raw3                                                               
[root@rac1 ~]# chmod 640 /dev/raw/raw4                                                               
[root@rac1 ~]# chmod 640 /dev/raw/raw5                                                               
      
add the following files in the file /etc/rc.local
                                                          
chown oracle:oinstall /dev/raw/raw1                                                  
chown oracle:oinstall /dev/raw/raw2                                               
chown oracle:oinstall /dev/raw/raw3                                               
chown oracle:oinstall /dev/raw/raw4                                               
chown oracle:oinstall /dev/raw/raw5                                               
chmod 640 /dev/raw/raw1                                                              
chmod 640 /dev/raw/raw2                                                              
chmod 640 /dev/raw/raw3                                                              
chmod 640 /dev/raw/raw4                                                              
chmod 640 /dev/raw/raw5                                                              
     
 Step 6: CLONE THE VIRTUAL MACHINE
The current version of VMware Server does not include an option to clone a virtual machine, but the following steps illustrate how this can be achieved manually.

Shut down the RAC1 virtual machine using the following command.
# shutdown -h now
Copy the RAC1 virtual machine using the following command.
# cp -R RAC1 RAC2
Edit the contents of the "/u01/VM/RAC2/RAC1.vmx" file, making the following change.
displayName = "RAC2"
 And then follow the steps as below:


 Edit the hostname to rac2.localdomain
#vi /etc/sysconfig/network
and
#hostname rac2.localdomain 
#vi /etc/hosts 
check the public,private and virtuals ips are correctly configured.

Start the RAC1 virtual machine and restart the RAC2 virtual machine. When both nodes have started, check they can both ping all the public and private IP addresses using the following commands. 
login as oracle user
ping -c 3 rac1
ping -c 3 rac1-priv
ping -c 3 rac2
ping -c 3 rac2-priv
Configure SSH on each node in the cluster. Log in as the "oracle" user and perform the following tasks on each node.
su - oracle
mkdir ~/.ssh
chmod 700 ~/.ssh
/usr/bin/ssh-keygen -t rsa # Accept the default settings.
The RSA public key is written to the ~/.ssh/id_rsa.pub file and the private key to the ~/.ssh/id_rsa file.

Log in as the "oracle" user on RAC1, generate an "authorized_keys" file on RAC1 and copy it to RAC2 using the following commands.
su - oracle
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
scp authorized_keys rac2:/home/oracle/.ssh/
Next, log in as the "oracle" user on RAC2 and perform the following commands.
su - oracle
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
scp authorized_keys rac1:/home/oracle/.ssh/
The "authorized_keys" file on both servers now contains the public keys generated on all RAC nodes.

To enable SSH user equivalency on the cluster member nodes issue the following commands on each node.
ssh rac1 date
ssh rac2 date
ssh rac1.localdomain date
ssh rac2.localdomain date
exec /usr/bin/ssh-agent $SHELL
/usr/bin/ssh-add
You should now be able to SSH and SCP between servers without entering passwords.

Before installing the clusterware, check the prerequisites have been met using the "runcluvfy.sh" utility in the clusterware root directory.
while running this you will get unsuccessful message no need to worry about this. ignore this only for vmware setup testing and education purpose, testing time no need to worry.
/home/oracle/clusterware/cluvfy/runcluvfy.sh stage -pre crsinst -n rac1,rac2 -verbose
 Step 7: Installing Clusterware Software

Install the Clusterware Software

Start the RAC1 and RAC2 virtual machines, login to RAC1 as the oracle user and start the Oracle installer.
$cd clusterware

To install 10gR2, you must first install the base release, which is 10.2.0.1. As these version of OS are newer, you should use the following command to invoke the installer:
$ runInstaller -ignoreSysPrereqs        // This will bypass the OS check //
note: Edit the /etc/redhat-release file replacing the current release information (Red Hat Enterprise Linux Server release 5 ) with the following:
redhat-4
./runInstaller -ignoreSysPrereqs

change the clusterware directory

if you didn't edit the redhat-release file,you will get error here, and it checks for required rpm packages.

add the rac2 host information



change eth0 to public


NEXT ,the ocr disk information, actually i forgot to take the snapshot              
select external redundancy and ocr disk location: /dev/raw/raw1  

For voting disk
select external redundancy and voting disk location:/dev/raw/raw2    


 first run /u01/app/oracle/oraInventory/oraInstRoot.sh in RAC1 after completion run it in RAC2
Second run /u01/crs/oracle/product/10.2.0/crs/root.sh in RAC1 after completion run it in RAC2
while running root.sh in RAC2 NODE it ends with warning message. so follow the below steps
[root@rac1 ~]# /u01/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oracle/oraInventory to 770.
Changing groupname of /u01/app/oracle/oraInventory to oinstall.
The execution of the script is complete

[root@rac2 ~]# /u01/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oracle/oraInventory to 770.
Changing groupname of /u01/app/oracle/oraInventory to oinstall.
The execution of the script is complete

[root@rac1 ~]# /u01/crs/oracle/product/10.2.0/crs/root.sh
WARNING: directory '/u01/crs/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u01/crs/oracle/product' is not owned by root
WARNING: directory '/u01/crs/oracle' is not owned by root
WARNING: directory '/u01/crs' is not owned by root
WARNING: directory '/u01' 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 '/u01/crs/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u01/crs/oracle/product' is not owned by root
WARNING: directory '/u01/crs/oracle' is not owned by root
WARNING: directory '/u01/crs' is not owned by root
WARNING: directory '/u01' is not owned by root
assigning default hostname rac1 for node 1.
assigning default hostname rac2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: rac1 rac1-priv rac1
node 2: rac2 rac2-priv rac2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /dev/raw/raw2
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.
        rac1
CSS is inactive on these nodes.
        rac2
Local node checking complete.
Run root.sh on remaining nodes to start CRS daemons.


[root@rac2 ~]# /u01/crs/oracle/product/10.2.0/crs/root.sh
WARNING: directory '/u01/crs/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u01/crs/oracle/product' is not owned by root
WARNING: directory '/u01/crs/oracle' is not owned by root
WARNING: directory '/u01/crs' is not owned by root
WARNING: directory '/u01' 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 '/u01/crs/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u01/crs/oracle/product' is not owned by root
WARNING: directory '/u01/crs/oracle' is not owned by root
WARNING: directory '/u01/crs' is not owned by root
WARNING: directory '/u01' is not owned by root
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
assigning default hostname rac1 for node 1.
assigning default hostname rac2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: rac1 rac1-priv rac1
node 2: rac2 rac2-priv rac2
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.
        rac1
        rac2
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
/u01/crs/oracle/product/10.2.0/crs/jdk/jre//bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory

At end of root.sh on the last node vipca will fail to run with the following error:

Oracle CRS stack installed and running under init(1M)
Running vipca(silent) for configuring nodeapps
/home/oracle/crs/oracle/product/10/crs/jdk/jre//bin/java: error while loading
shared libraries: libpthread.so.0: cannot open shared object file:
No such file or directory

Also, srvctl will show similar output if workaround below is not implemented.

edit vipca (in the CRS bin directory on all nodes) to undo the setting of LD_ASSUME_KERNEL. After the IF statement around line 123 add an unset command to ensure LD_ASSUME_KERNEL is not set as follows:
if [ "$arch" = "i686" -o "$arch" = "ia64" -o "$arch" = "x86_64" ]
then
  LD_ASSUME_KERNEL=2.4.19
  export LD_ASSUME_KERNEL
fi

unset LD_ASSUME_KERNEL         <<<== Line to be added

Similarly for srvctl (in both the CRS and, when installed, RDBMS and ASM bin directories on all nodes), unset LD_ASSUME_KERNEL by adding one line, around line 168 should look like this:
LD_ASSUME_KERNEL=2.4.19
export LD_ASSUME_KERNEL

unset LD_ASSUME_KERNEL          <<<== Line to be added

Remember to re-edit these files on all nodes:
/bin/vipca
/bin/srvctl
/bin/srvctl
/bin/srvctl


after successful editing of files vipca and srvctl files in bin folder of CRS_HOME directory.

run ./vipca to configure virtual ip manually you will get this error.

 vipca will fail to run with the following error if the VIP IP's are in a non-routable range [10.x.x.x, 172.(16-31).x.x or 192.168.x.x]:
# vipca
Error 0(Native: listNetInterfaces:[3])
[Error 0(Native: listNetInterfaces:[3])]
(vipca failing on non-routable VIP IP ranges, manually or during root.sh), if you still have the OUI window open, click OK and it will create the "oifcfg" information, then cluvfy will fail due to vipca not completed successfully, skip below in this note and run vipca manually then return to the installer and cluvfy will succeed.  Otherwise you may configure the interfaces for RAC manually using the oifcfg command as root, like in the following example (from any node):


click ok button.


it wills gives the error. follow the steps. dont click next button.

login as root user in node RAC2,
/bin # ./oifcfg setif -global eth0/192.168.1.122:public
/bin # ./oifcfg setif -global eth1/192.168.2.132:cluster_interconnect

/bin # ./oifcfg getif


The goal is to get the output of "oifcfg getif" to include both public and cluster_interconnect interfaces, of course you should exchange your own IP addresses and interface name from your environment. To get the proper IPs in your environment run this command:
/bin # ./oifcfg iflist


[root@rac2 bin]# ./oifcfg setif -global eth0/192.168.1.122:public
[root@rac2 bin]# ./oifcfg setif -global eth1/192.168.2.132:cluster_interconnect
[root@rac2 bin]# ./oifcfg getif
eth0  192.168.1.0  global  public
eth0  192.168.1.122  global  public
eth1  192.168.2.0  global  cluster_interconnect
eth1  192.168.2.132  global  cluster_interconnect
[root@rac2 bin]# ./oifcfg iflist
eth0  192.168.1.0
eth1  192.168.2.0
[root@rac2 bin]#

And then run vipca.
/bin # ./vipca

click next
click next

enter rac1-vip.localdomain




click the retry button

[root@rac1 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@rac1 bin]# ./crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    ONLINE    rac1       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    ONLINE    rac2       
[root@rac1 bin]#

 [root@rac2 bin]# ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@rac2 bin]# ./crs_stat -t
Name           Type           Target    State     Host      
------------------------------------------------------------
ora.rac1.gsd   application    ONLINE    ONLINE    rac1      
ora.rac1.ons   application    ONLINE    ONLINE    rac1      
ora.rac1.vip   application    ONLINE    ONLINE    rac1      
ora.rac2.gsd   application    ONLINE    ONLINE    rac2      
ora.rac2.ons   application    ONLINE    ONLINE    rac2      
ora.rac2.vip   application    ONLINE    ONLINE    rac2      
[root@rac2 bin]# 



step 8: Installing oracle software

 follow the same steps given in the below link. except invoking runInstaller.

Start the RAC1 and RAC2 virtual machines, login to RAC1 as the oracle user and start the Oracle installer.
To install 10gR2, you must first install the base release, which is 10.2.0.1. As these version of OS are newer, you should use the following command to invoke the installer:
$ runInstaller -ignoreSysPrereqs        // This will bypass the OS check //

 
./runInstaller -ignoreSysPrereqs
On the "Welcome" screen, click the "Next" button.
rest of the things are similar in the given link documentation
 installing database software and create asm

for any queries please contact me any time.
Regards,
Rajeshkumar Govindarajan
Oracle DBA
ConscientiaDBS
grk.oracle@gmail.com
free counters
 
Share/Bookmark