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 .

Sunday, 1 December 2013

ORA-20001: invalid column name or duplicate columns/column groups/expressions in method_opt


Statistics Errors:
stats on table FND_CP_GSM_OPP_AQTBL is locked
Error #1: ERROR: While GATHER_TABLE_STATS:
object_name=GL.JE_BE_LINE_TYPE_MAP******
Error #2: ERROR: While GATHER_TABLE_STATS:
object_name=GL.JE_BE_LOGS***ORA-20001: invalid column name or duplicate columns/column groups/expressions in method_opt***
Error #3: ERROR: While GATHER_TABLE_STATS:
object_name=GL.JE_BE_VAT_REP_RULES***ORA-20001: invalid column name or duplicate columns/column groups/expressions in method_opt***

Investigating the issue I find that the historgram contains duplicate records which it should has only one record. This is a known issue after upgrade and should be handled as per below:
The query result below show that we are impacted by this issue:
SQL> select column_name, nvl(hsize,254) hsize
from FND_HISTOGRAM_COLS
where table_name = 'JE_BE_LINE_TYPE_MAP'
order by column_name;  2    3    4

COLUMN_NAME                         HSIZE
------------------------------ ----------
SOURCE                                254
SOURCE                                254

select table_name, column_name, count(*)
from FND_HISTOGRAM_COLS
group by table_name, column_name
having count(*) > 1;

TABLE_NAME                     COLUMN_NAME                      COUNT(*)
------------------------------ ------------------------------ ----------
JE_BE_LOGS                     DECLARATION_TYPE_CODE                   2
JE_FR_DAS_010                  TYPE_ENREG                              2
JE_FR_DAS_010_NEW              TYPE_ENREG                              2
JE_BE_LINE_TYPE_MAP            SOURCE                                  2
JE_BE_VAT_REP_RULES            SOURCE                                  2
JE_BE_VAT_REP_RULES            LINE_TYPE                               2
JE_BE_VAT_REP_RULES            VAT_REPORT_BOX                          2
JG_ZZ_SYS_FORMATS_ALL_B        JGZZ_EFT_TYPE                           2

==============================================
I used the below to delete the obsoleted records:
SQL> delete from FND_HISTOGRAM_COLS
where table_name = '&TABLE_NAME'
and  column_name = '&COLUMN_NAME'
and rownum=1;  2    3    4
Enter value for table_name: JE_BE_LOGS
old   2: where table_name = '&TABLE_NAME'
new   2: where table_name = 'JE_BE_LOGS'
Enter value for column_name: DECLARATION_TYPE_CODE
old   3: and  column_name = '&COLUMN_NAME'
new   3: and  column_name = 'DECLARATION_TYPE_CODE'

1 row deleted.

SQL> /
Enter value for table_name: JE_FR_DAS_010
old   2: where table_name = '&TABLE_NAME'
new   2: where table_name = 'JE_FR_DAS_010'
Enter value for column_name: TYPE_ENREG
old   3: and  column_name = '&COLUMN_NAME'
new   3: and  column_name = 'TYPE_ENREG'

1 row deleted.

SQL> /
Enter value for table_name: JE_FR_DAS_010_NEW
old   2: where table_name = '&TABLE_NAME'
new   2: where table_name = 'JE_FR_DAS_010_NEW'
Enter value for column_name: TYPE_ENREG
old   3: and  column_name = '&COLUMN_NAME'
new   3: and  column_name = 'TYPE_ENREG'

1 row deleted.

SQL> /
Enter value for table_name: JE_BE_LINE_TYPE_MAP
old   2: where table_name = '&TABLE_NAME'
new   2: where table_name = 'JE_BE_LINE_TYPE_MAP'
Enter value for column_name: SOURCE
old   3: and  column_name = '&COLUMN_NAME'
new   3: and  column_name = 'SOURCE'

1 row deleted.

SQL> /
Enter value for table_name: JE_BE_VAT_REP_RULES
old   2: where table_name = '&TABLE_NAME'
new   2: where table_name = 'JE_BE_VAT_REP_RULES'
Enter value for column_name: SOURCE
old   3: and  column_name = '&COLUMN_NAME'
new   3: and  column_name = 'SOURCE'

1 row deleted.

SQL> /
Enter value for table_name: JE_BE_VAT_REP_RULES
old   2: where table_name = '&TABLE_NAME'
new   2: where table_name = 'JE_BE_VAT_REP_RULES'
Enter value for column_name: LINE_TYPE
old   3: and  column_name = '&COLUMN_NAME'
new   3: and  column_name = 'LINE_TYPE'

1 row deleted.

SQL> /
Enter value for table_name: JE_BE_VAT_REP_RULES
old   2: where table_name = '&TABLE_NAME'
new   2: where table_name = 'JE_BE_VAT_REP_RULES'
Enter value for column_name: VAT_REPORT_BOX
old   3: and  column_name = '&COLUMN_NAME'
new   3: and  column_name = 'VAT_REPORT_BOX'

1 row deleted.

SQL> /
Enter value for table_name: JG_ZZ_SYS_FORMATS_ALL_B
old   2: where table_name = '&TABLE_NAME'
new   2: where table_name = 'JG_ZZ_SYS_FORMATS_ALL_B'
Enter value for column_name: JGZZ_EFT_TYPE
old   3: and  column_name = '&COLUMN_NAME'
new   3: and  column_name = 'JGZZ_EFT_TYPE'

1 row deleted.

SQL> select table_name, column_name, count(*)
from FND_HISTOGRAM_COLS
group by table_name, column_name
having count(*) > 1;  2    3    4

no rows selected

SQL> commit;

Commit complete.



I fixed the issue and rerun the above query and it returned 0 rows which means that the issue was killed.
SQL> select table_name, column_name, count(*)
from FND_HISTOGRAM_COLS
group by table_name, column_name
having count(*) > 1;  2    3    4

no rows selected


Regards
Mohamed ELAzab

Sunday, 24 November 2013

Oracle APPS Cloning || R12 Perl lib version doesn't match executable version


When i was cloning the development using the  adcfgclone.pl i got strange error.
The Error :
adcfgclone.pl dbTechStack

script returned:
****************************************************

.end std out.
Perl lib version (v5.8.4) doesn't match executable version (v5.10.0) at /usr/perl5/5.8.4/lib/sun4-solaris-64int/Config.pm line 32.
Compilation failed in require at /dbtop/proderpdb/11.2/appsutil/clone/ouicli.pl line 35.
BEGIN failed--compilation aborted at /dbtop/proderpdb/11.2/appsutil/clone/ouicli.pl line 35.

.end err out.
****************************************************


I found out it is Oracle bug in R12: and the Bug # 9724411.

Solution :

export PERL5LIB=/perl/lib/5.10.0:/perl/site_perl/5.10.0:/appsutil/perl

Regards
Mohamed ElAzab

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