SlideShare a Scribd company logo
1 of 9
Analyze Table through informatica
13/11/2014
Union Bank of California
Relationship-UB
Indrajit Srimani
Domain-Finance
indrajit.srimani@tcs.com
Confidentiality Statement
Includethe confidentiality statement within the box provided.This has to be legally
approved
ConfidentialityandNon-Disclosure Notice
The information contained in this documentis confidential and proprietary to TATA
ConsultancyServices. This information may not be disclosed,duplicated or used forany
other purposes.The information containedin this documentmay notbe released in whole
or in part outside TCSfor any purposewithoutthe express written permission of TATA
ConsultancyServices.
Tata Code of Conduct
We, in ourdealings, are self-regulated by a Codeof Conductasenshrined in the Tata Code
ofConduct.We requestyour supportin helping us adhere tothe Codein letter and spirit.
We request that any violation orpotential violation ofthe Code by anyperson be promptly
broughtto the notice ofthe Local EthicsCounseloror the Principal EthicsCounselor orthe
CEOof TCS. All communication received in this regard will be treated and kept as
confidential.
Table of Content
1. INTRODUCTION...................................................................................4
2. SCENARIO............................................................................................5
3. IMPLEMENTATION ..............................................................................6
1. INTRODUCTION
We can use the DBMS_STATS package or the ANALYZE statement to gather
statistics about the physical storage characteristics of a table, index, or cluster.
These statistics are stored in the data dictionary and can be used by the
optimizer to choose the most efficient execution plan for SQL statements
accessing analyzed objects.
Oracle recommends using the more versatile DBMS_STATS package for
gathering optimizer statistics, but you must use the ANALYZE statement to
collect statistics unrelated to the optimizer, such as empty blocks, average
space, and so forth.
The DBMS_STATS package allows both the gathering of statistics, including
utilizing parallel execution, and the external manipulation of statistics. Statistics
can be stored in tables outside of the data dictionary, where they can be
manipulated without affecting the optimizer. Statistics can be copied between
databases or backup copies can be made.
2. SCENARIO
Purpose of this document of to explain how we can analyze an oracle table
while processing data using ETL tool Informatica. Suppose there is a table in
ORACLE database which is very huge in size(GB). As per business requirement,
we have to use look up transformation on this table may be once or couple of
time. It will cause a huge performance problem. The mapping may take couple
of hours to get it complete or it may stuck for ever. One of the solution
overcome this situation is to analyze the table before execution of the specific
mapping which will speed up the execution. In that case ANALYZE statement
needs to be included in PRE_SQL command of session level. But the biggest
challenge is, developer needs admin rights to execute such command at ORACLE
db which is not granted usually. So the trick here is, create one
STORED_PROCEDURE for analyze the particular table and we can have
execution right very easily for this STORED_PROCEDURE.
3. IMPLEMENTATION
Create or compile the below stored procedure at particular schema in which the
table is exists.
STORED PROCEDURE
CREATE OR REPLACE PROCEDURE SCHEMA_NAME.SP_NAME(TABLE_NAME inVARCHAR2, cascade_opt in
VARCHAR2) as ot_cascade Boolean;
BEGIN
dbms_application_info.set_module(‘SP_NAME’,’analyze SCHEMA_NAMEtable’);
dbms_application_info.set_action(‘analyze table’||TABLE_NAME);
IF length(TABLE_NAME) >32 THEN
dbms_application_info.set_action(NULL);
dbms_application_info.set_module(NULL,NULL);
raise_application_error(-20002,’SP_NAME:’||cascade_opt,TRUE);
END IF;
IF length(cascade_opt) >5 THEN
dbms_application_info.set_action(NULL);
dbms_application_info.set_module(NULL,NULL);
raise_application_error(-20002,’SP_NAME:’||cascade_opt,true);
END IF;
IF cascade_opt= ‘TRUE’ OR cascade_opt= ‘true’ then
ot_cascade := true;
ELSE
ot_cascade := false;
END IF;
dbms_stats.gather_table_stats(‘SCHEMA_NAME’ ,TABLE_NAME , cascade => ot_cascade,estimate_percent=>33,
granularity => ‘ALL’ , degree =>6);
dbms_application_info.set_action(NULL);
dbms_application_info.set_module(NULL,NULL);
exception
whenothers then
dbms_application_info.set_action(NULL);
dbms_application_info.set_module(NULL,NULL);
END SP_NAME;
/
SYNONYM AND GRANT
Create synonym for the store procedure for a particular user. Get the list of role
for the particular schema from DBA and give execute and debug grant like
below.
CREATE OR REPLACE SYNONYMUSER.SP_NAME FOR SCHEMA_NAME.SP_NAME;
GRANT EXECUTE,DEBUG ON SCHEMA_NAME.SP_NAME to SCHEMA_ADMIN_ROLE;
CALL STORE PROCEDURE FROM INFORMATICA
Call the above created Store Procedure through Pre_SQL command of informatica(ETL) like
below.
BEGIN
SP_NAME (‘TABLE_NAME’,’TRUE’);
END ;
Thank You
About Tata Consultancy Services (TCS)
Tata ConsultancyServices is an IT services, consulting andbusiness solutions
organizationthat delivers real results to global business, ensuring a level of certaintyno
other firm can match. TCS offers a consulting-led, integrated portfolioof IT andIT-
enabledinfrastructure, engineering andassurance services. Thisis deliveredthroughits
unique Global NetworkDeliveryModelTM, recognizedas the benchmark ofexcellence in
software development. A part of the Tata Group, India’s largest industrial conglomerate,
TCS has a global footprint and is listedonthe National Stock Exchange and Bombay
Stock Exchange inIndia.
For more information, visit us at www.tcs.com.
IT Services
Business Solutions
Consulting
All content / information present here is the exclusive property of Tata Consultancy Services Limited (TCS). The content /
information contained here is correct at the time of publishing. No material from here may be copied, modified,
reproduced, republished, uploaded, transmitted, posted or distributed in any form without prior written permission from
TCS. Unauthorized use of the content / information appearing here may violate copyright, trademark and other applicable
laws, and could result in criminal or civil penalties. Copyright © 2011 Tata Consultancy Services Limited

