Thursday, April 16, 2015

Oracle Database 11gR2 Version 11.2.0.3 Installation

Note :-- # is root user
               $ is oracle user

Enviornment

1)      OS RHEL 5.8

2)      Database Version 11.2.0.3

3)      Filesystem

Steps

1)      Execute below command for pre-install the requisite
# yum install oracle-rdbms-server-11gR2-preinstall

2)      After transferring the software to server .unzip and set DISPLAY value

[oracle@rac4 software]$ export DISPLAY=192.168.56.1:0.0

[oracle@rac4 software]$ cd database

[oracle@rac4 database]$ pwd

/u03/software/database

[oracle@rac4 database]$ ls -ltr

total 64

-rwxr-xr-x  1 oracle oinstall  5466 Aug 22  2011 welcome.html

drwxr-xr-x 12 oracle oinstall  4096 Sep 18  2011 doc

-rwxr-xr-x  1 oracle oinstall  3226 Sep 22  2011 runInstaller

drwxr-xr-x  2 oracle oinstall  4096 Sep 22  2011 rpm

drwxr-xr-x  2 oracle oinstall  4096 Sep 22  2011 response

drwxr-xr-x  4 oracle oinstall  4096 Sep 22  2011 install

drwxr-xr-x 14 oracle oinstall  4096 Sep 22  2011 stage

drwxr-xr-x  2 oracle oinstall  4096 Sep 22  2011 sshsetup

-rwxr-xr-x  1 oracle oinstall 28122 Sep 22  2011 readme.html

 

3)      Execute runInstaller

[oracle@rac4 database]$ ./runInstaller

Starting Oracle Universal Installer...

 

Checking Temp space: must be greater than 120 MB.   Actual 8955 MB    Passed

Checking swap space: must be greater than 150 MB.   Actual 10236 MB    Passed

Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-04-16_05-22-12PM. Please wait ...[oracle@rac4 database]$

 

4)      Uncheck the “I wish to receive …”

5)      Click next .. Check Skip software updates

6)      Check install software only

7)      Check single instance database installation

8)      Select Language English

9)      select enterprise edition

10)   Specify path

11)   select value

12)   Fix any error or warning . If not click install

13)   Installation in progress

14)   Run the script as root user

[root@rac4 ~]# /u01/app/oracle/product/11.2.0/dbhome_2/root.sh

Performing root user operation for Oracle 11g

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/dbhome_2

 

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.

Finished product-specific root actions.

[root@rac4 ~]#

15)   Look for the below message

The installation of oracle database was successful

16)   Run dbca after setting oracle home

17)   select create a database

18)   select general purpose or transaction processing

19)   provide database name

20)   click next for couple of screen and provide input as asked

Wednesday, April 15, 2015

Untitled 1

 

Day 53.1:-- 04/15/2015

Cluster Commands for 11gR2 Release 11.2.0.3

Note :-- In Command database name is db and instance are db1,db2,db3
               $ ->> oracle user
               # ->> root user

After Cluster start execute below command to check cluster status

1)      crsctl check cluster –all

2)      crsctl status resource –t

Checking status of different component

1)      Checking CRS of specific node

n  $ crsctl check crs

2)      Checking database status

n  $ srvctl status database –d db

3)      Checking the instance status

n  $ srvctl status instance -d db -i db1,db2,db3

4)      service status

n  $ srvctl status service –d db

5)      nodeapps status

n  $ srvctl status nodeapps

6)      asm status

n  $ srvctl status asm

7)      type status

n  $ crsctl status type

8)      ip status

n  $ crsctl status ip -A {<IP_name>|<IP_address>}

9)      server status

n  $ crsctl status server

10)   serverpool status

n  $ crsctl status serverpool

11)   testdns status

n  $ crsctl status testdns

12)   cvu status

n  $ srvctl status cvu

13)   Datagroup status

n  $ srvctl status diskgroup -g data_dg1

14)   filesystem status

n  $ srvctl status filesystem -d db

15)   gns status

n  $ srvctl status gns

16)   home status

n  # srvctl status home -o /u02/app/11.2.0.3/grid -s as -n rac1

17)   Listener status

n  $ srvctl status listener

18)   oc4j status

n  $ srvctl status oc4j

19)   SCAN VIP status

n  $ srvctl status scan

20)   scan_listener status

n  $ srvctl status scan_listener

21)   srvpool status

n  $ srvctl status srvpool

22)   vip status

n  $ srvctl status vip –n rac1

Check Configuration of different component

23)   config database

n  $ srvctl config database –d db

24)   config service

n  $ srvctl config service –d db

25)   config nodeapps

n  $ srvctl config nodeapps

26)   config asm

n  $ srvctl config asm

