Wednesday, 26 February 2014

'IOError: File not found' Message When Specifying Filepaths With Jython Scripts Launched From ODI Jython Technology Specific Procedures

'IOError: File not found' Message When Specifying Filepaths
With Jython Scripts Launched From ODI Jython Technology Specific Procedures




When accessing a file with Jython in an ODI Specific Procedure, the following message is displayed in the execution tab of ODI Log :
IOError: File not found - <full file name>

However, the file does indeed exist and the filepath has been correctly hardcoded into the Jython script. What is the problem here ?

When specifying extended filepaths for files under Windows operating systems, the use of backslashes in the filepath may be problematical.

It is strongly recommended to use forward slashes ('/') in operating system filepath specifications in Jython scripts launched from ODI Specific Procedures on Jython Technology.

For example :
C:/tmp/myfile.txt
/home/myapplication/myfile.txt

Escaping < ? ... ? > Tags in Jython scripts

When developing a Jython script which manipulates strings containing tags similar to those used by ODI such as:

xmlString.append('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>')

ODI interprets the <? strings as its own private tags and is unable to continue processing.
Is there any way of "escaping" these strings so that no interpretation errors are signaled ?
When manipulating '<?' and' ?>' tags (in cases where XML files are to be created) in Jython scripts from ODI Specific Procedures based on the Jython technology, ODI treats them as its own specific Java tags and, as a result, cannot compile the program.

Troubleshooting either:
    • prefix each ? with the $ character (ie '<$?' and '$?>').
    • use the Unicode or hexadecimal representations (ie '<\u003F' and '\u003F>'; or <\x3F' and '\x3F>').
    • use an ODI Variable.

Jython code on the Source tab of an ODI Procedure

Jython code on the Source tab of an ODI Procedure

In an ODI Procedure, is it possible to execute Jython code on the "Command on Source" tab?

Yes this is possible.

javax.mail.MessagingException: Could not connect to SMTP host in ODI sentmail

1. Check if the SMTP server is working by trying to connect from server where the Weblogic Server is running to the server where is the SMTP mail server is installed and send an mail.

Here are steps to check:
bash-2.05$ telnet <your mail server> 25
Trying 127.0.0.1...
Connected to server.
Escape character is '^]'.
220 server ESMTP Exim 3.35 #1 Wed, 07 May 2003 11:27:45 +0100


HELO eMonster
250 server Hello emonster [127.0.0.1]

MAIL From:<Sender email address>
250 <your email address> is syntactically correct

RCPT To:<Receiver email address>
250 <Receiver email address> is syntactically correct

DATA
354 Enter message, ending with "." on a line by itself
This is a test email

From,
Enter some text ....
.
250 OK id=19DMAH-0003tv-00
^]
telnet> quit
Connection to server closed.
bash-2.05$

2. You need to set a host name and IP Address in /etc/hosts.
3. You need to check if a server port  is correct.
4. Current server and port values you can find in oms-config.xml.


Reference: Cannot Send Email: Javax.mail.MessagingException: Could Not Connect To SMTP Host (Doc ID 1280242.1)

Send mail using Jython Script using Procedure in ODI

import smtplib
import string
BODY = string.join((
"From: %s" % 'senderemailaddress@gmail.com',
"To: %s" % 'recipientemailaddress@gmail.com',
"Subject: %s" % 'Test Mail',
"",'This is a test email from ODI'
), "\r\n")
sender = smtplib.SMTP('smtp.gmail.com',587)
sender.set_debuglevel(1)
sender.ehlo()
sender.starttls()
sender.ehlo()
sender.login('senderusername', 'senderpassword')
sender.sendmail('senderemailaddress',['recipientemailaddress'],BODY)
sender.close()

Saturday, 19 October 2013

Oracle Data Integrator ODI 12c (12.1.2) is out.

That’s it! The long awaited Oracle Data Integrator 12c is out!  You can find the 12.1.2 version on the ODI Downloads page

New Features in Oracle Data Integrator 12c (12.1.2)

 

Declarative Flow-Based User Interface
The new declarative flow-based user interface combines the simplicity and ease-of-use of the declarative approach with the flexibility and extensibility of configurable flows. Mappings (the successor of the Interface concept in Oracle Data Integrator 11g) connect sources to targets through a flow of components such as Join, Filter, Aggregate, Set, Split, and so on.

Reusable Mappings
Reusable Mappings can be used to encapsulate flow sections that can then be reused in multiple mappings. A reusable mapping can have input and output signatures to connect to an enclosing flow; it can also contain sources and targets that are encapsulated inside the reusable mapping.

Multiple Target Support
A mapping can now load multiple targets as part of a single flow. The order of target loading can be specified, and the Split component can be optionally used to route rows into different targets, based on one or several conditions.

Step-by-Step Debugger
Mappings, Packages, Procedures, and Scenarios can now be debugged in a step-by-step debugger. Users can manually traverse task execution within these objects and set breakpoints to interrupt execution at pre-defined locations. Values of variables can be introspected and changed during a debugging session, and data of underlying sources and targets can be queried, including the content of uncommitted transactions.