More Related Content

Similar to How to analyze_table_through_informatica

Open Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and HistogramsOpen Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and HistogramsFrederic Descamps
 
RivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and HistogramsRivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and HistogramsFrederic Descamps
 
Sql interview question part 8
Sql interview question part 8Sql interview question part 8
Sql interview question part 8kaashiv1
 
Performance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and ApexPerformance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and ApexSalesforce Developers
 
Creating Database 2010
Creating Database 2010Creating Database 2010
Creating Database 2010tgushi12
 
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?Jim Czuprynski
 
SQL Server Performance Tuning with DMVs
SQL Server Performance Tuning with DMVsSQL Server Performance Tuning with DMVs
SQL Server Performance Tuning with DMVsFranklin Yamamoto
 
MySQL Performance Schema : fossasia
MySQL Performance Schema : fossasiaMySQL Performance Schema : fossasia
MySQL Performance Schema : fossasiaMayank Prasad
 
Data Redaction - OTN TOUR LA 2015
Data Redaction - OTN TOUR LA 2015 Data Redaction - OTN TOUR LA 2015
Data Redaction - OTN TOUR LA 2015 Alex Zaballa
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
 
MAKING MAGIC WITH ORACLE (Francisco Slide)
MAKING MAGIC WITH ORACLE (Francisco Slide)MAKING MAGIC WITH ORACLE (Francisco Slide)
MAKING MAGIC WITH ORACLE (Francisco Slide)TheGameZ
 
