Saturday, October 15, 2016

How to rename files using ODI?

Approach:

1. Create Package
2. Drag and Drop ODIFileMove from tool bar to package
3. Select ODIFileMove -- Go to Property inspector -- Go to General -- File name option (Specify your original file name -- Target File name option (Specify your new file name)

Completed Successfully!!!!

ODI-1217: Session () fails with return code 0.

Error Message:
ODI-1217: Session <session name> (<Session number>) fails with return code 0.
at oracle.odi.runtime.agent.execution.SessionExecutor.closeSession(SessionExecutor.java:2693)

Whenever you start a job it fails immediately without executing it's steps.

Root Cause:
Tablespace is full.

How to confirm?

1. Connect to Database Admin (SYSDBA) where your repositories are created and execute Following Query:

SELECT a.file_name,
       substr(A.tablespace_name,1,20) tablespace_name,
       trunc(decode(A.autoextensible,'YES',A.MAXSIZE-A.bytes+b.free,'NO',b.free)/1024/1024) free_mb,
       trunc(a.bytes/1024/1024) allocated_mb,
       trunc(A.MAXSIZE/1024/1024) capacity,
       a.autoextensible ae
FROM (
     SELECT file_id, file_name,
            tablespace_name,
            autoextensible,
            bytes,
            decode(autoextensible,'YES',maxbytes,bytes) maxsize
     FROM   dba_data_files
     GROUP BY file_id, file_name,
              tablespace_name,
              autoextensible,
              bytes,
              decode(autoextensible,'YES',maxbytes,bytes)
     ) a,
     (SELECT file_id,
             tablespace_name,
             sum(bytes) free
      FROM   dba_free_space
      GROUP BY file_id,
               tablespace_name
      ) b
WHERE a.file_id=b.file_id(+)
AND A.tablespace_name=b.tablespace_name(+)
and a.tablespace_name in ('<work repo tablespace name>','<work repo tablespace name>')

ORDER BY A.tablespace_name ASC;

Note: If you don't know your tablespace name then execute following query:

SELECT
  ts.tablespace_name,
  TO_CHAR(SUM(NVL(fs.bytes,0))/1024/1024, '99,999,990.99') AS MB_FREE
FROM
  dba_free_space fs,
  dba_tablespaces ts,
  dba_users us
WHERE
  fs.tablespace_name(+)   = ts.tablespace_name
AND ts.tablespace_name(+) = us.default_tablespace
and us.username in ('<work repo name>','<master repo name>')
GROUP BY
  ts.tablespace_name;

Solution:
Increase tablespace will resolve the issue.