Runtime Performance Enhancements
The runtime execution has been improved to enhance performance. Various changes have been made to reduce overhead of session execution, including the introduction of blueprints, which are cached execution plans for sessions. Performance is improved by loading sources in parallel into the staging area. Parallelism of loads can be customized in the physical view of a map. Users also have the option to use unique names for temporary database objects, allowing parallel execution of the same mapping.

Oracle GoldenGate Integration Improvements
The integration of Oracle GoldenGate as a source for the Change Data Capture (CDC) framework has been improved in the following areas:
  • Oracle GoldenGate source and target systems are now configured as data servers in Topology. Extract and replicate processes are represented by physical and logical schemas. This representation in Topology allows separate configuration of multiple contexts, following the general context philosophy.
  • Most Oracle GoldenGate parameters can now be added to extract and replicate processes in the physical schema configuration. The UI provides support for selecting parameters from lists. This minimizes the need for the modification of Oracle GoldenGate parameter files after generation.
  • A single mapping can now be used for journalized CDC load and bulk load of a target. This is enabled by the Oracle GoldenGate JKM using the source model as opposed to the Oracle GoldenGate replication target, as well as configuration of journalizing in mapping as part of a deployment specification. Multiple deployment specifications can be used in a single mapping for journalized load and bulk load.
  • Oracle GoldenGate parameter files can now be automatically deployed and started to source and target Oracle GoldenGate instances through the JAgent technology.

Standalone Agent Management with WebLogic Management Framework
Oracle Data Integrator standalone agents are now managed through the WebLogic Management Framework. This has the following advantages:
  • UI-driven configuration through Configuration Wizard
  • Multiple configurations can be maintained in separate domains
  • Node Manager can be used to control and automatically restart agents

Integration with OPSS Enterprise Roles
Oracle Data Integrator can now use the authorization model in Oracle Platform Security Services (OPSS) to control access to resources. Enterprise roles can be mapped into Oracle Data Integrator roles to authorize enterprise users across different tools.

XML Improvements
The following XML Schema constructs are now supported:
  • list and union - List or union-based elements are mapped into VARCHAR columns.
  • substitutionGroup - Elements based on substitution groups create a table each for all types of the substitution group.
  • Mixed content - Elements with mixed content map into a VARCHAR column that contains text and markup content of the element.
  • Annotation - Content of XML schema annotations are stored in the table metadata.

Oracle Warehouse Builder Integration
Oracle Warehouse Builder (OWB) jobs can now be executed in Oracle Data Integrator through the OdiStartOwbJob tool. The OWB repository is configured as a data server in Topology. All the details of the OWB job execution are displayed as a session in the Operator tree.

Unique Repository IDs
Master and Work Repositories now use unique IDs following the GUID convention. This avoids collisions during import of artifacts and allows for easier management and consolidation of multiple repositories in an organization.

  :  Source from Oracle.com

Thursday, 1 August 2013

Find TABLESPACE Usage size and free space size in Oracle

   
FIND TABLESPACE SIZE USAGE AND FREE SPACE :
-------------------------------------------

select
   tablespace_name,
   used_percent
from
   dba_tablespace_usage_metrics
where
   used_percent > 90;

  SELECT  a.tablespace_name,
    ROUND (((C.BYTES - NVL (B.BYTES, 0)) / C.BYTES) * 100,2) PERCENTAGE_USED,
    C.BYTES / 1024 / 1024/ 1024 SPACE_ALLOCATED,
    ROUND (C.BYTES / 1024 / 1024/ 1024 - NVL (B.BYTES, 0) / 1024 / 1024/ 1024,2) SPACE_USED,
    ROUND (NVL (b.BYTES, 0) / 1024 / 1024/ 1024, 2) space_free,
    c.DATAFILES
  FROM dba_tablespaces a,
       (    SELECT   tablespace_name,
                  SUM (BYTES) BYTES
           FROM   dba_free_space
       GROUP BY   tablespace_name
       ) b,
      (    SELECT   COUNT (1) DATAFILES,
                  SUM (BYTES) BYTES,
                  tablespace_name
           FROM   dba_data_files
       GROUP BY   tablespace_name
    ) c
  WHERE b.tablespace_name(+) = a.tablespace_name
    and C.TABLESPACE_NAME(+) = a.TABLESPACE_NAME
ORDER BY NVL (((c.BYTES - NVL (b.BYTES, 0)) / c.BYTES), 0) DESC;



select a.TABLESPACE_NAME,
  ROUND(a.TOTSIZE    /1024/1024/1024,0) "Total Size (GB)",
  ROUND(NVL(b.used,0)/1024/1024/1024,0) "Used (GB)",
  100                - ROUND(((a.totsize - NVL(b.used,0)) / a.totsize) * 100,0) "%Used",
  ROUND(((a.TOTSIZE  - NVL(B.USED,0)) / a.TOTSIZE) * 100,0) "% Free",
  (ROUND(a.totsize   /1024/1024/1024,0)-ROUND(NVL(b.used,0)/1024/1024/1024,0) ) "Free GB"
FROM
  (SELECT tablespace_name,
    SUM(bytes) totsize
  FROM dba_data_files
  GROUP BY tablespace_name
  ) a,
  (SELECT tablespace_name,
    SUM(bytes) used
  FROM dba_segments
  GROUP BY tablespace_name
  ) b
where a.TABLESPACE_NAME=B.TABLESPACE_NAME
ORDER BY 1;