Wednesday, January 30, 2019

Error to compile Oracle forms: FRM-30085: Unable to adjust form for output

Symptoms: 
When trying to compile an Oracle Forms, it gives an error such as
"FRM-30085: Unable to adjust form for output."

Similar errors when trying to compile forms:
Compiling procedure P_APPLY...
Compilation error on procedure P_APPLY:
PL/SQL ERROR 907 at line 1, column 1
cannot load library unit ADMRMS.FM_FRECLASS_SQL (referenced by INTERNAL_VARIABLE)
PL/SQL ERROR 0 at line 32, column 4
Statement ignored

Cause: 
Usually this error happens when there any invalid object on the database that is referenced on the form.
But if you look at the database, you see there is no invalid object but the error still persists.

Solution:
For some unknown reason, the object is valid for you, but its references on the Oracle catalog dont. If you know the objects referenced, such as procedure, package, etc., compile one by one again using the command given below (individually, dont use utlrp at this moment).
For Oracle Retail Forms, compile all objects that ends with %SQL.

Example:
  alter PACKAGE RMS14.CURRENCY_SQL compile;
  alter PACKAGE RMS14.PM_RETAIL_API_SQL compile;
  alter PACKAGE RMS14.ITEM_SQL compile;

After issuing the command, other dependent objects might be invalid. So now you can use the utlrp to compile all over again.

Just validate that all objects on the database are valid now, then compile the forms.
The error should not persist now.

There are many other reasons to get this error and on Oracle Support there is a master note:
  • Doc ID 756384.1 - Master Note for Known Causes of FRM-91500
  • Doc ID 262442.1 - FRM-91500 Running Forms 9i Compiler (f90genm.sh) on Linux x86
  • Doc ID 360819.1 - Cannot Compile Forms Module On Unix FRM-91500
Another possible reason to have this error is related to the libs on Linux. Review the pre-requirements given on the installation guide for Oracle Forms Services 11g Release 2 and install all Linux packages quoted. A summary of the main packages are given here:

yum install binutils -y
yum install compat-libcap1 -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libXext -y
yum install libXext.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install make -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
yum install oracle-rdbms-server-12cR1-preinstall -y
yum install glibc-* -y
yum install gtk-vnc* -y
yum install openmotif* -y
yum install python-* -y
yum install rdesktop* -y
yum install xorg-x11-* -y
yum install compat-db* -y
yum install compat-gcc-34* -y
yum install makedepend -y

Reboot the server and try again:

frmcmp.sh help=y


Hope this help.

Thursday, January 10, 2019

ORA-06502: character string buffer too small when performing Data Datapump Utility EXPDP

Symptoms:

When performing the Datapump Export or Import it gets an error that might be internal errors, data dictionary incompatibility, or anything else still unkown.
The message might be such as this piece of code:

Processing object type DATABASE_EXPORT/SCHEMA/JAVA_SOURCE/JAVA_SOURCE
ORA-39126: Worker unexpected fatal error in KUPW$WORKER.GATHER_PARSE_ITEMS [JAVA_SOURCE:"<SCHEMA_NAME>"."runtime/PingResponse_LiteralSerializer"]
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPW$WORKER", line 11259


Cause: 

This error could be caused by several reasons including a bug on the Datapump data dictionary depending on the version of database you are working on.



Solution:

The solution is given on Oracle Support Document (Doc ID 430221.1), says:
In some cases DataPump utility may get corrupted and we need to recreate DataPump utility to overcome internal corruption.



  • For Oracle version 10.1 :


-- 1. Catdp.sql orders the installation of all its components including the Metadata API which was previously installed separately. By default catproc.sql invoke this script. 
SQL> @$ORACLE_HOME/rdbms/admin/catdp.sql 

-- 2. dbmspump.sql will create DBMS procedures for dataPUMP 
SQL> @$ORACLE_HOME/rdbms/admin/dbmspump.sql




  • For Oracle version 10.2:


-- 1.Catdph.sql will Re-Install DataPump types and views 
SQL> @$ORACLE_HOME/rdbms/admin/catdph.sql 

-- Note:
-- If XDB is installed, then it is required to run "catmetx.sql" script also. 
-- Use this code to verify if XDB is installed: 

SQL> select substr(comp_name,1,30) comp_name, 
     substr(comp_id,1,10) comp_id,
     substr(version,1,12) version,
     status 
     from dba_registry; 

-- Sample output if XDB installed, 
Oracle XML Database    XDB    -version-    VALID 

-- 2.prvtdtde.plb will re-install tde_library packages 
SQL> @$ORACLE_HOME/rdbms/admin/prvtdtde.plb 

-- 3. Catdpb.sql will Re-Install DataPump packages 
SQL> @$ORACLE_HOME/rdbms/admin/catdpb.sql 

-- 4.Dbmspump.sql will Re-Install DBMS DataPump objects 
SQL> @$ORACLE_HOME/rdbms/admin/dbmspump.sql 

-- 5. To recompile  invalid objects, if any 
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql




  • For Oracle version 11g and higher prior to 12c:


-- 1.Catproc.sql
SQL> @$ORACLE_HOME/rdbms/admin/catproc.sql

-- 2.To recompile invalid objects, if any
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql




  • For Oracle version 12c:


Note 1: Prior rebuilding DP catalog in 12.1.0.2 CDB , install Patch 25139545 as alerted in Document 2175021.1 - "Alert - Multitenant Customers: The objects created by the post-install steps of 12.1.0.2 Generic DataPump Patches Are not Shared Across All PDBS".
Note 2:  For issues regarding KU$ Invalid Objects Owned by SYS after upgrading or applying datapatch, refer to Document 2289785.1 to rebuild Datapump.


Rebuild the DataPump packages with the following steps.
Under the ORACLE_HOME, execute:
cd rdbms/admin

-- run the dpload.sql in the CDB with all of the PDBs open

From a SQL*Plus session, connect as sysdba and then run dpload.sql:

@dpload.sql

on the affected database. 

Note: If DataPump catalog is not valid in a PDB, same step should be executed to validate the DP catalog on a pluggable database.



Source: Oracle Support - How To Reload Datapump Utility EXPDP/IMPDP (Doc ID 430221.1)

Configure the Oracle DB Access Control List to avoid error like ORA-24247: network access denied

Symptoms:  You try to make external connections from the Oracle Database and receive erros like ORA-24247: network access denied by access c...