Showing posts with label oracle. Show all posts
Showing posts with label oracle. Show all posts

Highlight Search Term in APEX Interactive Report

Here is a tutorial on how to set up highlight search term in interactive report created by oracle Apex 4.2.
1. Download jquery.highlight-4.js and copy the content of this file to "Function and Global Variable Declaration" section under your page JavaScript tab (To go here, right click your page and choose Edit).
2. Go to "CSS" tab and add the following line into section "inline"
.highlight { background-color: yellow }
3.Create the first dynamic action
Name: before refresh
Event: Before Refresh
Select Type: Region
Region: choose the region you want to apply
True Actions: Execute JavaScript Code
Code: 
gv_search = $("#apexir_SEARCH").val();
Fire On Page Load: Yes
4. Create the second dynamic action
Name: after refresh
Event: After Refresh
Select Type: Region
Region: choose the region you want to apply
True Actions: Execute JavaScript Code
Code:
if (gv_search) {
$('.apexir_WORKSHEET_DATA td').highlight(gv_search);
}

Fire On Page Load: Yes

Configure sqlldr for batch uploading data to Oracle

I was trying to batch load data to Oracle from client site of computer (Ubuntu 64bit) and found that sqlldr was not installed. Here is a simple instruction of installing/enabling sqlldr on Ubuntu 64Bit.
1. make sure that Oracle Client was installed. If not, following this link to install.
2. Download Oracle Database Express Edition (oracle-xe-11.2.0-1.0.x86_64.rpm.zip) from here:
3. extract rpm file from the downloaded file
unzip -d oracle-ex oracle-xe-11.2.0-1.0.x86_64.rpm.zip
cd oracle-ex/Disk1
# extract files from rpm package
rpm2cpio oracle-xe-11.2.0-1.0.x86_64.rpm | cpio -idmv
# copy file sqlldr and folder mesg to local $ORACLE_HOME
sudo cp u01/app/oracle/product/11.2.0/xe/bin/sqlldr /usr/lib/oracle/11.2/client64/bin
# create fold rdbms/mesg at $ORACLE_HOME
sudo mkdir -p /usr/lib/oracle/11.2/client64/rdbms/mesg
#then copy files from mesg folder
sudo cp u01/app/oracle/product/11.2.0/xe/rdbms/mesg/* /usr/lib/oracle/11.2/client64/rdbms/mesg/
4. now you could run sqlldr to batch load data
sqlldr user/pass@//oracle_server:1521/devl control="RXNCONSO.ctl";

Install perl DBD::Oracle module without installing Oracle server onCentOS

I am in the situation of using ora2pg to migrate an Oracle database to postgreSQL. To install ora2pg, DBD::Oracle is required. To install DBD:Oracle, the environmental variable $ORACLE_HOME is required. However, it is not easy to set up an environmental variable for $ORACLE_HOME since I am using a remote dedicated Oracle server. To overcome the problem, I downloaded and installed the following three rpm packages: Please be advised that it should be no problem to set $ORACLE_HOME on a machine which happens to be the Oracle server.
# download link for Linux 64bit
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
oracle-instantclient11.2-basic-11.2.0.3.0-1
oracle-instantclient11.2-devel-11.2.0.3.0-1
oracle-instantclient11.2-sqlplus-11.2.0.3.0-1
I then added the $ORACLE_HOME to ~/.bashrc file.
#By default, the installation path is /usr/lib/oracle/11.2/client64/
export ORACLE_HOME="/usr/lib/oracle/11.2/client64/"
If you want connect to the Oracle database from command line using sqlplus, you could add $ORACLE_HOME/bin to you PATH, though the syntax for connecting to a remote database using its SID is nasty.
PATH=$PATH:/usr/lib/oracle/11.2/client64/bin
sqlplus AERS/AERS@'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=remote_server_address)(PORT=1521)))(CONNECT_DATA=(SID=sid_code)))'
Now, you have done all the steps for running sqlplus on a command line. Will you enjoy the using? You probably not at this moment. Since running sqlplus without further tweaking is a pain in Linux command line: you do not have your history(using upper arrow) or you can not use left/right arrow to edit your sql command. Here is a solution, using rlwrap
# install required repository
wget http://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
sudo rpm -Uvh epel-release-6-8.noarch.rpm
# install rlwrap if it does not exit in your system
sudo yum install rlwrap
#then run
rlwrap sqlplus ***
You could also add he following alias in your ~/.bashrc file
vim ~/.bashrc
#add the following into the file
alias sqlplus='rlwrap sqlplus'

Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...