Magic With Oracle - Presentation
Magic With Oracle - PresentationMagic With Oracle - Presentation
Magic With Oracle - PresentationFrancisco Alvarez
 
Database@Home : The Future is Data Driven
Database@Home : The Future is Data DrivenDatabase@Home : The Future is Data Driven
Database@Home : The Future is Data DrivenTammy Bednar
 
Managing Oracle Streams Using Enterprise Manager Grid Control
Managing Oracle Streams Using Enterprise Manager Grid ControlManaging Oracle Streams Using Enterprise Manager Grid Control
Managing Oracle Streams Using Enterprise Manager Grid Controlscottb411
 

Similar to How to analyze_table_through_informatica (20)

Open Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and HistogramsOpen Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and Histograms
 
RivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and HistogramsRivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and Histograms
 
Sql interview question part 8
Sql interview question part 8Sql interview question part 8
Sql interview question part 8
 
Ebook8
Ebook8Ebook8
Ebook8
 
Performance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and ApexPerformance Tuning for Visualforce and Apex
Performance Tuning for Visualforce and Apex
 
Creating Database 2010
Creating Database 2010Creating Database 2010
Creating Database 2010
 
Sql transacation
Sql transacationSql transacation
Sql transacation
 
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
 
SQL Server Performance Tuning with DMVs
SQL Server Performance Tuning with DMVsSQL Server Performance Tuning with DMVs
SQL Server Performance Tuning with DMVs
 
MySQL Performance Schema : fossasia
MySQL Performance Schema : fossasiaMySQL Performance Schema : fossasia
MySQL Performance Schema : fossasia
 
Data Redaction - OTN TOUR LA 2015
Data Redaction - OTN TOUR LA 2015 Data Redaction - OTN TOUR LA 2015
Data Redaction - OTN TOUR LA 2015
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
 
MAKING MAGIC WITH ORACLE (Francisco Slide)
MAKING MAGIC WITH ORACLE (Francisco Slide)MAKING MAGIC WITH ORACLE (Francisco Slide)
MAKING MAGIC WITH ORACLE (Francisco Slide)
 
Magic With Oracle - Presentation
Magic With Oracle - PresentationMagic With Oracle - Presentation
Magic With Oracle - Presentation
 
Milestone 3 FINAL
Milestone 3 FINALMilestone 3 FINAL
Milestone 3 FINAL
 
Oracle SQL Tuning
Oracle SQL TuningOracle SQL Tuning
Oracle SQL Tuning
 
Database@Home : The Future is Data Driven
Database@Home : The Future is Data DrivenDatabase@Home : The Future is Data Driven
Database@Home : The Future is Data Driven
 
Managing Oracle Streams Using Enterprise Manager Grid Control
Managing Oracle Streams Using Enterprise Manager Grid ControlManaging Oracle Streams Using Enterprise Manager Grid Control
Managing Oracle Streams Using Enterprise Manager Grid Control
 

More from sushantbit04

Two single node cluster to one multinode cluster
Two single node cluster to one multinode clusterTwo single node cluster to one multinode cluster
Two single node cluster to one multinode clustersushantbit04
 
Apache hadoop 2_installation
Apache hadoop 2_installationApache hadoop 2_installation
Apache hadoop 2_installationsushantbit04
 
A_human_resource_information_system
A_human_resource_information_systemA_human_resource_information_system
A_human_resource_information_systemsushantbit04
 
Characteristics_of_the_database_system
Characteristics_of_the_database_systemCharacteristics_of_the_database_system
Characteristics_of_the_database_systemsushantbit04
 
The_factories_act__1948
The_factories_act__1948The_factories_act__1948
The_factories_act__1948sushantbit04
 
Employees_state_insurance_act
Employees_state_insurance_actEmployees_state_insurance_act
Employees_state_insurance_actsushantbit04
 
Variable_pay _at_care_soft
Variable_pay _at_care_softVariable_pay _at_care_soft
Variable_pay _at_care_softsushantbit04
 
