Oracle Portal Performance

This note apply to Oracle Portal 10.1.4.2.0 in HA environment and linux S.O.

In the webcache event.log file , continuously this message is shown :
[warning 11366] [ecid: xxxxxx] A client connection to listening port 80 is dropped.

If the mandatory patches was applied and portal performance is really slow, follow bellow :

This note instructs an intermediate tuning based on experiences.

 

Portal:

Cache:
First of all, put the first page and all principals pages in cache:
Log-in at http://site.domain/pls/portal and click in navigator->page group->Pages->Properties (selected page)
Select “Cache Page Definition and Content at System Level for” and insert “5” Minutes .
Select “Limit Time Spent Fetching Portlets to” and insert “30” Seconds .

Show html/portlets times:
Put after url “?_debug=0”,  example :  http://site.domain?_debug=0

Show Urls Times:
Log-in at Database:
select parsing_schema_name, sql_text, elapsed_time/1000000 elapsed_sec, executions, disk_reads, buffer_gets
from v$sqlarea  order by elapsed_time desc

 

Infrastructure Database:

init.ora:
shared_pool_size = 2Gb
large_pool_size = 256M
java_pool_size = 256M
db_cache_size = 256M
log_buffer = 14226432
processes = 3000
sessions = 4000
transactions = 4000
open_cursors = 5000
db_writer_processes = 6

 

Infrastructure HTTP Server:

KeepAlive Off

 

Midtier WebCache:

Network Timeouts:
Keep-Alive Timeout(sec): 15

Resource Limits:
Maximum Cache Size (MB): 1500
Maximum Incoming Connections: 850
Maximum Cached Object Size (KB): No maximum set

Origin Servers:
Capacity: 300
Failover Threshold: 3
Ping Interval: 5

/etc/sysctl.conf:
net.ipv4.tcp_keepalive_time = 900
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_keepalive_intvl = 20

/etc/hosts (put all the host name in Site Definitions in hosts) :
Example:
192.168.1.10   www.domain
192.168.1.11    bi.domain

 

Midtier HTTP Server:

KeepAlive On
MaxKeepAliveRequests 0
KeepAliveTimeout 15
MinSpareServers 20
MaxSpareServers 50
StartServers 20
MaxClients 400
MaxRequestsPerChild 0

 

Midtier OC4J_Portal:

opmn.xml:
number of processes = 2

$ORACLE_HOME/j2ee/OC4J_Portal/applications/portal/portal/WEB-INF/web.xml :
maxParallelPortlets = 100
maxParallelPagePortlets = 20
poolSize = 100
queueTimeout = 40

 $ORACLE_HOME/Apache/modplsql/conf/dads.conf:
Location /pls/portal :
PlsqlMaxRequestsPerSession 5000

 $ORACLE_HOME/Apache/modplsql/conf/cache.conf:
PlsqlCacheTotalSize 209715200

 

 

Good Luck !

Be careful when migrating – Difference between oracle 10g and 11g

All of DBAs know about new features of Oracle Database 11g, but here will expose of the possible problems to migrate.

This note apply to Oracle Database 11g Release 2.

New Features:
ASM Fast Mirror Resync, a snapshot standby database is a fully updatable standby, Data Recover Advisor automatically diagnoses data failures, Improved Block Corruption Detection, Database Replay allows you to test the impact of system change by replaying real-world workload on the test system before it is exposed to a production.

Possibles issues to migrate oracle database 10g to 11g :

1. Problems to send mail or access HTTP/TCP connection.
Oracle Error: ORA-24247: network access denied by access control list (ACL)
The 11g database version only allows access to external functions (UTL_TCP, UTL_HTTP, UTL_SMTP, UTL_MAIL, UTL_INADDR, DBMS_LDAP) through one special explicit grant to the owner.

Solution:
1.1. Create de ACL – access control list :

BEGIN
   DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('acl_list.xml','List of special access', 'SYS', TRUE, 'connect');
   DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('acl_list.xml','*');
END;
/
COMMIT;

1.2. Grant the resolve privilege for users that need use the special functions:

1.2.1. Run select to see all of users :

SELECT OWNER, REFERENCED_NAME FROM DBA_DEPENDENCIES WHERE referenced_name IN ('UTL_TCP','UTL_SMTP','UTL_MAIL','UTL_HTTP','UTL_INADDR') AND owner NOT IN ('SYS','PUBLIC','ORDPLUGINS') order by OWNER;

Return example:

JAVAUTIL,UTL_HTTP SYSCLI,UTL_SMTP

1.2.2. Grant to user JAVAUTIL and SYSCLI (remember to commit) :

BEGIN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(
       acl => 'acl_list.xml',
       principal => 'JAVAUTIL',
       is_grant => true,
       privilege => 'connect');
END;
/
commit;

BEGIN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(
       acl => 'acl_list.xml',
       principal => 'SYSCLI',
       is_grant => true,
       privilege => 'connect');
END;
/
commit;

2. Errors using java class in database.
Oracle Error: The class is not compiled
In 11g database the JDBC driver has changed, and classes that use JDBC driver must import the new.

Solution:
2.1. Change the import class:

