Wednesday, 28 November 2018

How to Prepare the BI Reports in Oracle Fusion Applications

How to Prepare the BI Reports by using the Simple SQL Query

Please find the below setups for Preparing the BI Reports

How to find out the Basic table information in Fusion applications

Search the Google “oracle enterprise repository”

Or Use the URL: http://www.oracle.com/webfolder/technetwork/docs/HTML/oer-redirect.html

Once we can search the “oracle enterprise repository” or use the above URL it will display the below image

Once we can click on Financial tab it will display the Version of the Oralce. Here I am selecting the Version Release R12

Once Click on the Version Release R12 the below screen page will open

Same page we can scroll down w e can find the Tables and Views for Oracle Financial Cloud
Once click the Tables and Views the below screen page will open
  
In the below screen we can select the AP_INVOICES_ALL table name

From AP_Invoices_ALl table I am selecting the data like INVOICE_AMOUNT,INVOICE_NUM,INVOICE_DATE

Step 1: Login as Application User

Step 2: you will be in home page as below
 Step 3: we need to navigate to Functional Setup Manager, click on User Name and you will be able to see Setup and Maintenance option it will navigate you to functional setup manger.


Step 4: below is the functional setup manager window, we could able to see all the offerings as provisioned and enabled
 Step 5: we could see Financial’s Offering as provisioned and enabled,  we need to  click on Implementation projects button in the below screenshot.


Step 6: Search for our Project in the search window
 Step 7: Click on project name (hyperlink), it will open the project page
Go to the Fusion applications Navigator and select Reports and Analytics
It will display the below screen and Click on Browse Catalog Icon which  is highlighted in Yellow Colour 
Right side Click on the Expand the New tab and select the Data Model
After click on Data Model below screen image will open and then click on Diagram and then select the SQL Query

Once we can click on SQL Query it will display the below image and enter the Name of the Report and write the SQL Query

In the below screen I am Creating the Invoice data like for Invoice date,amount and Number

Query is Select INVOICE_AMOUNT,INVOICE_NUM,INVOICE_DATE from AP_Invoices_ALL and then click on Ok .

After Click on Ok it will display the below Screen image and View Data

In the below screen we can select the number of rows to display in the report and we can view the report in either Table view or Tree view and then click on Save as sample data and then Create the Report
First we need to save the data has a Save as Sample Data 
Once We can click on Save as Sample Data we will get confirmation message
Once Data is save has Sample data we can Save symbol which is Highlighted in Yellow color


Enter the Report name and description and save the report in respective folder and click ok

Click on Create Report Which is highlighted in Yellow Color

  
Select the Report layout like Table,Chart,Pivot Table and Click on Next
Here we can drag and drop the report how we want the report. Here I can select the report Invoice num,Invoice Date and Invoice Amount
If we want to show the Invoice Grand Total we can enable the check box Show Grand Totals Row

Click on Next it will display the below image
We can save the report in Respective Folder and click on ok


Report is display like this. If we want we can save this report or Print 




Here we can use the Report Output Format






Invoice Payment in Oracle Fusion Applications

 Invoice Payment in Oracle Fusion Applications
Please find the below setups for Creating the Customer
Step1: Login as Application User
Step2: you will be in home page as below

Step3: we need to navigate to Functional Setup Manager, click on User Name and you will be able to see Setup and Maintenance option it will navigate you to functional setup manger.

Steup4: below is the functional setup manager window, we could able to see all the offerings as provisioned and enabled
Step5: we could see Financial’s Offering as provisioned and enabled,  we need to  click on Implementation projects button in the below screenshot.

Step6: Search for our Project in the search window
Step7: Click on project name (hyperlink), it will open the project page
Step8: Go to navigator select the task Payables and click on the payments

Step8: Payment workbench go to task options and click on the create payment option 

Step8:In the below screen we can enter the required information for making the payment.

Creating the Invoice in Oracle Fusion Applications

Creating the Invoice in Oracle Fusion Applications
Please find the below setups for Creating the Customer
Step 1: Login as Application User

