Text box

Please note that the problems that i face may not be the same that exist on your environment so please test before applying the same steps i followed to solve the problem .

Tuesday 24 September 2013

What is the scan listener and how to deal with it?.

I will explain today the scan concept that was introduced with real application clustering in 11g release 2 and the benefit behind it.

The Single Client Access Name (SCAN) is a feature used in Oracle Real Application Clusters
environments that provides a single name for clients to access any Oracle Database running
in a cluster. You can think of SCAN as a cluster alias for databases in the cluster. The benefit
is that the client’s connect information does not need to change if you add or remove nodes or
databases in the cluster.

When you have  a single name to access the cluster to connect to a database in this cluster you  allow clients to use EZConnect and the  simple JDBC thin URL to access any database running in the cluster.You don't care about the  number of databases or servers running in the cluster and regardless on which server(s) in  the cluster the requested database is actually active.

Requirements to setup scan:
Oracle Real application clustering introduced grid infra structure strating from release 2.You must install the grid and it may have a different home that contains both Oracle Clusterware and Oracle Automatic Storage Management.
When installing the grid infrastructure you will be prompted to provide a SCAN name. There are 2 options for defining the SCAN:
1. Define a SCAN using the corporate DNS (Domain Name Service)
2. Define a SCAN using the Oracle Grid Naming Service (GNS)

1– Using the Corporate DNS:
If you will choose this path then you must ask your network administrator to create at least one single name  that resolves to three IP addresses. Three IP addresses are  recommended considering load balancing and high availability requirements regardless of the number of servers in the cluster.


  • The IP addresses must be on the same subnet as your default public network in the cluster.
  • The three IP addresses  must be using a round-robin algorithm.
  • The name must be 15 characters or less in length, not including the domain.
  •  The scan name must be resolvable without the domain suffix.
  • The IPs must not be assigned to a network interface.
Example:

testing-scan.mydomain.com  IN  A 110.45.98.180
                                          IN  A 110.45.98.190
                                          IN  A 110.45.98.100

In order to check the SCAN configuration in DNS use “nslookup”. The DNS should provide 
round-robin access to the IPs resolved by the SCAN entry,You have to run the “nslookup” command at least  twice to see the round-robin algorithm work.The result should be that each time, the “nslookup”  would return a set of three IPs in a different order.

Round-robin on DNS level allows for a connection request load balancing across SCAN listeners floating in the cluster. It is not required for SCAN to function as a whole and the absence of such a setup will not prevent the fail over of a connection request to another SCAN listener, in case the first SCAN listener in the list is down. 

The Oracle Client typically handles failover of connections requests across SCAN listeners in the 
cluster. Oracle Clients of version Oracle Database 11g Release 2 or higher will not require any 
special configuration to provide this type of failover. Older clients require considering additional 
configuration.
It is therefore recommended that the minimum version of the client used to connect to a database using SCAN is of version Oracle Database 11g Release 2 or higher.

Using client-side DNS caching may generate a false impression that DNS round-robin is not occurring from the DNS server. (DNS not return a set of three IPs ). Client-side DNS 
caches are typically used to minimize DNS requests to an external DNS server as well as to minimize DNS resolution time. This is a simple recursive DNS server with local items.
If the client-side DNS cannot be set up to provide round-robin locally or cannot be disabled, Oracle Clients using a JDBC:thin connect will typically attempt a connection to the SCAN-IP and SCAN listener which is returned first in the list .In this case one of the three Ips was only used and basically disables the connection request load balancing  across SCAN listeners in the cluster from those clients, but does not affect SCAN functionality as a whole. Oracle Call Interface (OCI) based database access drivers will apply an internal round-robin algorithm and do not need to be considered in this case.


2– Using the Oracle Grid Naming Service (GNS):
You will only enter the SCAN name during the installation. At some stage in the cluster configuration, three IP addresses will be acquired from either a DHCP service or using 
“Stateless Address Auto Configuration” (SLAAC) when using IPv6 based IP addresses with Oracle  RAC 12c (using GNS, however, assumes that you use some form of dynamic IP assignment on your  public network) to create the SCAN. SCAN name resolution will then be provided by the GNS.



Workaround in case you cannot setup SCAN:

Oracle Universal Installer (OUI) enforces providing a default SCAN resolution during the Oracle Grid  Infrastructure installation, since the SCAN is mendatory during the creation of Oracle RAC 11g Release 2 or higher databases in the cluster. All Oracle Database 11g Release 2 or higher 
tools used to create a database .The Database Configuration Assistant (DBCA), or the Network 
Configuration Assistant (NetCA)) would assume its presence. Hence, OUI will not allow you to continue with the installation until you have provided a suitable SCAN resolution

If you want to overcome the installation requirement without setting up a DNS-based SCAN 
resolution, you can use a hosts-file based workaround. In this case, you would use a typical hosts-file entry to resolve the SCAN to only 1 IP address and one IP address only. It is not possible to simulate the round-robin resolution that the DNS server does using a local host file. The host file look-up the OS performs will only return the first IP address that matches the name Thus, you will create only 1 SCAN for the cluster. you will have to change the hosts-file on all nodes in the cluster for this purpose.



Wednesday 18 September 2013

APXINWKB - Unable to Update or Cancel Invoice APP-SQLAP-10771 Could Not Reserve Record

 I had the above situation today and the application version was 11.5.10.2 and the database version was 10.5.2.0.

The below note from oracle support was helpful:
APXINWKB - Unable to Update or Cancel Invoice APP-SQLAP-10771 Could Not Reserve Record (Doc ID 1200053.1)

Dont forget to restart the application forms and open new ones.

Regards
Mohamed