From: import oracle.jdbc.driver*; To: import oracle.jdbc.*;

3. Ambiguous column in the query.
Oracle Error: ORA-00918: column ambiguously defined
According to Oracle this is an expected behavior and 11g from the need to qualify ambiguous names in select list (DOC ID
835701.1)

Solution:
3.1. Change the query specifying the columns ambiguous.

Example of query with ambiguous column:

SELECT PROJECT_ID , PROJ_VERSION_NO, NAME , DESCRIPTION , LAST_CHANGED_DATE
FROM leeh.PW2_PROJECT
JOIN
(SELECT PROJECT_ID AS MAX_ID, MAX(PROJ_VERSION_NO) AS MAX_VERSION
FROM leeh.PW2_PROJECT
GROUP BY PROJECT_ID
) T
ON PROJECT_ID = MAX_ID AND PROJ_VERSION_NO = MAX_VERSION
WHERE PROJ_VERSION_NO > 0;

4. Error in procedure or function when change user password.
Oracle Error: ORA-0600
In 11g database, the password column on view sys.dba_users, no longer contains the user’s password.

Solution:
4.1. Change the queries to use sys.user$ view.

5. Implicit data conversion is no longer allowed in some times
Oracle Error: ORA-06502: PL/SQL: numeric or value error
Implicit and explicit conversion for numeric values may also suffer from the analogous problem, as the conversion result may depend on the session parameter NLS_NUMERIC_CHARACTERS. This parameter defines the decimal and group separator characters. If the decimal separator is defined to be the quotation mark or the double quotation mark, some potential for SQL injection emerges.

Solution:
5.1. Check NLS_NUMERIC_CHARACTERS or change the queries to use quotes.

6. User login error, because password case sensitivity
Oracle Error: ORA-01017: invalid username/password
When you create or modify user accounts, by default, passwords are case sensitive. To control the use of case sensitivity in passwords, set the SEC_CASE_SENSITIVE_LOGON initialization parameter. Only users who have the ALTER SYSTEM privilege can set the SEC_CASE_SENSITIVE_LOGON parameter. Set it to TRUE to enable case sensitivity or FALSE to disable case sensitivity.

Solution:
6.1. Set init parameter “sec_case_sensitive_logon” to false :

*.sec_case_sensitive_logon=false

7. Error using cursor with DBMS_SQL
Oracle Error: ORA-29471: DBMS_SQL access denied
In 11g database, oracle has introduced some security changes to the DBMS_SQL package to prevent cursor injection. The better solution is create the cursors using explicitly security level, for example:

curs = dbms_sql.open_cursor(level);

The level 1 requires the executing/binding and parsing user IDs to be the same. Level 2 is more strict and requires id and roles are the same for all operations like binds, describes, executes, fetches etc.

Workaround to ignore the security cursor:
7.1. Set init parameter “_dbms_sql_security_level” to zero:

*._dbms_sql_security_level=0

Good Luck !

Materialized View with OID users data

Sometimes you need access users data of OID to integrate with other systems, follow bellow how to do:

 

1. Create Types :

CREATE OR REPLACE TYPE LDAP_USU_TABLE is table of LDAP_USU_ROW;
/
CREATE OR REPLACE TYPE LDAP_USU_ROW
as object (login       varchar2(200),
           name        varchar2(200),
           mail        varchar2(200),
           phone       varchar2(200));
/

 

2. Create Function to acquire data of OID :

