Visit Counter

Tuesday, July 28, 2015

Changing Mount point in Solaris 10 Sparc





# cd /

#  umount /data1

# mkdr /ora

#  mount /dev/md/dsk/d6  /ora


#  vi  /etc/vfstab

/ora              (Existing name is data1)


# df -h

# cat /etc/vfstab

#  metastat


Wednesday, April 15, 2015

Oracle Basic RAC Administration Commands



Oracle RAC Basic Administration Commands.

1. Startup / Download database (all nodes)


/ora/12/grid/bin

[oracle@rac1 bin]$ ./srvctl status database -d racora1
Instance racora11 is running on node rac1
Instance racora12 is running on node rac2
Instance racora13 is running on node rac3
[oracle@rac1 bin]$

[oracle@rac1 bin]$ ./srvctl stop database -d racora1

[oracle@rac1 bin]$ ./srvctl status database -d racora1
Instance racora11 is not running on node rac1
Instance racora12 is not running on node rac2
Instance racora13 is not running on node rac3

[oracle@rac1 bin]$ ./srvctl start  database -d racora1

[oracle@rac1 bin]$ ./srvctl status database -d racora1
Instance racora11 is running on node rac1
Instance racora12 is running on node rac2
Instance racora13 is running on node rac3
[oracle@rac1 bin]$



[oracle@rac1 bin]$ ./sqlplus /nolog

SQL*Plus: Release 12.1.0.1.0 Production on Tue Apr 14 21:43:23 2015

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

SQL> conn sys/afi123@racora1 as sysdba
Connected.
SQL> select inst_name from v$active_instances;

INST_NAME
------------------------------------------------------------
rac1.localdomain:racora11
rac2.localdomain:racora12
rac3.localdomain:racora13



SQL> !cat /etc/oratab
#Backup file is  /ora/oracle/app/oracle/product/12.1.0/dbhome_1/srvm/admin/oratab.bak.rac1 line added by Agent
#



# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM1:/ora/12/grid:N: # line added by Agent
racora1:/ora/oracle/app/oracle/product/12.1.0/dbhome_1:N: # line added by Agent

SQL>

SQL> startup
ORACLE instance started.

Total System Global Area  705662976 bytes
Fixed Size    2292384 bytes
Variable Size  360711520 bytes
Database Buffers  339738624 bytes
Redo Buffers    2920448 bytes
Database mounted.
Database opened.
SQL>


SQL> select instance_name,status from gv$instance;

INSTANCE_NAME STATUS
---------------- ------------
racora12 OPEN
racora11 OPEN
racora13 OPEN


2. Start / Stop & check CRS (Cluster Ready Service)


[oracle@rac1 bin]$ ./crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online


[oracle@rac1 bin]$ ./crs_stat -t
Name           Type           Target    State     Host      
------------------------------------------------------------
ora.DATA.dg    ora....up.type ONLINE    ONLINE    rac1      
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1      
ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac1      
ora....N2.lsnr ora....er.type ONLINE    ONLINE    rac3      
ora....N3.lsnr ora....er.type ONLINE    ONLINE    rac2      
ora.asm        ora.asm.type   ONLINE    ONLINE    rac1      
ora.cvu        ora.cvu.type   ONLINE    ONLINE    rac2      
ora....network ora....rk.type ONLINE    ONLINE    rac1      
ora.oc4j       ora.oc4j.type  OFFLINE   OFFLINE              
ora.ons        ora.ons.type   ONLINE    ONLINE    rac1      
ora....SM1.asm application    ONLINE    ONLINE    rac1      
ora....C1.lsnr application    ONLINE    ONLINE    rac1      
ora.rac1.ons   application    ONLINE    ONLINE    rac1      
ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1      
ora....SM2.asm application    ONLINE    ONLINE    rac2      
ora....C2.lsnr application    ONLINE    ONLINE    rac2      
ora.rac2.ons   application    ONLINE    ONLINE    rac2      
ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2      
ora....SM3.asm application    ONLINE    ONLINE    rac3      
ora....C3.lsnr application    ONLINE    ONLINE    rac3      
ora.rac3.ons   application    ONLINE    ONLINE    rac3      
ora.rac3.vip   ora....t1.type ONLINE    ONLINE    rac3      
ora.racdb.db   ora....se.type ONLINE    OFFLINE              
ora.racora1.db ora....se.type ONLINE    ONLINE    rac1      
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac1      
ora.scan2.vip  ora....ip.type ONLINE    ONLINE    rac3      
ora.scan3.vip  ora....ip.type ONLINE    ONLINE    rac2      


[oracle@rac1 bin]$ ./crsctl check cluster -all
**************************************************************
rac1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
rac2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
rac3:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************


3. Start /Stop an individual instance