27)   config listener

n  $ srvctl config listener

28)   config has

n  # crsctl config has

29)   config cvu

n  $ srvctl config cvu

30)   config filesystem

n  $ srvctl config filesystem –d db

31)   config gns

n  $ srvctl config gns

32)   config oc4j

n  $ srvctl config oc4j

33)   config scan-vip

n  $ srvctl config scan

34)   config scan listener

n  $ srvctl config scan_listener

35)   config srvpool

n  $ srvctl config srvpool

36)   config vip

n  $ srvctl config vip –n rac1

Checking getenv of different component

37)   getenv asm

n  $ srvctl getenv asm

38)   getenv database

n  $ srvctl getenv database -d db

39)   getenv listener

n  $ srvctl getenv listener

40)   getenv nodeapps

n  $ srvctl getenv nodeapps

 

Tuesday, April 14, 2015

Deleting a Node from 3 Node RAC

Note :-- command are marked as orange

Enviornment

1)      RHEL 5.8

2)      Database/Cluster Version 11.2.0.3

3)      GRID_HOME and ORACLE_HOME not shared across node

Steps

1)      login to node 1  rac1 and run the below command

2)      olsnodes –s –t

[oracle@rac1 ~]$ /u02/app/11.2.0.3/grid/bin/olsnodes -s -t

rac1    Active  Unpinned

rac2    Active  Unpinned

rac3    Active  Unpinned

 

If the node is pinned, then run the crsctl unpin css command. Otherwise, proceed to the next step.

3)      Login to the node which needs to be deleted stop emagent

4)      /u01/app/oracle/product/11.2.0.3/db_1/bin/emctl stop dbconsole

5)      login to node 3 which needs to be deleted . Run below command for stopping the cluster running on node3

login as root user
# /u02/app/11.2.0.3/grid/crs/install/rootcrs.pl –deconfig –force

6)      login to node 1 and run the following command as root user

# /u02/app/11.2.0.3/grid/bin/crsctl delete node –n rac3

7)      login to node 3 as grid user say oracle run the below command

$/u02/app/11.2.0.3/grid/oui/bin/runInstaller -updateNodeList ORACLE_HOME=Grid_home "CLUSTER_NODES={rac3}" CRS=TRUE -silent –local

8)      login to node 3run the command  as grid user say “oracle”
$/u02/app/11.2.0.3/grid/deinstall/deinstall –local

9)      login to node 1 and run the below command as grid user say “oracle”

$/u02/app/11.2.0.3/grid/oui/bin/runInstaller -updateNodeList ORACLE_HOME=Grid_home "CLUSTER_NODES={rac1,rac2}" CRS=TRUE –silent

10)   Run the command from node 1 as grid user say “oracle”

$ /u02/app/11.2.0.3/grid//bin/cluvfy stage -post nodedel -n rac3

Reference Link :-- http://docs.oracle.com/cd/E11882_01/rac.112/e41959/adddelclusterware.htm#CWADD90995
Adding Node to 2 Node RAC

Adding Node to 2 Node RAC

 

 

Environment

n  RHEL 5.8

n  11.2.0.3 database version

Follow Below Steps

n  export ORACLE_HOME=/u01/app/11.2.0/grid

n  cd $ORACLE_HOME/bin

n  ./cluvfy stage -pre crsinst -n rac1,rac2,rac3 –verbose

n  cd ../oui/bin

n  pwd

n  /u01/app/11.2.0/grid/oui/bin

n  ./addNode.sh -silent "CLUSTER_NEW_NODES={rac3}" "CLUSTER_NEW_VIRTUAL_HOSTNAMES={rac3-vip}"

n  In case of warning

-----------------------------------------------------------------------------
Instantiating scripts for add node (Wednesday, April 8, 2015 7:17:58 PM MDT)

.                                                                 1% Done.

Instantiation of add node scripts complete

 

Copying to remote nodes (Wednesday, April 8, 2015 7:18:03 PM MDT)

...............................................................................................                                 96% Done.

Home copied to new nodes

 

Saving inventory on nodes (Wednesday, April 8, 2015 7:22:06 PM MDT)

SEVERE:Remote 'UpdateNodeList' failed on nodes: 'rac2'. Refer to '/u01/app/oraInventory1/logs/addNodeActions2015-04-08_07-17-45PM.log' for details.

You can manually re-run the following command on the failed nodes after the installation:

 /u01/app/11.2.0/grid/oui/bin/runInstaller -updateNodeList -noClusterEnabled ORACLE_HOME=/u01/app/11.2.0/grid CLUSTER_NODES=rac1,rac2,rac3,rac4 CRS=true  "INVENTORY_LOCATION=/u01/app/oraInventory1" -invPtrLoc "/u01/app/11.2.0/grid/oraIns

