Tuesday, April 29, 2014

Apex - Clear a page when a tab is clicked.


How to clear a page when a tab is clicked?

Create a new application page process:
  • Navigate to Applications -> Shared Components -> Application Processes
  • Click Create
  • Create a process which runs “On Submit: After Page Submission – Before Computations and Validations”.

In Process Source put the following code:

DECLARE
l_tab_page_no NUMBER;

BEGIN
SELECT tab_page INTO l_tab_page_no
FROM apex_application_tabs
WHERE application_id = :APP_ID
AND tab_name = :REQUEST;

APEX_UTIL.CLEAR_PAGE_CACHE(l_tab_page_no);
EXCEPTION WHEN NO_DATA_FOUND THEN
    NULL;
END;

You can also do a specific Tab page (if you know the Tab name) using:

IF (:REQUEST = 'T_TAB_NAME’) THEN
   APEX_UTIL.CLEAR_PAGE_CACHE(your_page_number);
END IF;

Where T_TAB_NAME is your Tab name.

When you now click a tab, the page's cache will be cleared.

Have a look at Tab names and page # using the following query:
select * FROM apex_application_tabs;

Monday, April 21, 2014

Change the hostname/domain for an existing Oracle E-Business Suite (EBS) Application (Single node)

Note: The below is a solution ONLY for a single node application (DB and MT in the same node).

Problem:
If you have an Ebiz application that is accessible using the following URL:
http://abc.abcd.com:8000

and the domain/hostname changes and you are looking for a new URL like:
http://abc.xyz.com:8000

Solution:
STEP 1.
DB Tier: Deregister the current database server

To check if this step is needed, run the following SQL (logged in as apps schema user)

Query 1.
SQL> select NODE_NAME from FND_NODES;

Query 2.
SQL> select NAME, SERVER_TYPE from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID and
SERVER_TYPE='DB';

If this Query returns a null, ignore the DB register step and jump to Step # 2 (Deregister the current Applications server)
If you get results then run the following:

Query 3.
SQL> select NAME, SERVER_TYPE from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID and
SERVER_TYPE='DB' and FND_NODES.NODE_NAME=UPPER('oldhost'); <<Value from 1st Query>>

# cd $ORACLE_HOME/appsutil
# perl ./bin/adgentns.pl appspass= contextfile=./<<FileName>>.xml -removeserver

SQL> select NAME, SERVER_TYPE from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID and
SERVER_TYPE='DB' and FND_NODES.NODE_NAME=UPPER('oldhost'); <<Value from 1st Query>>

You should not get any results.

Create a new Context file
# cd $ORACLE_HOME/appsutil
# cp PROD_oldhost.xml DEVT_newhost.xml
Edit DEVT_newhost.xml manually:
Replace all oldhost with newhost
Replace all olddomain with newdomain -- <<Replace all occurance of abcd with xyz>>

You can also create a context file via script:
# cd $ORACLE_HOME/appsutil
# perl ./bin/adclonectx.pl contextfile=./DEVT_oldhost.xml

and provide appropriate values.


STEP 2.
APPS Tier: Deregister the current Applications server

Query 1.
SQL> select NODE_NAME from FND_NODES;

Query 2.
SQL> select NAME, SERVER_TYPE from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID and
SERVER_TYPE='APPS';

Query 3.
SQL> select NAME, SERVER_TYPE from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID and
SERVER_TYPE='APPS' and FND_NODES.NODE_NAME=UPPER('oldhost'); <<Value from 1st Query>>


# cd $APPL_TOP/admin
# perl $AD_TOP/bin/adgentns.pl appspass= contextfile=./DEVT_oldhost.xml -removeserver

SQL> select NAME, SERVER_TYPE from FND_APP_SERVERS, FND_NODES
where FND_APP_SERVERS.NODE_ID = FND_NODES.NODE_ID and
SERVER_TYPE='APPS' and FND_NODES.NODE_NAME=UPPER('oldhost'); <<Value from 1st Query>>

You should not get any results.

APPS Tier: Create a new Context file

# cd $APPL_TOP/admin
# cp DEVT_oldhost.xml DEVT_newhost.xml
Edit DEVT_newhost.xml manually:
Replace all oldhost with newhost
Replace all olddomain with newdomain  -- <<Replace all occurance of abcd with xyz>>

You can also create a context file via script:
# cd $APPL_TOP/admin
# perl $AD_TOP/bin/adclonectx.pl contextfile=./DEVT_oldhost.xml
and provide appropriate values.

STEP 3. DB Tier: Reseed the Net Services Topology Model
If you executed STEP 1 (DB Tier: Deregister the current database server), then do the following:

# cd $ORACLE_HOME/appsutil
# ./bin/adconfig.sh contextfile=./DEVT_newhost.xml


STEP 4.  APPS Tier: Reseed the Net Services Topology Model
# $AD_TOP/bin/adconfig.sh contextfile=$APPL_TOP/admin/DEVT_newhost.xml appspass=<<Apps_Password>>

STEP 5.
Shutdown the Apps Services (adstpall.sh)
Shutdown the DB and Listener

Start the DB and Listener
Start the Apps Services (adstrtal.sh)

http://abc.xyz.com:8000 should be accessible.

Tuesday, April 15, 2014

Hadoop (Introduction)

Refer Big Data Introduction

As mentioned in a previous blog post - Basics of Big data:

Hadoop is a set of tools that supports running of applications on big data.
Hadoop addresses challenges created by Big Data, namely:
  • Velocity: Lot of data coming in at high speed
  • Volume: Lots of data being gathered (and volume is ever growing)
  • Variety: Data is from varied sources (audio, video, log files - not organized data)
Key attributes:
  • Redundant and Reliable - ensuring no loss of data if a machine fails.
  • Mainly focussed on batch processes
  • Scalable - Works on a distributed model (one code - multiple machines)
  • Runs on commodity hardware (no special hardware needed). Reliability is in software and not needed in the hardware.
Architecture:
Hadoop consists of two main pieces:
  1. MapReduce (Processing part of Hadoop
  2. HDFS (Hadoop distributed file system) - Stores the data


On a machine, the MapReduce server is called Task Tracker.
The HDFS server on a machine is called DataNode.



Cluster
As you need more storage or more computing power - add more machines
Hadoop will scale relatively linearly.



Job Tracker is the coordinater for Map Reduce
A single JobTracker keeps tracks of Jobs run (regardless of the size of the cluster). It accomplishes the following:
  • Accepts users jobs
  • Divides into tasks
  • Assigns each task to an individual task tracker
  • Tracks the status of the jobs
  • Tracks the availability of a task tracker and if there is any hardware failure, the task is assigned to a new task tracker.


Name Node is the coordinator for HDFS
Keeps information on data location
Client talks to NameNode (for read/write) and gets redirected to the Task Tracker which has the data.
Note: Data never flows via the NameNode. NameNode only provides the data location details.



Clustered Environment diagram with one Job Tracker and one Name Node.



Saturday, April 12, 2014

Big Data - An introduction (benefits and advantages)

Refer Hadoop Introduction

The amount of data being generated and being stored is growing every year.
The sources of the data is increasing too (Smartphones, blogs, social media feeds etc).
Much of this data can be used effectively to make better business decisions.




By leveraging big data, businesses can make sense of unstructured and structured data to better understand customer behavior.

Whats the new change?
Customer intelligence and business intelligence have traditionally focused on past data, whereas Big Data can provide forward-looking insights.

Big Data analytics promises to make our world a more intuitive place and businesses need to develop their data analytics capabilities to capitalize on the trend.



Data can be used to influence your purchasing.
Helps an organization go from being Reactive to Proactive   







What does analytics mean?
There are three A's:
  • Analytics on the data - What happened? [Co-relation]
  • Attribution of the data - Why it happened? [Cause]
  • Algorithms written on the above two

Business advantages of this data?
A users search pattern can help companies predict his/her action and can help them in promoting products.
Companies can predict
  • The movies you like
  • The music you like
  • Your current state of mind (if predicted based on your searches) can be used to help you find the right products and also influence you in buying more "similar-searched" products (used effectively by amazon)
  • Google can predict weeks in advance which area could have a flu outbreak if many people in the same locality are searching details on a flu outbreak
  • Hurricane notices are given a week in advance. Companies can use historic data to predict which products can sell more before a hurricane arrives (based on the nature of the people's action) and can stock up on those products proactively.
  • Human behavior is analyzed and it helps companies make more revenues - e.g a grocery store may sell more 100 INR wine bottles if it has three options of 50 INR, 100 INR and 500 INR compared to if it had two options of 50 INR and 100 INR. The 500 INR may not sell, but is used on the human behavior prediction to sell 100 INR bottles.

Big Data processes:

Step 1.
Get/Acquire as much data as possible from as many sources as possible.

Step 2.
Store the data in Hadoop distributed file system (HDFS)

Step 3.
Browse data, see relationships, identify patterns across the data sets

Step 4.
Use map reduce algorithm to transform, organize and aggregate information.
Data mining and analytic tools are used on this aggregated data (combined with existing data).
The relationships can be visualized by graphical charts/reports to provide value to end business users.

Hadoop addresses challenges created by Big Data, namely:

  • Velocity: Lot of data coming in at high speed
  • Volume: Lots of data being gathered (and volume is ever growing)
  • Variety: Data is from varied sources (audio, video, log files - not organized data)
We will have more sessions on Hadoop and Map Reduce and explain them in detail.

Refer Hadoop Introduction