[oracle@rac1 bin]$ ./srvctl stop instance -d racora1 -i racora13
[oracle@rac1 bin]$ ./srvctl start instance -d racora1 -i racora13

4. Locate the voting Disk


[oracle@rac1 bin]$ ./crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   825b153bbbc84fa7bf3f735175abf312 (/dev/oracleasm/disks/DISK1) [DATA]
Located 1 voting disk(s).

[oracle@rac1 bin]$ ocrcheck
bash: ocrcheck: command not found
[oracle@rac1 bin]$ ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version                  :          4
Total space (kbytes)     :     409568
Used space (kbytes)      :       1628
Available space (kbytes) :     407940
ID                       : 1066761921
Device/File Name         :      +DATA
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

Cluster registry integrity check succeeded

Logical corruption check bypassed due to non-privileged user


5. To prevent a database starting at boot time.

[oracle@rac1 bin]$ ./srvctl disable database -d racora1



Thursday, April 9, 2015

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED



I've got this message below when trying to connect via SSH.


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the RSA key sent by the remote host is 51:82:00:1c:7e:6f:ac:ac:de:f1:53:08:1c:7d:55:68. Please contact your system administrator. Add correct host key in /Users/isaacalves/.ssh/known_hosts to get rid of this message. Offending RSA key in /Users/isaacalves/.ssh/known_hosts:12 RSA host key for 104.131.16.158 has changed and you have requested strict checking. Host key verification failed.


#cd .ssh
#vi known_hosts

192.0.0.10 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAz6ja9nTPW/DnrUpr81ch Mwb7FXI/pfUVmIxryY/M+6AVIZgTydSVf4wcsyRzCW4R2OzNBx7my59pYpdUd2pVIvzLUr1CEMEVer2x Ej1EVJuziACVv7c+vsfamoD5I9ePTOPE99QzkL70LS85hraGHJclY2bQmrulnbW/75Fhl6k=afi-ssaerp2,192.0.0.11 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAzlXY5C/s36VI0Lkq9wDG
YJnoBufIAD2hDyfC75An1hlVar4gahWmOu191M3ZjpVOT6kZalpNmsL8+XCC3xVcKAWdqiSmDujwUjN1 nryDGT2cY8ml84tIMZat6PaFywdQ20f/nlOjtkP3nMcha1+EUoVlPPzuSI1WEWgIrYjSLE0=
192.0.0.25 ssh-rsa AAAABBAAAAB3NzaC1yc2EAAAABIwAAAIEA8Xcy1QiFMu4xQPOxoKrTf/InqJUi1VERJvoZb7jmv1rcUVTiDFlJJ7PXCgeGjyvUDpUuCd6Zy+1hgcQaSx9/XLB59x9PMEcZDPmwj6dsv4wajZA/v
AyOUbGyHFTpX250bHoq8SvdR9R3iSQ3JYSZ6byZlmX7TwTHt2UihRBMIq8=



I deleted above lines in .ssh/known_hosts to resolve this issue.
Since you updated your ssh key, getting the above message is normal.
Just edit ~/.ssh/known_hosts and delete line 7, as the message pointed you.

Wednesday, April 8, 2015

[INS-30160] Installer has detected the nodes specified for add node operation have uncleaned Inventory



I encountered this error while extending   2 node 12c cluster to 3 nodes.
















Cause:
In /ora/oracle/app/oraInventory directory there was an oraInventory directory exists. Though the directory is emptly oui still assuming that there is some content in this directory.
Action:
Delete/Remove oraInventory directory from nodes3 on which you are facing Issues. OUI will create this directory after successful addition of nodes.

Tuesday, April 7, 2015

Adding new node to 12c RAC Cluster



This is a step by step article for adding a new node to an existing 2  node 12c Grid Infrastructure cluster. I've demonstrated this post on virtual box. This post will be helpful for those who wants to practice adding of nodes for TESTING/DEMONSTRATION purpose and it will be also helpful for those who wants to add a node in a real production environment.



1) Install OS same as other surviving cluster nodes
2) Configure shared Storage
3) Configure network (public, private and virtual)
4) Configure all OS pre-requisites (users, groups, directories, kernel parameters etc)
5) Run cluvfy to verify addition of node
6) Add node to an existing 12c cluster
7) Verify Services on all cluster nodes
8) Add Instance to a third node























































 Configure SSH Setup for racnode1 racnode2 racnode3


$ mkdir .ssh  (Under /ora/oracle/.ssh) if directory not exists.
$ chmod 700 .ssh
$ /usr/bin/ssh-keygen -t  dsa

At the prompts, accept the default location for the key file (press Enter).


Same steps you have to do in rac2,rac3
Then, add the DSA key to the authorized_keys file using the following commands:
$ ls
$ cat id_dsa.pub >> authorized_keys
$ scp authorized_keys rac2:/ora/oracle/.ssh/


















