Thursday, April 26, 2012

Move oraInventory

I haved  moved  oracle Inventory by using below step  :
/home/oracle/oraInventory to /u01/app/oracle/oraInventory

#Backup
tar cf /home/oracle/oraInventory.tar oraInventory

#Verify it's using /home/oracle/oraInventory
find oraInventory -type f -exec grep oraInventory {} \; | head

#Replace old oraInventory strings in all files under oraInventory
find oraInventory -type f -exec perl -pi -e 's#/home/oracle/oraInventory#/u01/app/oracle/oraInventory#g' {} \;

#Verify it's using /u01/app/oracle/oraInventory
find oraInventory -type f -exec grep oraInventory {} \; | head

#Move the location
mv oraInventory /u01/app/oracle/

#Change inventory location in each $ORACLE_HOME (change the directory in each file)
vi /u01/app/oracle/product/10.2.0/db/oraInst.loc
vi /u01/app/oracle/product/10.2.0/asm/oraInst.loc
vi /u01/crs/oracle/product/10.2.0/crs/oraInst.loc
[include other $ORACLE_HOME/oraInst.loc here]

#Also change new location  to under /etc. Login as root
vi /etc/oraInst.loc (for Linux)
vi /var/opt/oracle/oraInst.loc (for Solaris)

Saturday, April 21, 2012

Change ASM instance number in the cluster

We cannot change the asm instance number to a NOn-default value.
The reason for this restriction is :
If we have Non-default name to ASM instance then tools like GC and
Configuration assistants may fail in future in 11.2.
There is some code which checks for +ASM and determines this as ASM.
In 11.2 on-wards,the ASM Instance number will be assigned the order of root.sh ran.
For example :-
If we run the root.sh first on node B,then +ASM1 will be configured on node B ,next root.sh ran node C ,
then ASM2 will run node C .like respectively.
If we want to change the order,then we need to re-configure the cluster .
ie need to de-configure the CRS ,re-configure the CRS with re-creating the

Monday, April 16, 2012

Oracle home Name


We can check  ORACLE_HOME NAME using below method ..

 Method 1
 opatch lsinventory -all
 Method 2
Locate the oraInst.loc file and hence the location of central inventory

View the file <path to central inventory>/ContentsXML/inventory.xml
The ORACLE_HOME_NAME will be mentioned against the location of ORACLE_HOME

Method 3

Locate the oraInst.loc file and hence the location of central inventory

cd /<path to central inventory>/oraInventory/logs

check the installActions<timestamp>.log for the value of ORACLE_HOME_NAME

grep -i ORACLE_HOME_NAME installActions<timestamp>.log

sample output:

installActions2011-12-13_08-01-58PM.log:INFO: Setting the 'OracleHomeName ( ORACLE_HOME_NAME )' property to 'OraDb10g_home'. Received the value from the command line.

Saturday, April 14, 2012

Changing the VIP IP address and Virtual Host Name

1) Find out the current VIP configurations from both nodes
a) on Node1
$ srvctl config nodeapps -n node1 -a
b) on Node 2
$ srvctl config nodeapps -n node2 -a
Note : This will give you the current VIP Hostname,VIP IP address,subnet mask, and
interface name used by the VIP.
2) Stopping resources of both nodes
Once you are ready to make the change, stop all resources that are dependent on the VIP on a given node.
a) Stop database
$ srvctl stop database -d cbnk
b) Stop the nodeapps
$ srvctl stop nodeapps -n node1
$ srvctl stop nodeapps -n node2
3) Verify the VIP is no longer running
$ ifconfig -a
note : If the interface still shows as online, this may be an indication that a resource which is
dependent on the VIP is still running.
The crs_stat command can help to show resources that are still online.
4) Make any changes to all nodes of /etc/hosts files to associate the new IP address with the old hostname.
5) make the actual modification to the nodeapps
This command should be run as root
Syntax : srvctl modify nodeapps -n [-o ] [-A ]
Options Description:
-n Node name.
-o Oracle home for the cluster database.
-A The node level VIP address (/netmask[/if1[|if2|...]]).
Example : # srvctl modify nodeapps -n node1 -A 192.168.2.110/255.255.255.0/eth0
Note : interface names are case senstive on all platforms. Be sure that the interface name specified
is the correct name as seen from the OS, be sure that the subnet mask used for the VIP matches the subnet mask used for the
actual public IP addresses, and that the VIP hostname is correctly registered in DNS and/or the hosts file.
6) After making the change, verify that it is correct
$ srvctl config nodeapps -n node1 -a
7) Start the nodeapps resources
$ srvctl start nodeapps -n node1
Note : Repeat the same steps ( Step 1 To Step 7) for all the nodes in the cluster
Note : If only the IP address is changed, it should not be necessary to make changes to the LISTENER.ORA and TNSNAMES.ORA, provided they are
using the vip hostnames for the 'HOST=' entries.
Refernce :
Note:220970.1 : RAC Frequently Asked Questions
Note:276434.1: Modifying the VIP or VIP Hostname of a 10g Oracle Clusterware Node
Note 283684.1: How to Change Interconnect/Public Interface IP Subnet in a 10g Cluster

Friday, April 13, 2012

Display Trace File's Name and Location


Display Trace File's Name and Location
SQL> oradebug setmypid
Statement processed.
SQL> alter database backup controlfile to trace;
Database altered.
SQL> oradebug tracefile_name
/U01/oracle/dump01/oracle/joshi/udump/joshi_ora_8856.trc
Find out trce file name without oradebug :
SELECT LOWER(d.name)||'_ora_'||p.spid
||DECODE(p.value,'','','_'||value) tracefile_name
FROM v$parameter p, v$database d, sys.v_$session s, sys.v_$process p
,(SELECT sid FROM v$mystat WHERE rownum=1) m
WHERE p.name = 'tracefile_identifier'
AND s.paddr = p.addr
AND s.sid = m.sid
/
@Oracle 11g --
select value from v$diag_info where name='Default Trace File';
select tracefile from v$process where pid=2;

