Centos 64 pre requis Skype

Install it first :

yum install libXv.i686 libXScrnSaver.i686 qt.i686 qt-x11.i686 pulseaudio-libs.i686 pulseaudio-libs-glib2.i686 alsa-plugins-pulseaudio.i686

Oracle zombie sessions – Apache

As you may know on Oracle Xe, you are limited to 1 giga ram and it will limit your maximum of session to 600.

Select * from V$RESOURCE_LIMIT

I am using Apache with php and oci8 as oracle connector and I can see a lot of inactive session open on the event “SQL*Net message from client”

SELECT *
FROM gv$session s, gv$process p
WHERE p.addr = s.paddr AND p.inst_id = s.inst_id;

- oracle user profile did not work
- oci8 persistent parameter as idle timeout did not work

The solution was to modify the sqlnet.ora file and change sqlnet_expire_time value to 10, by default the value is set to 0.

sqlnet_expire_time = 10

If you have no sqlnet.ora copy the sample and just uncomment sqlnet_expire_time :

cp /u01/app/oracle/product/11.2.0/xe/network/admin/samples/sqlnet.ora /u01/app/oracle/product/11.2.0/xe/network/admin/sqlnet.ora

 

Oracle SQL – Generate day/month list from 2 dates

Generate month list from 2 different dates:


select add_months(x,nb) as next_month from
(
select to_date('2012/01/01', 'YYYY/MM/DD') x, rownum-1 nb
from dual
connect by level <= (select ABS(TRUNC(MONTHS_BETWEEN(to_date('2012/01/01', 'YYYY/MM/DD'), to_date('2015/01/01', 'YYYY/MM/DD'))))+1 from dual)
)
;

Generate day list from 2 different dates:


select x+nb as next_day from
(
select to_date('2012/01/01', 'YYYY/MM/DD') x, rownum-1 nb
from dual
connect by level <= (select ABS(TRUNC(to_date('2012/01/01', 'YYYY/MM/DD') - to_date('2011/05/01', 'YYYY/MM/DD')))+1 from dual)
)
;

Windows XP + Xampp

With the new version of xampp, you must install the following Windows package:

http://www.microsoft.com/download/en/details.aspx?id=5582

Apex 4 dictionnary

apex_dictionary_4.0.1

APEX link in a report select plsql_block

./f?p=p=&APP_ID.:7:&SESSION.::::P7_ID:22

Oracle – Set http port and ftp port

Get current setting:

select
dbms_xdb.gethttpport as “HTTP-Port”,
dbms_xdb.getftpport as “FTP-Port”
from dual;

Set ports:

begin
dbms_xdb.sethttpport(’8080′);
dbms_xdb.setftpport(’2100′);
end;
/

APEX – Apache virtual host with proxy pass

<VirtualHost http_ip>
        ProxyPreserveHost       On
        ProxyPass               /       http://apex_url:apex_port/

        ServerName      dns_name
        RewriteEngine   On
        RewriteRule     ^/status$     /apex/listenerStatus [R,L]
        RewriteRule     ^/listenerStatus$     /apex/listenerStatus [R,L]
        RewriteRule     ^/listenerAdmin$        /apex/listenerAdmin [R,L]
        RewriteRule     ^/admin$                /apex/apex_admin [R,L]
        RewriteRule     ^/$             /apex [R,L]
</VirtualHost>

<VirtualHost *:80>

 ProxyPreserveHost On
 ProxyPass /apex http://apex_ip:apex_port/apex
     DocumentRoot “C:/xampp/htdocs/”    #this is necessary if you want to access to the folder /i
   ServerName domain.com    
ServerAlias www.domain.com  
 #Enable gzip compression for html, css, javascript, … for transfer optimization
 AddOutputFilterByType DEFLATE text/plain
 AddOutputFilterByType DEFLATE text/html
 AddOutputFilterByType DEFLATE text/xml
 AddOutputFilterByType DEFLATE text/css
 AddOutputFilterByType DEFLATE application/xml
 AddOutputFilterByType DEFLATE application/xhtml+xml
 AddOutputFilterByType DEFLATE application/rss+xml
 AddOutputFilterByType DEFLATE application/javascript
 AddOutputFilterByType DEFLATE application/x-javascript
 
</VirtualHost>

Apache and compression

If you want to enable compression on your website on Apache.

Modify the .htaccess file of your website.
Add the following lines :

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

Oracle XE 11g R2 force reinstall

rm -rf /u01
rpm -ivh –replacepkgs oracle-xe-11.2.0-1.0.x86_64.rpm

Meta