RAC3 


$cat id_dsa.pub >> authorized_keys



All racnodes having authorized_keys file including each racnode id_dsa.pub content as well.

Here u can see the authorized_keys file rac1.localdomain,rac2.localdomain,rac3.localdomain entries.




Verify ssh setup from all cluster nodes:


RAC1
-----------------------------------------------

$ssh rac2 date

return date

$ ssh rac3 date

retrun date

-------------------------------------------------


RAC2
-------------------------------------------------

$ssh rac1 date
return date
$ssh rac3 date
return date

RAC3
---------------------------------------------------

$ssh rac1 date
$ssh rac2 date



- Run cluvfy to verify all pre-requisites are in place and node is ready to be added in an existing cluster.

[oracle@rac1] cd /ora/12/grid/bin/
[oracle@rac1] cluvfy stage -pre nodeadd -n rac3 -verbose


6) Add node to an existing 12c cluster:

[oracle@rac1] cd /ora/12/grid/bin/
[oracle@rac1] ./addnode.sh

























running root.sh script:


[root@racnode3 ~]# /u01/oraInventory/orainstRoot.sh
Changing permissions of /u01/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/oraInventory to dbarac.
The execution of the script is complete.
[root@racnode3 ~]# 



------------------


[root@racnode3 ~]# sh /u01/grid_12c/root.sh
Performing root user operation for Oracle 12c 

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /ora/12/grid/

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
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 script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
Using configuration parameter file: /u01/grid_12c/crs/install/crsconfig_params
2014/05/13 10:58:57 CLSRSC-363: User ignored prerequisites during installation

OLR initialization - successful
2014/05/13 10:59:39 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.conf'

CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'racnode3'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'racnode3'
CRS-2677: Stop of 'ora.drivers.acfs' on 'racnode3' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'racnode3' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Starting Oracle High Availability Services-managed resources
CRS-2672: Attempting to start 'ora.mdnsd' on 'rac3'
CRS-2672: Attempting to start 'ora.evmd' on 'rac3'
CRS-2676: Start of 'ora.mdnsd' on 'racnode3' succeeded
CRS-2676: Start of 'ora.evmd' on 'racnode3' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'rac3'
CRS-2676: Start of 'ora.gpnpd' on 'racnode3' succeeded
CRS-2672: Attempting to start 'ora.gipcd' on 'racnode3'
CRS-2676: Start of 'ora.gipcd' on 'racnode3' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac3'
CRS-2676: Start of 'ora.cssdmonitor' on 'racnode3' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'rac3'
CRS-2672: Attempting to start 'ora.diskmon' on 'rac3'
CRS-2676: Start of 'ora.diskmon' on 'racnode3' succeeded
CRS-2789: Cannot stop resource 'ora.diskmon' as it is not running on server 'racnode3'
CRS-2676: Start of 'ora.cssd' on 'racnode3' succeeded
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'racnode3'
CRS-2672: Attempting to start 'ora.ctssd' on 'racnode3'
CRS-2676: Start of 'ora.ctssd' on 'racnode3' succeeded
CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'racnode3' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'rac3'
CRS-2676: Start of 'ora.asm' on 'racnode3' succeeded
CRS-2672: Attempting to start 'ora.storage' on 'rac3'
CRS-2676: Start of 'ora.storage' on 'racnode3' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'rac3'
CRS-2676: Start of 'ora.crsd' on 'racnode3' succeeded
CRS-6017: Processing resource auto-start for servers: racnode3
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN2.lsnr' on 'racnode2'
CRS-2672: Attempting to start 'ora.ons' on 'rac3'
CRS-2672: Attempting to start 'ora.DATA.dg' on 'rac3'
CRS-2677: Stop of 'ora.LISTENER_SCAN2.lsnr' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.scan2.vip' on 'rac2'
CRS-2677: Stop of 'ora.scan2.vip' on 'racnode2' succeeded
CRS-2672: Attempting to start 'ora.scan2.vip' on 'rac3'
CRS-2676: Start of 'ora.scan2.vip' on 'racnode3' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN2.lsnr' on 'racnode3'
CRS-2676: Start of 'ora.ons' on 'racnode3' succeeded
CRS-2676: Start of 'ora.DATA.dg' on 'racnode3' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN2.lsnr' on 'racnode3' succeeded
CRS-6016: Resource auto-start has completed for server racnode3
CRS-6024: Completed start of Oracle Cluster Ready Services-managed resources
CRS-4123: Oracle High Availability Services has been started.
2014/05/13 11:06:04 CLSRSC-343: Successfully started Oracle clusterware stack

clscfg: EXISTING configuration version 5 detected.
clscfg: version 5 is 12c Release 1.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
2014/05/13 11:06:32 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... suceeded