Industrial and labour laws (comprehensive)
Industrial and labour laws (comprehensive)Industrial and labour laws (comprehensive)
Industrial and labour laws (comprehensive)sushantbit04
 

More from sushantbit04 (12)

Two single node cluster to one multinode cluster
Two single node cluster to one multinode clusterTwo single node cluster to one multinode cluster
Two single node cluster to one multinode cluster
 
Apache hadoop 2_installation
Apache hadoop 2_installationApache hadoop 2_installation
Apache hadoop 2_installation
 
A_human_resource_information_system
A_human_resource_information_systemA_human_resource_information_system
A_human_resource_information_system
 
Characteristics_of_the_database_system
Characteristics_of_the_database_systemCharacteristics_of_the_database_system
Characteristics_of_the_database_system
 
Dbms_class _14
Dbms_class _14Dbms_class _14
Dbms_class _14
 
The_factories_act__1948
The_factories_act__1948The_factories_act__1948
The_factories_act__1948
 
Labour_law
Labour_lawLabour_law
Labour_law
 
Employees_state_insurance_act
Employees_state_insurance_actEmployees_state_insurance_act
Employees_state_insurance_act
 
Variable_pay _at_care_soft
Variable_pay _at_care_softVariable_pay _at_care_soft
Variable_pay _at_care_soft
 
Hris_notes
Hris_notesHris_notes
Hris_notes
 
Case2 _layoff
Case2 _layoffCase2 _layoff
Case2 _layoff
 
Industrial and labour laws (comprehensive)
Industrial and labour laws (comprehensive)Industrial and labour laws (comprehensive)
Industrial and labour laws (comprehensive)
 