Step 2: you will be in home page as below
Step 3: we need to navigate to Functional Setup Manager, click on User Name and you will be able to see Setup and Maintenance option it will navigate you to functional setup manger.


Step 3: we need to navigate to Functional Setup Manager, click on User Name and you will be able to see Setup and Maintenance option it will navigate you to functional setup manger.
 Step 5: we could see Financial’s Offering as provisioned and enabled,  we need to  click on Implementation projects button in the below screenshot.

  
Step 6: Search for our Project in the search window

Step 7: Click on project name (hyperlink), it will open the project page
 Step 8: Go to Navigator select the task Payables and click on invoices 

Step 9: Once we can click on the Invoice Option it will display the invoice dash board. Here it will display list of all the invoices which are recently entered and hold and prepaid invoices. For creating the new invoices click the task which is highlighted in yellow color.
 Step 10: Once we can click on the Create invoice it will display the invoice workbench

Step 11: Here we can enter the all the required information for creating the invoice like Business unit,supplier,invoice date and amount etc.
Step 12 :If we want to know more information in invoice work bench we can click on the option Show more it will display the detailed information like Accounting,tax and Additional information.

Step 13:   Click on the lines and enter the Invoice line information.

Step 14 : Go to invoice actions and we can validate the invoice.
 Step 15: Go to invoice actions and we can validate the invoice.
Step 16: Here we can click on the post to ledger invoice got accounted and transfer to GL

Step 17: We can verify the same invoice information in general ledger.
Go to navigator and select the General Accounting Task we can click on General Accounting Dash board and click on manage Journals
Step 18: In this screen we can search Invoice details like by using the Accounting period and source




Thursday, 22 November 2018

AWR REPORT

What is AWR

AWR stands for Automated Workload Repository.

It is a built-in repository that exists in every Oracle Database.

Oracle have provided many performance gathering and reporting tools over the years.

Originally the UTLBSTAT/UTLESTAT scripts were used to monitor performance metrics.

At regular intervals, the Oracle Database makes a snapshot of all of its vital statistics.

The workload information is stored in the AWR.

AWR was first introduced with Oracle 10g.

AWR Features

The AWR is used to collect performance statistics including:

Wait events used to identify performance problems.

Time model statistics indicating the amount of DB time associated with a process.

Active Session History (ASH) statistics.

Object usage statistics.

Resource intensive SQL statements.

Step 1 : Snapshots

By default snapshots of the relevant data are taken every hour and retained for 7 days.

The default values for these settings can be altered using the following procedure.

BEGIN
  DBMS_WORKLOAD_REPOSITORY.modify_snapshot_settings(
    retention => 43200,        -- Minutes (= 30 Days). Current value retained if NULL.
    interval  => 30);          -- Minutes. Current value retained if NULL.
END;
/

Step 2 : Baselines

A baseline is a pair of snapshots that represents a specific period of usage.

Once baselines are defined they can be used to compare current performance against similar periods in the past.

We create baseline to represent a period of batch processing.


BEGIN
  DBMS_WORKLOAD_REPOSITORY.create_baseline (
    start_snap_id => 210,
    end_snap_id   => 220,
    baseline_name => 'batch baseline');
END;
/
The snapshots associated with a baseline are retained until the baseline is explicitly deleted.

BEGIN
  DBMS_WORKLOAD_REPOSITORY.drop_baseline (
    baseline_name => 'batch baseline',
    cascade       => FALSE); -- Deletes associated snapshots if TRUE.
END;
/

Step 3 : Workload Repository Reports

Oracle provides two scripts to produce workload repository reports.

1)awrrpt.sql

2)awrrpti.sql)


The reports can be generated by running the above scripts in sqlplus.

@$ORACLE_HOME/rdbms/admin/awrrpt.sql
@$ORACLE_HOME/rdbms/admin/awrrpti.sql

The scripts prompt you to enter the report format (html or text), the start snapshot id, the end snapshot id and the report filename.

The resulting report can be opened in a browser or text editor.

Step 4 : Workload Repository Reports Usage

If you are new to the AWR reports, the first thing you should probably do is run the ADDM report.