CREATE OR REPLACE function GET_LDAP_USU
return LDAP_USU_TABLE
is
  ldap_usu         LDAP_USU_TABLE := LDAP_USU_TABLE(LDAP_USU_ROW(NULL,
                                                                 NULL,
                                                                 NULL,
                                                                 NULL));
  retval           PLS_INTEGER;
  my_session       DBMS_LDAP.session;
  my_attrs         DBMS_LDAP.string_collection;
  my_message       DBMS_LDAP.message;
  my_entry         DBMS_LDAP.message;
  entry_index      PLS_INTEGER;
  my_dn            VARCHAR2(256);
  my_attr_name     VARCHAR2(256);
  my_ber_elmt      DBMS_LDAP.ber_element;
  attr_index       PLS_INTEGER;
  i                PLS_INTEGER;
  my_vals          DBMS_LDAP.STRING_COLLECTION ;
  ldap_host        VARCHAR2(256);
  ldap_port        VARCHAR2(256);
  ldap_user        VARCHAR2(256);
  ldap_passwd      VARCHAR2(256);
  ldap_base        VARCHAR2(256);
  v_login          varchar2(200);
  v_nome           varchar2(200);
  v_mail           varchar2(200);
  v_setor          varchar2(200);
  v_tel            varchar2(200);
  b_first          boolean := TRUE;
 BEGIN
  retval         := -1;
  -- Customization
  ldap_host  := 'oid.help2ora.com';
  ldap_port  := '389';
  ldap_user  := 'cn=orcladmin';
  ldap_passwd:= 'welcome1';
  ldap_base  := 'cn=Users,dc=help2ora,dc=com';
  -- end of customizable settings
  -- Choosing exceptions to be raised by DBMS_LDAP library.
  DBMS_LDAP.USE_EXCEPTION := TRUE;
  my_session := DBMS_LDAP.init(ldap_host,ldap_port);
  -- bind to the directory
  retval := DBMS_LDAP.simple_bind_s(my_session,
             ldap_user, ldap_passwd);
  -- issue the search
  my_attrs(1) := 'sn';
  my_attrs(2) := 'cn';
  my_attrs(3) := 'mail';
  my_attrs(5) := 'telephonenumber';
  retval := DBMS_LDAP.search_s(my_session, ldap_base,
                               dbms_ldap.SCOPE_SUBTREE,
                               'objectclass=inetOrgPerson',
                               ---'(&(objectclass=inetOrgPerson)(!(givenname=*computer*)))',
                               my_attrs,
                               0,
                               my_message);
  -- count the number of entries returned
  retval := DBMS_LDAP.count_entries(my_session, my_message);
  -- get the first entry
  my_entry := DBMS_LDAP.first_entry(my_session, my_message);
  entry_index := 1;
  -- Loop through each of the entries one by one
  while my_entry IS NOT NULL
  loop
    my_dn := DBMS_LDAP.get_dn(my_session, my_entry);
    my_attr_name := DBMS_LDAP.first_attribute(my_session,my_entry,my_ber_elmt);
    attr_index := 1;
    while my_attr_name IS NOT NULL
    loop
      my_vals := DBMS_LDAP.get_values(my_session,my_entry,my_attr_name);
      if my_vals.COUNT > 0
      then
        FOR i in my_vals.FIRST..my_vals.LAST
        loop
          if (lower(my_attr_name) = 'telephonenumber') then
                    v_tel := upper(my_vals(i));
          elsif (lower(my_attr_name) = 'mail') then
                    v_mail := upper(my_vals(i));
          elsif (lower(my_attr_name) = 'cn') then
                    v_nome := upper(my_vals(i));
          elsif (lower(my_attr_name) = 'sn') then
                    v_login := upper(my_vals(i));
          end if;
       end loop;
      end if;
      my_attr_name := DBMS_LDAP.next_attribute(my_session,my_entry,my_ber_elmt);
      attr_index := attr_index +.1;
    end loop;
        if b_first then
           b_first := FALSE;
        else
           ldap_usu.extend;
        end if;
       ldap_usu(ldap_usu.last) := ldap_usu_row(v_login,
                                               v_nome,
                                               v_mail,
                                               v_tel);

    my_entry := DBMS_LDAP.next_entry(my_session, my_entry);
    entry_index := entry_index+1;
    v_tel := null;
    v_mail := null;
    v_nome := null;
    v_login := null;
  end loop;
  -- unbind from the directory
  retval := DBMS_LDAP.unbind_s(my_session);
  return(ldap_usu);
END;
/

 

3. Create Materialized View with 10 minutes refresh:

CREATE MATERIALIZED VIEW VW_USERS
TABLESPACE USERS
NOCACHE
NOLOGGING
NOCOMPRESS
NOPARALLEL
BUILD IMMEDIATE
REFRESH FORCE
START WITH TO_DATE('03-ago-2011 17:09:17','dd-mon-yyyy hh24:mi:ss')
NEXT SYSDATE + (10/60/24)
WITH PRIMARY KEY
AS
/* Formatted on 03/08/2011 17:07:13 (QP5 v5.115.810.9015) */
SELECT   *
  FROM   TABLE (CAST (get_ldap_usu () AS ldap_usu_table));

 

Good Luck !

 

How to invalidate pages in Webcache using database procedure

To invalidate dynamic pages in the webcache, you need send an XML file with the URL of the pages that you want to invalidate to web cache

The advantage to use database procedure to invalidate is that should be invalidated as soon as the data in the database is updated. The better way is create trigger on tables and after update or insert data, trigger can call a procedure to send invalidation message do WebCache.

1. Firt of all you need know what the webcache invalidation port :

example:

$ opmnctl status -l

return:

Processes in Instance: webcache.help2ora.com
-------------------+--------------------+---------+----------+------------+----------+-----------+------
ias-component      | process-type       |     pid | status   |        uid |  memused |    uptime | ports
-------------------+--------------------+---------+----------+------------+----------+-----------+------
dcm-daemon         | dcm-daemon         |     N/A | Down     |        N/A |      N/A |       N/A | N/A
WebCache           | WebCache           |   31709 | Alive    |   47252097 |  1761360 |  23:10:48 | statistics:4002,invalidation:4001,http:80,https:443
WebCache           | WebCacheAdmin      |   32045 | Alive    |   47252068 |    18932 | 511:08:50 | administration:4000

 

2. Create 2 procedures and change in INVALID_RESULT sys.wxvutil.invalidate_exec  (Host IP of WebCache, Port, and Admin Password) :

example: ‘10.70.1.45’, 4001, ‘welcome1’

NOTE: If you need call direct in browser using HTTP Server and DAD, please uncomment the line “htp.p(resultado);” in INVALID_RESULT and call direct INVALID_CALL.

 

INVALID_CALL :