How to analyze_table_through_informatica

  • 1. Analyze Table through informatica 13/11/2014 Union Bank of California Relationship-UB Indrajit Srimani Domain-Finance indrajit.srimani@tcs.com
  • 2. Confidentiality Statement Includethe confidentiality statement within the box provided.This has to be legally approved ConfidentialityandNon-Disclosure Notice The information contained in this documentis confidential and proprietary to TATA ConsultancyServices. This information may not be disclosed,duplicated or used forany other purposes.The information containedin this documentmay notbe released in whole or in part outside TCSfor any purposewithoutthe express written permission of TATA ConsultancyServices. Tata Code of Conduct We, in ourdealings, are self-regulated by a Codeof Conductasenshrined in the Tata Code ofConduct.We requestyour supportin helping us adhere tothe Codein letter and spirit. We request that any violation orpotential violation ofthe Code by anyperson be promptly broughtto the notice ofthe Local EthicsCounseloror the Principal EthicsCounselor orthe CEOof TCS. All communication received in this regard will be treated and kept as confidential.
  • 3. Table of Content 1. INTRODUCTION...................................................................................4 2. SCENARIO............................................................................................5 3. IMPLEMENTATION ..............................................................................6
  • 4. 1. INTRODUCTION We can use the DBMS_STATS package or the ANALYZE statement to gather statistics about the physical storage characteristics of a table, index, or cluster. These statistics are stored in the data dictionary and can be used by the optimizer to choose the most efficient execution plan for SQL statements accessing analyzed objects. Oracle recommends using the more versatile DBMS_STATS package for gathering optimizer statistics, but you must use the ANALYZE statement to collect statistics unrelated to the optimizer, such as empty blocks, average space, and so forth. The DBMS_STATS package allows both the gathering of statistics, including utilizing parallel execution, and the external manipulation of statistics. Statistics can be stored in tables outside of the data dictionary, where they can be manipulated without affecting the optimizer. Statistics can be copied between databases or backup copies can be made.
  • 5. 2. SCENARIO Purpose of this document of to explain how we can analyze an oracle table while processing data using ETL tool Informatica. Suppose there is a table in ORACLE database which is very huge in size(GB). As per business requirement, we have to use look up transformation on this table may be once or couple of time. It will cause a huge performance problem. The mapping may take couple of hours to get it complete or it may stuck for ever. One of the solution overcome this situation is to analyze the table before execution of the specific mapping which will speed up the execution. In that case ANALYZE statement needs to be included in PRE_SQL command of session level. But the biggest challenge is, developer needs admin rights to execute such command at ORACLE db which is not granted usually. So the trick here is, create one STORED_PROCEDURE for analyze the particular table and we can have execution right very easily for this STORED_PROCEDURE.
  • 6. 3. IMPLEMENTATION Create or compile the below stored procedure at particular schema in which the table is exists. STORED PROCEDURE CREATE OR REPLACE PROCEDURE SCHEMA_NAME.SP_NAME(TABLE_NAME inVARCHAR2, cascade_opt in VARCHAR2) as ot_cascade Boolean; BEGIN dbms_application_info.set_module(‘SP_NAME’,’analyze SCHEMA_NAMEtable’); dbms_application_info.set_action(‘analyze table’||TABLE_NAME); IF length(TABLE_NAME) >32 THEN dbms_application_info.set_action(NULL); dbms_application_info.set_module(NULL,NULL); raise_application_error(-20002,’SP_NAME:’||cascade_opt,TRUE); END IF; IF length(cascade_opt) >5 THEN dbms_application_info.set_action(NULL); dbms_application_info.set_module(NULL,NULL); raise_application_error(-20002,’SP_NAME:’||cascade_opt,true); END IF; IF cascade_opt= ‘TRUE’ OR cascade_opt= ‘true’ then ot_cascade := true; ELSE ot_cascade := false; END IF; dbms_stats.gather_table_stats(‘SCHEMA_NAME’ ,TABLE_NAME , cascade => ot_cascade,estimate_percent=>33, granularity => ‘ALL’ , degree =>6); dbms_application_info.set_action(NULL); dbms_application_info.set_module(NULL,NULL);
  • 7. exception whenothers then dbms_application_info.set_action(NULL); dbms_application_info.set_module(NULL,NULL); END SP_NAME; / SYNONYM AND GRANT Create synonym for the store procedure for a particular user. Get the list of role for the particular schema from DBA and give execute and debug grant like below. CREATE OR REPLACE SYNONYMUSER.SP_NAME FOR SCHEMA_NAME.SP_NAME; GRANT EXECUTE,DEBUG ON SCHEMA_NAME.SP_NAME to SCHEMA_ADMIN_ROLE; CALL STORE PROCEDURE FROM INFORMATICA Call the above created Store Procedure through Pre_SQL command of informatica(ETL) like below. BEGIN SP_NAME (‘TABLE_NAME’,’TRUE’); END ;
  • 9. About Tata Consultancy Services (TCS) Tata ConsultancyServices is an IT services, consulting andbusiness solutions organizationthat delivers real results to global business, ensuring a level of certaintyno other firm can match. TCS offers a consulting-led, integrated portfolioof IT andIT- enabledinfrastructure, engineering andassurance services. Thisis deliveredthroughits unique Global NetworkDeliveryModelTM, recognizedas the benchmark ofexcellence in software development. A part of the Tata Group, India’s largest industrial conglomerate, TCS has a global footprint and is listedonthe National Stock Exchange and Bombay Stock Exchange inIndia. For more information, visit us at www.tcs.com. IT Services Business Solutions Consulting All content / information present here is the exclusive property of Tata Consultancy Services Limited (TCS). The content / information contained here is correct at the time of publishing. No material from here may be copied, modified, reproduced, republished, uploaded, transmitted, posted or distributed in any form without prior written permission from TCS. Unauthorized use of the content / information appearing here may violate copyright, trademark and other applicable laws, and could result in criminal or civil penalties. Copyright © 2011 Tata Consultancy Services Limited