The ADDM report provides root cause analysis of the parts of the system consuming the most time.

When looking at an AWR report, a good place to start is the "Top 5 Timed Foreground Events" section.

This gives you an indication of the bottlenecks in the system during this sample period.


Once you've identified the top events, drill down to see what SQL and PL/SQL are consuming the majority of those resources.

On the "Main Report" section, click the "SQL Statistics" link.



On the "SQL Statistics" section, click the link that most closely relates to the wait event you identified in the "Top 5 Timed Foreground Events" section.

In our case, the "DB CPU" was the top event.
       

You will be then presented with the SQL and PL/SQL that are using most of the specified resource during the sample period.

You can then attempt to tune these areas to reduce the impact.


SQL Developer and AWR Reports 

If you are using SQL Developer 4 onward, you can view AWR reports directly from SQL Developer.

If it is not already showing, open the DBA pane "View > DBA", expand the connection of interest, then expand the "Performance" node.

The AWR reports are available from the "AWR" node.

       

Fast Index Scan, Index Scan , Partition Range Scan and Full Table Scan

Full Table Scan (FTS)

FTS scans the entire table to fetch the results I.e reads the every row of the table to find all records meeting the given requirements

Even if the query selects just a few rows from the table, all rows in the entire table will be examined

Table scan on larger tables take excessive amount of time and cause performance problem


Following are the situations where optimizer chooses Full Table Scans:-

Lack of Index.
The query predicate applies a function to the indexed column.
Select COUNT(*) with B-Tree indexes & Nulls.
Large Amount of Data
Small Table
High Degree of Parallelism
FTS Hint
The table statistics are stale.
The query predicate does not use the leading edge of a B-tree index..
The query is unselective.

Pros:

The cost is predictable, as every time database system needs to scan full table row by row.
When table is less than 2 percent of database block buffer then full scan table is quicker.

Cons:

Full table scan occurs when there is no index or index is not being used by SQL. And the result of full scan table is usually slower that index table scan. The situation is that: the larger the table, the slower of the data returns.
Unnecessary full-table scan will lead to a huge amount of unnecessary I/O with a process burden on the entire database.

Index Scan

The Index Scans is a access path used by the query optimizer to produce the best Sql Engine - (Physical|Execution) Plan.

In this method, a row is retrieved by traversing the index, using the indexed column values specified by the statement

An index scan retrieves data from an index based on the value of one or more columns in the index.

To perform an index scan, Oracle searches the index for the indexed column values accessed by the statement

If the statement accesses only columns of the index, then Oracle reads the indexed column values directly from the index, rather than from the table.

The index contains :

not only the indexed value,
but also the rowids of rows in the table having that value.

Therefore, if the statement accesses other columns in addition to the indexed columns, then Oracle can find the rows in the table by using either a table access by rowid or a Cluster Scan/Access.

An index scan can be one of the following types:

Index Unique Scans

This scan returns, at most, a single rowid. Oracle performs a unique scan if a statement contains a UNIQUE or a PRIMARY KEY constraint that guarantees that only a single row is accessed.

Example


An index scan is performed on the jobs and departments tables, using the job_id_pk and dept_id_pk indexes respectively.

Index Range Scans

An index range scan is a common operation for accessing selective data. It can be bounded (bounded on both sides) or unbounded (on one or both sides). Data is returned in the ascending order of index columns. Multiple rows with identical values are sorted in ascending order by rowid.

If data must be sorted by order, then use the ORDER BY clause, and do not rely on an index. If an index can be used to satisfy an ORDER BY clause, then the optimizer uses this option and avoids a sort.

Example 

In this example, the order has been imported from a legacy system, and you are querying the order by the reference used in the legacy system. Assume this reference is the order_date.


This should be a highly selective query, and you should see the query using the index on the column to retrieve the desired rows. The data returned is sorted in ascending order by the rowids for the order_date. Because the index column order_date is identical for the selected rows here, the data is sorted by rowid.

Index Range Scans Descending

An index range scan descending is identical to an index range scan, except that the data is returned in descending order. Indexes, by default, are stored in ascending order. Usually, this scan is used when ordering data in a descending order to return the most recent data first, or when seeking a value less than a specified value.