CREATE OR REPLACE PROCEDURE PORTAL_AUX."INVALID_CALL"
 is
 BEGIN
 htp.p('
<script language=JavaScript>
function verify_white(param)
{
    test_parameter = "false"; //Test blank spaces
    tam_parameter = param.length;
    if (tam_parameter != 0)
    {
        for (i = 0; i < tam_parameter; i++)
            {if (param.charAt(i) != " ")
                {
                    test_parameter = "true"; /*Blank space exists*/
                }
            }
        if (test_parameter == "false")  //All Blanks
        {
            return false;
        }
        else
        {
            return true;
        }
    }
    else
    {
        return false;
    }

}

function valida() {
  if (!verify_white(document.invalid.site_name.value)){
     alert("Select the URL !");
     document.invalid.site_name.focus();
     return false;
  }
  if (!verify_white(document.invalid.uri.value)){
     alert("Inválid file or path !");
     document.invalid.uri.focus();
     return false;
  }
   return true;
}

function enviar() {
 if (valida())  {
     document.invalid.submit();
 }
}

function logout() {
     window.location.href="/logout";
}

</script>
 ');
 htp.p('<html><body><p> </p>');
 htp.p('<form name=invalid action=invalid_result method=POST>
        <table border=1 align=center width=60% bgcolor=#E0F0FF cellpadding=1 cellspacing=2>
           <tr><td colspan=2 bgcolor=#FFFFFF align=Center><h4><img src="img.jpg" align=Middle> Invalid Cache ! </h4></td></tr>
           <tr><td colspan=2><h4>Select the URL and give the file or path to be invalidate !</h4></td></tr>
           <tr>
           <td><b>URL:</b>
               <select name=site_name id=site_name>
                 <option selected value=>>>Selecione<<</option>
                 <option value=www.help2ora.com>www.help2ora.com</option>
                 <option value=systems.help2ora.com>systems.help2ora.com</option>
                 <option value=test.help2ora.com>est.help2ora.com</option>
              </select>
           </td>
           <td><b>File/Path:</b> <input type=text name=uri size=30 ></td>
           </tr>
           <tr><td colspan=2> </td></tr>
           <tr>
           <td colspan=2 align=center><input type=button value=Enviar onclick="enviar();"> <input type=reset value=Clear> <input type=button value=Logout onclick="logout();"></td>
          </tr>
        </table>
        </form>
 ');
 htp.p('</html></body>');
 END;
/

 

INVALID_RESULT :

 

CREATE OR REPLACE PROCEDURE PORTAL_AUX."invalid_RESULT"
 (
  site_name   in varchar2,
  uri          in varchar2
) is
 resultado varchar2(32767);
 a_pos1 integer;
 a_pos2 integer;
 parte varchar2(255);
 BEGIN
 sys.wxvutil.invalidate_reset;
 sys.wxvutil.invalidate_adv(null, uri, site_name, null, null, null, null, null,0, null);
 sys.wxvutil.invalidate_exec('10.70.1.45', 4001, 'welcome1', resultado);
 a_pos1 := instr(resultado, 'NUMINV');
 a_pos2 := instr(resultado, 'NUMINV', a_pos1 + 5);
 parte := substr(resultado, a_pos1+8, 5);
 a_pos1 := instr(parte, '"');
 htp.p('<html><body><p> </p><br><h3><center>');
 htp.p('Total of Invalid Objects: ' || substr(parte, 0, a_pos1-1));
 htp.p('<p> </p> <form action=invalid_call METHOD=post><input type=submit value=Voltar></form>');
 htp.p('</center></h3></body></html>');

--dbms_output.put_line(resultado);
--htp.p(resultado);
 END;
/

 

 

3. Create trigger in table to call invalidate

CREATE OR REPLACE TRIGGER PORTAL_AUX.tg_invalidcache
 AFTER INSERT OR UPDATE OR DELETE
 ON PORTAL_AUX.TB_NEWS REFERENCING NEW AS NEW OLD AS OLD
 FOR EACH ROW
begin
 PORTAL_AUX."invalid_RESULT('www.help2ora.com:80','header.jpg');
end;
/

 

NOTE:

Other informations you can see in http://download-west.oracle.com/docs/cd/B14099_19/caching.1012/b14046/invalidate.htm#sthref1629 .
The samples and wxvutil package you can see in $ORACLE_HOME/webcache/toolkit

 

 

Good Luck !

Undeploy/Deploy App in OC4J using linux Shell script

This note apply to Oracle OC4J 10.x to undeploy/deploy in cluster environment:

 

1. UNDEPLOY

cd $ORACLE_HOME/j2ee/home

$ORACLE_HOME/jdk/bin/java -jar admin_client.jar deployer:cluster:opmn://<host.domain>/<container name> oc4jadmin <password oc4jadmin> -undeploy <application name>

example:

$ORACLE_HOME/jdk/bin/java -jar admin_client.jar deployer:cluster:opmn://oas3.help2ora.com/production2 oc4jadmin welcome1 -undeploy Appsysclient

 

 

2. DEPLOY

cd $ORACLE_HOME/j2ee/home

$ORACLE_HOME/jdk/bin/java -jar admin_client.jar deployer:cluster:opmn://<host.domain>/<container name> oc4jadmin <password oc4jadmin> -deploy -file <application ear> -deploymentName <application name>

example:

$ORACLE_HOME/jdk/bin/java -jar admin_client.jar deployer:cluster:opmn://oas3.help2ora.com/production2 oc4jadmin welcome1 -deploy -file /d2/Appsysclient.ear -deploymentName Appsysclient

 

 

Good Luck !

 

TRUSTED CERTIFICATES COULD NOT BE INSTALLED WITH OWM

This case is when we try to install the SERPRO trusted certificate “ACSERPROv2.cer” .

This error is one BUG in OWM (Oracle Wallet Manager) follow bellow the solution :

 

1. Download patch 7352022 from metalink

 

2. Unzip the patch (e.g: linux) :

unzip p7352022_10105_LINUX.zip

 

3. Apply the patch stopping the OAS:

cd 7352022
opmnctl shutdown
$ORACLE_HOME/OPatch/opatch apply

 

4. Start OAS :

opmnctl startall

 

Good Luck !

 

 

Tuning Linux OS Kernel Parameters for Oracle WebCache

This note is to increase the kernel parameters for better performance in tcp connection on Linux red-hat.

First of all verify the system requirements to install WebCache in oracle.com, and check other required parameters like “kernel.sem” and  “kernel.shmall”.

Tuning:

Add in /etc/sysctl.conf

net.ipv4.nonlocal_bind = 1
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_max_tw_buckets = 2000000
net.ipv4.tcp_sack = 0
net.ipv4.tcp_window_scaling = 0
net.ipv4.tcp_keepalive_time = 900
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_keepalive_intvl = 20
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_syn_retries = 5
net.ipv4.tcp_synack_retries = 5
net.ipv4.tcp_retries2 = 15
net.ipv4.tcp_wmem = 10000000 10000000 10000000
net.ipv4.tcp_rmem = 10000000 10000000 10000000
net.ipv4.tcp_mem = 10000000 10000000 10000000
net.core.wmem_default = 10000000
net.core.wmem_max = 10000000
net.core.rmem_default = 10000000
net.core.rmem_max = 10000000
net.core.hot_list_length = 20000
net.core.optmem_max = 10000000
net.core.hot_list_length = 20000
net.core.optmem_max = 10000000
net.core.netdev_max_backlog = 300000

 

NOTE:

You need to check with your network admin for firewall timeout value.  Then you should modify kernel parameter net.ipv4.tcp_keepalive_time to a value lower than the firewall timeout values. This should give the TCP keepalive a chance to keep the connection alive.

On Linux, the keepalive procedures use three user-driven variables:

tcp_keepalive_time : How often TCP sends out keepalive messages when keepalive is enabled. Default is 7200 seconds.

tcp_keepalive_intvl : How frequent probes are retransmitted, when a probe isn’t acknowledged. Default :75 seconds

tcp_keepalive_probes : How many keepalive probes TCP will send, until it decides that the connection is broken. Default:9 seconds

 

If you need more information about webcache tuning : http://www.help2ora.com/index.php/2011/08/16/oracle-portal-performance

 

Good Luck !

 

How to solve the error – ADVM/ACFS is not supported on epel-release-5-4

This issue is about Oracle Database 11g Release 2 Grid Infrastructure installation on linux Red Hat 5 x86_64

The error “ADVM/ACFS is not supported on epel-release-5-4” is one bug related a installed packages.

Bug Evidence –  Look the packages (root user)

rpm -qa |grep release

Result:

redhat-release-notes-5Server-36
epel-release-5-4
redhat-release-5Server-5.6.0.3
rpmforge-release-0.5.2-2.el5.rf

NOTE: The Grid installation verify in your system the packages with name like “release” and wait exception only for three packages “redhat-release”, “rpmforge-release” and “release-notes”, if you have installed more then three packages with name like “release” the script of verification will fail, in this example the package is “epel-release-5-4”. Please follow bellow the workaround:

 

1. Clear the temp file of system version:

echo > /tmp/.linux_release

 

2. Backup of script :

cd $ORACLE_HOME/lib

cp -rp osds_acfslib.pm BKP_osds_acfslib.pm

NOTE: $ORACLE_HOME is grid path installation, eg: “/u01/app/11.2.0/grid”

 

3. Edit the script (this example with epel-release-5-4 package):

vi osds_acfslib.pm

After:

if ($release =~ /release-notes/)
{
next;
}

Add :

      if ($release =~ /epel-release/)
      {
        next;
      }

 

4. Try to install again

God Luck !

 

How to install PHP5, GD and OCI8 for Oracle Application Server on linux

Steps for linux 32 bits :

0.  Install rpm’s :
httpd-devel –  Development tools for the Apache HTTP server
libjpeg –  A library for manipulating JPEG image format files
libjpeg-devel –
libpng –   A library of functions for manipulating PNG image format files
libpng-devel –  Development tools for programs to manipulate PNG image format files
libXpm – libXpm runtime library
libXpm – libXpm development package
freetype – A free and portable font rendering engine
freetype-devel – FreeType development libraries and header files
php-ldap – A module for PHP applications that use LDAP.
php53-ldap – A module for PHP applications that use LDAP

Run:

ln -s /usr/lib/libjpeg.so /usr/lib/
ln -s /usr/lib/libpng.so /usr/lib/
ln -s /usr/lib/libXpm.so /usr/lib/
ln -s /usr/lib/libldap.so /usr/lib/

1. Download PHP5 from http://www.php.net/downloads.php and extract in $HOME/php5

gunzip php-5.x.x.tar.gz
tar -xvf php-5.x.x.tar

 

2. Download the Oracle Instant Client basic and sdk 10g from http://www.oracle.com/technetwork/database/features/instant-client and extract in $HOME/instantclient

 

3. Set LD_LIBRARY_PATH to instantclient path

export LD_LIBRARY_PATH=$HOME/instantclient/instantclient_10_2

 

4. Export CFLAGS

export CFLAGS=-DLINUX

 

5. Copy libdms2.so to instantclient path

cp  $ORACLE_HOME/lib/libdms2.so $HOME/instantclient/instantclient_10_2

 

6. Create symbolic link to library

cd $HOME/instantclient/instantclient_10_2
ln -s libclntsh.so.10.1 libclntsh.so

 

7. Create directory for GD images

mkdir -p $ORACLE_HOME/Apache/Apache/php/img

 

8. Run configure

cd $HOME/php5/php-5.3.6

./configure --prefix=$ORACLE_HOME/Apache/Apache/php --with-apxs=$ORACLE_HOME/Apache/Apache/bin/apxs --with-config-file-path=$ORACLE_HOME/Apache/Apache/conf --with-oci8=instantclient,/home/oracle/instantclient/instantclient_10_2 --disable-rpath --with-gd --with-gd2 --with-ldap --enable-sigchild --with-pic --enable-mbstring --disable-libxml --disable-dom --disable-simplexml --disable-xml --disable-xmlreader --disable-xmlwriter --without-pear --with-freetype --with-freetype-dir=$ORACLE_HOME/Apache/Apache/php/img --with-jpeg-dir=$ORACLE_HOME/Apache/Apache/php/img --with-png-dir=$ORACLE_HOME/Apache/Apache/php/img--with-xpm-dir=$ORACLE_HOME/Apache/Apache/php/img >install_log.txt

 

9. If ‘configure’ succeeded without any errors issue the ‘make’ command

make

 

10. If ‘make’ succeeded without any errors issue the ‘make install’ command

make install

 

11. Add path ‘PHPRC’ on opmn.xml to php.ini

After : <ias-component id="HTTP_Server"> <process-type id="HTTP_Server" module-id="OHS">

Add :

<environment>
 <variable id="PHPRC" value="$ORACLE_HOME/Apache/Apache/conf/"/>
 </environment>

 

12. Reload opmn

opmnctl reload

 

13. Restart HTTP Server

opmnctl stopproc ias-component=HTTP_Server

opmnctl startproc ias-component=HTTP_Server

 

When starting if you have thsi error:

“Cannot load /etc/httpd/modules/libphp5.so into server: libclntsh.so.10.1: cannot open shared object file: No such file or directory”

Run (32 or 64 bits):

cp -rp $ORACLE_HOME/lib/libnnz10.so /usr/lib/.
or
cp -rp $ORACLE_HOME/lib/libnnz10.so /usr/lib64/.

 

Steps for linux 64 bits :

1. Follow the same 32 bits steps 1 to 10

2. Copy the php files from 32 bits machine to 64 bits machine

copy  $ORACLE_HOME/Apache/Apache/php and  $ORACLE_HOME/Apache/Apache/libexec/libphp5.so

3.With ROOT user on linux 64 make symbolic links

cd /usr/lib
ln -s libldap-2.3.so.0 libldap.so.2
ln -s liblber-2.3.so.0 liblber.so.2

ln -s /usr/lib64/libjpeg.so /usr/lib/
ln -s /usr/lib64/libpng.so /usr/lib/
ln -s /usr/lib64/libXpm.so /usr/lib/
ln -s /usr/lib64/libldap.so /usr/lib/

4. Follow steps 11 to 13

 

Good Luck !

Error Messages ORA-40001 to ORA-40322

ORA-40001 to ORA-40322

 

ORA-40001: value for string must be greater than zero
Cause: The input parameter in question has a value of zero or less.
Action: Provide a value greater than zero for the relevant parameter.

ORA-40002: wordsize must be string or greater
Cause: The input wordsize is less than the prescribed limit for the BLAST Match
or Align algorithm.
Action: Provide a wordsize greater than or equal to the prescribed value.

ORA-40003: wordsize must be in the range string – string for BLAST-P
Cause: The input wordsize has a value out of the prescribed range.
Action: Provide a wordsize value within the prescribed range for BLAST-P.

ORA-40004: penalty must be negative for BLAST-N
Cause: The input value provided for penalty is zero or greater.
Action: Provide a negative penalty value.

ORA-40101: Data Mining System Error string-string-string
Cause: An internal system error occured during a data mining operation.
Action: Contact Oracle Support Services.

ORA-40102: invalid input string for data mining operation string
Cause: The input parameter is either null or invalid for the given operation.
Action: Provide a valid value. Check range for NUMBER parameters.

ORA-40103: invalid case-id column: string
Cause: The column designated as case-id is not of one of CHAR, VARCHAR2,
NUMBER data type. Case-id columns of type CHAR and VARCHAR2 must be of
length less than or equal to 128 bytes.
Action: Change the schema of your input data to supply a case-id column of
appropriate data type and/or length.

ORA-40104: invalid training data for model build
Cause: The training data provided in the reported table is unsuitable for build,
either because it is empty, has unsuitable data, or the schema of the table does not
match the input specifications.
Action: Inspect the training data and correct the contents/schema as appropriate.

ORA-40105: input data incompatible with model signature
Cause: The data provided for this post-build operation is in format different from
that used for model build.
Action: Provide data whose attribute data types match the build data. Input data
attributes must have the same data types as those described in the model signature
for the model.

ORA-40106: positive target value not specified for computing Lift
Cause: Positive target value has not been specified for Lift.
Action: Provide a positive target value for the Lift operation.

ORA-40107: operation requires string option to be installed
Cause: The specified option has not been installed with the RDBMS.
Action: Install the reported option and retry the operation.

ORA-40108: input data contains too few distinct target (string) values
Cause: At least two distinct target values are required for Build.
Action: Provide counter-example target values in the input data.

ORA-40109: inconsistent logical data record
Cause: Repeated instances of a record identifier or repeated attribute(s) in a
nested column.
Action: Remove or re-label repeated instances to resolve inconsistencies.

ORA-40201: invalid input parameter string
Cause: The input parameter was either null or invalid.
Action: Provide a valid value for the input parameter.

ORA-40202: column string does not exist in the input table string
Cause: The column was missing from the table.
Action: Correct the table schema and/or provide the correct column name.

ORA-40203: model string does not exist
Cause: The model did not exist.
Action: Supply a valid model name.

ORA-40204: model string already exists
Cause: A model by the same name exists.
Action: Provide a different, unique name for the model.

ORA-40205: invalid setting name string
Cause: The input setting name was invalid.
Action: Consult the documentation for the settings table and provide a valid
setting name.

ORA-40206: invalid setting value for setting name string
Cause: The input value for the given setting name was invalid.
Action: Consult the documentation for the settings table and provide a valid
setting value.

ORA-40207: duplicate or multiple function settings
Cause: The input settings table contained settings for multiple mining functions.
Action: Provide setting(s) for a single function in the settings table.

ORA-40208: duplicate or multiple algorithm settings for function string
Cause: The input settings table had duplicate or multiple algorithm settings for a
mining function.
Action: Provide only one appropriate algorithm setting for the mining function.

ORA-40209: setting % is invalid for % function
Cause: The specified setting was not supported for the mining function supplied.
Action: Provide appropriate combination of function and algorithm settings.

ORA-40211: algorithm name string is invalid
Cause: Algorithm name for the model was invalid or the operation was not valid
for the algorithm.
Action: Check the algorithm name for the model and verify that the operation is
valid.

ORA-40212: invalid target data type in input data for string function
Cause: Target data type was invalid.
Action: Classification function accepts CHAR,VARCHAR2, and NUMBER targets.
Regression function accepts NUMBER targets only.

ORA-40213: contradictory values for settings: string, string
Cause: The settings values were not compatible.
Action: Check the documentation and change the setting value(s).

ORA-40214: duplicate setting: string
Cause: Duplicate setting in the settings table.
Action: Remove the duplicate setting from the settings table.

ORA-40215: model string is incompatible with current operation
Cause: The current operation was not supported for the mining function the
model corresponds to.
Action: Provide the model name suitable for current operation.

ORA-40216: feature not supported
Cause: The feature was not supported in the API.
Action: Modify the code to avoid usage of the feature.

ORA-40217: priors table mismatched with training data
Cause: The entries in the priors table do not correspond to the targets in the
training data.
Action: Verify the entries in the priors table.

ORA-40219: apply result table string is incompatible with current operation
Cause: The current operation was not allowed for the apply result table supplied.
Action: Make sure the operation being performed is valid for the mining function
used to build the model (using which the apply result table was created).

ORA-40220: maximum number of attributes exceeded
Cause: The data had too many attributes.
Action: Reduce the dimensionality of the data.

ORA-40221: maximum target cardinality exceeded
Cause: The target cardinality of the training data was too high.
Action: Reduce the target cardinality.

ORA-40222: data mining model export failed, job name=string, error=string
Cause: The model export job failed.
Action: Check export job settings as required by DataPump.

ORA-40223: data mining model import failed, job name=string, error=string
Cause: The model import job failed.
Action: Check import job settings as required by DataPump.

ORA-40225: model is currently in use by another process
Cause: The model is currently in use by another process.
Action: Retry if necessary.

ORA-40226: model upgrade/downgrade must be performed by SYS
Cause: Upgrade/Downgrade routines are being invoked by a user with
insufficient privilieges.
Action: Run the routines as SYS during migration.

ORA-40251: no support vectors were found
Cause: The input data is non-predictive in nature, or one of the input settings is
incorrect/incompatible with respect to the input data.
Action: Provide additional data or change model setting value.

ORA-40252: no target values were found
Cause: No target values were identified during load.
Action: Validate that the target is correctly specified.

ORA-40253: no target counter examples were found
Cause: One or more of the target classes have only positive examples.
Action: Provide counter examples or remove that target class.

ORA-40254: priors cannot be specified for one-class models
Cause: Priors were specified.
Action: Do NOT provide priors for one-class models.

ORA-40261: input data for model build contains negative values
Cause: The input data contains negative values, which is not acceptable for a
Non-negative Matrix Factorization model.
Action: Provide clean data for build without any negative values.

ORA-40262: NMF: number of features not between [1, string]
Cause: The number of requested features must be greater than 1, and less than the
smaller of the number of attributes and the number of cases in the dataset.
Action: Specify the desired number of features within the acceptable range.

ORA-40271: no statistically significant features were found
Cause: Input data inadequate in volume and/or quality to derive statistically
significant predictions for building a Adaptive Bayes Network model.
Action: Provide a well-prepared training data set.

ORA-40272: apply rules prohibited for this model mode
Cause: Adaptive Bayes Network rules are only generated for SingleFeature ABN
models
Action: Rebuild model in SingleFeature mode and then apply with rules.

ORA-40273: invalid model type string for Adaptive Bayes Network algorithm
Cause: The valid values for the abns_model_type settings are: abns_multi_
feature, abns_single_feature, abns_naive_bayes.
Action: Use a valid value for the abns_model_type setting.

ORA-40281: invalid model name
Cause: A model name is invalid or does not exist.
Action: Check spelling. A valid model name must begin with a letter and may
contain only alphanumeric characters and the special characters $, _, and #. The
name must be less than or equal to 30 characters and cannot be a reserved word.

ORA-40282: invalid cost matrix
Cause: Cost matrix specification is invalid.
Action: Provide valid cost matrix specification. Check syntax for data mining
functions.

ORA-40283: missing cost matrix
Cause: Cost matrix specification is missing.
Action: Provide valid cost matrix specification. Check syntax for data mining
functions.

ORA-40284: model does not exist
Cause: The model entered does not exist.
Action: Check spelling.

ORA-40285: label not in the model
Cause: The model does not have the label.
Action: Provide valid label.

ORA-40286: remote operations not permitted on mining models
Cause: An attempt was made to perform queries or DML operations on remote
tables using local mining models.
Action: Remove the reference to remote tables in the statement.

ORA-40287: invalid data for model – cosine distance out of bounds
Cause: The norm computed using attribute values from the incoming row for the
cosine model is outside the range 0-1.
Action: Remove or correct the data in the offending row.

ORA-40289: duplicate attributes provided for data mining function
Cause: A duplicate, non-nested attribute was provided as input to the data
mining function. A duplicate attribute is one which is present in the model
signature, occurs more than once in the USING clause after tablename expansion,
and is not a collection element in a nested table column.
Action: Eliminate the duplicate attribute(s).

ORA-40290: model incompatible with data mining function
Cause: The supplied model cannot be operated upon by the data mining function
because the model is built for a mining function and/ or based on an algorithm
that is incompatible with function.
Action: Provide the name of the model suitable for the function.

ORA-40291: model cost not available
Cause: The supplied model was assumed to have been built with a cost matrix
specification, when in reality, it was not.
Action: Provide a model name that corresponds to a model that was built with an
appropriate cost matrix specification.

ORA-40301: invalid cost matrix specification
Cause: A valid cost matrix is not specified.
Action: Consult documentation for valid cost matrix specification.

ORA-40302: invalid classname string in cost matrix specification
Cause: Actual or predicted classname specified is not present in training data
Action: Provide valid classname(s) in cost matrix specification

ORA-40303: invalid prior probability specification
Cause: Valid prior probabilities not specified. Valid probabilities should be
between 0 and 1.
Action: Consult documentation for valid prior probability specification.

ORA-40304: invalid classname string in prior probability specification
Cause: Actual or predicted classname specified is not present in training data.
Action: Provide valid classname(s) in prior probability specification.

ORA-40305: invalid impurity metric specified
Cause: Impurity metric specified is not valid. Examples of valid metrics are
TREE_IMPURITY_GINI, TREE_IMPURITY_ENTROPY.
Action: Consult documentation for valid impurity metrics and specification.

ORA-40306: wide data not supported for decision tree model create
Cause: Wide data (DM_NESTED_NUMERICALS and/or DM_NESTED_
CATEGORICALES) is being passed to the decision tree model create routine.
These datatypes are currently not supported for tree builds.
Action: Remove columns of these datatypes from the input.

ORA-40321: invalid bin number, is zero or negative value
Cause: Input bin number has zero or negative values.
Action: Provide positive bin numbers starting from 1.

ORA-40322: bin number too large
Cause: Bin number is too large.
Action: Reprocess build data by choosing smaller bin numbers.

 

Good Luck !