DBA Daily Activity

The following activities are monitored on a Database :
Task/Machine
Schedule
Description
Connect to Database Hourly To monitor the availability of database server and Oracle listener.
Check Alert Logs Hourly To check the alert log file periodically to identify any logs for errors / warnings. It will automatically send an SMS to the administrator.
Check Tablespace Size Hourly To check the size of free tablespace and free space available. If the tablespace reaches the threshold limit, it will automatically send an SMS message to the administrator.
Verify Rollback Segments Shift To check the status of the rollback segments.
Verify if any resources locked Shift To identify any locked resources.
Verify Archive Logs Daily To check if the archive logs are created properly in the current directory and if standby configuration is enabled, check whether the archive logs are backed, transferred and applied properly.
Hit Ratio Daily To check the overall buffer cache hit ratio for the entire instance since it was started. If the ratio reaches the threshold limit, it will automatically send an SMS message to the administrator.
Check Listener Log File Size Daily To check the size of listener log files on each database instance. If the listener log file size reaches the threshold limit, notification will be sent to the administrator.
Size of Extents Daily To check the segments of each table space, number of extents, initial size of extent, next extent size, minimum extents, maximum extent and status.
Check Disk Space Daily To check the disk space availability for data files, log files and temp space. If the available size reaches the threshold limit, it will automatically send an SMS message to the administrator.
Check CPU Usage Daily Monitors the CPU performance and its usage.
Check Memory Usage Daily Monitors the memory usage, memory page faults, etc.
Check System Log Files Daily To check the Event Viewersystem log files. To see and watch for any OS related warnings or errors.
Check for Invalid Objects Weekly To identify invalid objects in the database.
Check for Chained Rows Weekly To identify chained rows and manag

Oracle Database shall be monitored using The Capacity Planner and Performance Manager applications, This includes special Performance Manager diagnostics such as Performance Overview, TopSessions, TopSQL and Lock Monitor .
Administrators will be able to investigate an event directly from the console’s event viewer through direct access to Performance Manager charts, diagnostic help and historical data related to metrics being monitored by the event.
This provides a logical step-by-step methodology for discovering and investigating performance problems.
In addition, events and Performance Manager charts can share common metric thresholds, allowing consistent performance thresholds to be used by administrators whether monitoring in lights-out mode or real time. With 9i, events can also be registered directly from Performance Manager charts.

Tuesday, April 10, 2012

New patching strategy@Oracle 11.2.0.2

Oracle changed patching strategy.

Starting with the 11.2.0.2 patch set, Oracle Database patch sets are full installations of the Oracle Database software. This means that you do not need to install Oracle Database 11g Release 2 (11.2.0.1) before installing Oracle Database 11g Release 2 (11.2.0.2).
Note the following changes with the new patch set packaging:
New installations consist of installing the most recent patch set, rather than installing a base release and then upgrading to a patch release.
Direct upgrades from previous releases to the most recent patch set are supported.
Out-of-place patch set upgrades recommended, in which you install the patch set into a new, separate Oracle home. In-place upgrades are supported, but not recommended.
For detail information read :

Important Changes to Oracle Database Patch Sets Starting With 11.2.0.2 [ID 1189783.1]

Tuesday, April 3, 2012

Oracle RAC Basic

What is Cluster?Cluster consists of two or more independent nodes. Cluster software hides structure of nodes. Due to cluster software all nodes are acting as single server.

What is Real Application Cluster?It is component of Oracle for managing two or more instances on different node which are sharing single database. RAC software manages data access and makes consistent image of database.

What is Node?Each node contains separate CPU and memory and self contained server in cluster. It contains single instance of RAC database.

What is Interconnect?Using cluster interconnect each node communicates messages to other nodes. In short using interconnect all nodes are talking to each other. Interconnect transfers all messages of database from all connected nodes.

What is Shared Disk?Oracle real application cluster database must be accessible from all connected nodes (Instances). Due to this database must be on shared disk which is accessed by all nodes. RAW device file system available in Unix/Linux and unformatted disk partition available in Windows for making shared disk.

What is Cluster Manager?Cluster Manager manages and monitoring connected nodes. It regulates messages and activity of nodes in cluster.

What is Oracle Cluster file system (OCFS)?OCFS is shared file system and made by Oracle itself for Oracle Real Application Cluster. It allows to accessing single Oracle Home for all nodes. Without using OCFS we should need to install separate Oracle Home on each nodes in Cluster.

What is Oracle Clusterware?In previous version of oracle (Oracle 9i) it is called as Cluster Manager. Oracle clusterware monitors all components like instances and listeners. There are two components in Oracle clusterware, those are Voting Disk and OCR.

What is Voting Disk?Voting Disk is shared disk component. Information of shared storage & nodes reside in Voting Disk. It is accessed by the all nodes during cluster operations. Every node pings Voting Disk, if will be failing to ping cluster immediate serves as communication failure & the node is evicted from cluster.

What is OCR?OCR means Oracle Cluster Registry. It stores cluster configuration information. It is also shared disk component. It must be accessed by all nodes in cluster environment.It also keeps information of Which database instance run on which nodes and which service runs on which database.The daemon OCSSd manages the configuration info in OCR and maintains the changes to cluster in the registry.