Index Skip Scans

Index skip scans improve index scans by non-prefix columns. Often, scanning index blocks is faster than scanning table data blocks.

Skip scanning lets a composite index be split logically into smaller sub-indexes. In skip scanning, the initial column of the composite index is not specified in the query. In other words, it is skipped.

The number of logical sub-indexes is determined by the number of distinct values in the initial column. Skip scanning is advantageous if there are few distinct values in the leading column of the composite index and many distinct values in the non-leading key of the index.

Consider, for example, a table employees (sex, employee_id, address) with a composite index on (sex, employee_id). Splitting this composite index would result in two logical sub-indexes, one for M and one for F.

For this example, suppose you have the following index data:

The index is split logically into the following two sub-indexes:

The first sub-index has the keys with the value F.
The second sub-index has the keys with the value M.
The column sex is skipped in the following query:


A complete scan of the index is not performed, but the sub-index with the value F is searched first, followed by a search of the sub-index with the value M.

Full Index Scan

A full index scan eliminates a sort operation, because the data is ordered by the index key. It reads the blocks singly. A full scan is used in any of the following situations:

An ORDER BY clause that meets the following requirements is present in the query:

All of the columns in the ORDER BY clause must be in the index.
The order of the columns in the ORDER BY clause must match the order of the leading index columns.

The ORDER BY clause can contain all of the columns in the index or a subset of the columns in the index.

The query requires a sort merge join. A full index scan can be done instead of doing a full table scan followed by a sort if the query meets the following requirements:

All of the columns referenced in the query must be in the index.
The order of the columns referenced in the query must match the order of the leading index columns.

The query can contain all of the columns in the index or a subset of the columns in the index.

A GROUP BY clause is present in the query, and the columns in the GROUP BY clause are present in the index. The columns do not need to be in the same order in the index and the GROUP BY clause. The GROUP BY clause can contain all of the columns in the index or a subset of the columns in the index.

Fast Full Index Scans

Fast full index scans are an alternative to a full table scan when the index contains all the columns that are needed for the query, and at least one column in the index key has the NOT NULL constraint. A fast full scan accesses the data in the index itself, without accessing the table. It cannot be used to eliminate a sort operation, because the data is not ordered by the index key. It reads the entire index using multiblock reads, unlike a full index scan, and can be parallelized.

Fast full index scans cannot be performed against bitmap indexes.

A fast full scan is faster than a normal full index scan in that it can :

use multiblock I/O
and be parallelized just like a table scan.
Note: Setting PARALLEL for indexes will not impact the cost calculation.

You can specify fast full index scans with the initialization parameter OPTIMIZER_FEATURES_ENABLE or the INDEX_FFS hint.

Index Joins

An index join is a hash join of several indexes that together contain all the table columns that are referenced in the query. If an index join is used, then no table access is needed, because all the relevant column values can be retrieved from the indexes. An index join cannot be used to eliminate a sort operation.

Bitmap Indexes

A bitmap join uses a bitmap for key values and a mapping function that converts each bit position to a rowid. Bitmaps can efficiently merge indexes that correspond to several conditions in a WHERE clause, using Boolean operations to resolve AND and OR conditions.

Partition Range Scan

Oracle optimizes partitioned queries differently than regular queries.

Oracle tries to pick the fastest elapsed time to the data, not the lowest cost.

The Optimizer typically scans partitions first

Scans only relevant partitions (called pruning)

Try to avoid functions on partitioning key values in WHERE clauses

Try to avoid subqueries on partitioning key values

Maybe avoid indexes on partitioning keys (Oracle uses efficient multi-block scans with fewer I/O than using indexes and single block reads)

Want to avoid “long ops”operations

Oracle Parallel Server and RAC instances can break a SQL up across processors and return the pieces for a much faster response time on larger objects.

Consider where your data is in the partitioned object. If the selected rows are across the partition, it might be considerably faster to do a full-table scan (using multi-block read-ahead of course) than to do single block reads, even on a local-partitioned index.