t.loc" LOCAL_NODE=<node on which command is to be run>.

Please refer 'UpdateNodeList' logs under central inventory of remote nodes where failure occurred for more details.

.                                                               100% Done.

Save inventory complete

WARNING:A new inventory has been created on one or more nodes in this session. However, it has not yet been registered as the central inventory of this system.

To register the new inventory please run the script at '/u01/app/oraInventory1/orainstRoot.sh' with root privileges on nodes 'rac4'.

If you do not register the inventory, you may not be able to update or patch the products you installed.

The following configuration scripts need to be executed as the "root" user in each cluster node.

/u01/app/oraInventory1/orainstRoot.sh #On nodes rac4

/u01/app/11.2.0/grid/root.sh #On nodes rac4

To execute the configuration scripts:

    1. Open a terminal window

    2. Log in as "root"

    3. Run the scripts in each cluster node

 

The Cluster Node Addition of /u01/app/11.2.0/grid was successful.

Please check '/tmp/silentInstall.log' for more details.

[oracle@rac1 bin]$

n  /u01/app/oraInventory1/orainstRoot.sh

The above step completes 1st part of Adding a Node . The above copies grid binaries to other node

                Part II

               Transfering Oracle binaries to Other Node

n  cd /u01/app/oracle/product/11.2.0/dbhome_1/oui/bin

n  ./addNode.sh -silent "CLUSTER_NEW_NODES={rac3}"

n  Run DBCA to add instance from RAC1

n  ./dbca

n  “Oracle Real Application Clusters Database” and then “select Instance Management” and then select “add instance”

Monday, April 13, 2015

Disabling virbr0 interface on RHEL

All command needs to be executed as root user
Step 1 :-- ifconfig
step 2 :-- virsh net-list
step 3 :-- virsh net-destroy default
step 4 :-- virsh net-undefine default
step 5 :-- service libvirtd restart

step 6 :-- ifconfig

Saturday, April 11, 2015

Oracle Database Post – Installation Task


Post Database Installation Steps

Oracle recommends that you back up the root.sh script after you complete an installation. 

Set the language preferences for clients connecting to the database by setting the NLS_LANG environment variable.

The NLS_LANG environment variable declares the language and territory character sets that client applications use to connect to the database

Use the following guidelines only if the default semaphore parameter values are too low to accommodate all Oracle processes:

Calculate the minimum total semaphore requirements using the following formula

sum (process parameters of all database instances on the system) + overhead for oracle background processes + system and other application requirements

   Set semmns (total semaphores systemwide) to this total.

   Set semmsl (semaphores per set) to 250.

    Set semmni (total semaphores sets) to semmns/semmslrounded up to the nearest multiple of 1024.

 Enabling and Disabling Database Options

When you install Oracle Database, some options are enabled and others are disabled. To enable or disable a particular database feature for an Oracle home, shut down the database and use the chopt tool

The chopt tool is a command-line utility that is located in theORACLE_HOME/bin directory. The syntax for chopt is:

 chopt [ enable | disable] db_optio
The possible values for db_option are described in the following table:

 

Value

Description

dm

Oracle Data Mining RDBMS Files

olap

Oracle OLAP

partitioning

Oracle Partitioning

rat

Oracle Real Application Testing

Example 8-1 Complete Example of Running the Chopt Tool

To enable the Oracle Data Mining option in your Oracle binary files, use the following command:

cd $ORACLE_HOME/bin
srvctl stop database -d myDb
chopt enable dm
srvctl start database -d myDb
---------------------------------------------------------------------

Downloading and Installing theORAchk Health Check Tool

ORAchk replaces the RACCheck utility. ORAchk extends health check coverage to the entire Oracle software stack, and identifies and addresses top issues reported by Oracle users.


You must run the utlrp.sql script after creating or upgrading a database


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

Setting TCP Network Protocol Buffer for Direct NFS Client

To check the current TCP buffer size, enter the following command:

# sysctl -a |grep -e net.ipv4.tcp_[rw]mem

The output of this command is similar to the following:

→net.ipv4.tcp_rmem = 4096        87380   1048576
→net.ipv4.tcp_wmem = 4096        16384   1048576
As root, use a text editor to open /etc/sysctl.conf, and add or change to the following:

# net.ipv4.tcp_rmem = 4096        87380   4194304

 # net.ipv4.tcp_wmem = 4096        16384   419430

  1. Restart the network:

# /etc/rc.d/init.d/network restart

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


  Diagnosing a long parsing issue in Oracle Database Slide 1: Topic: Diagnosing a Long Parsing Issue in Oracle Database Slide 2: Parsing is ...