Showing posts with label ODI12C. Show all posts
Showing posts with label ODI12C. Show all posts

Friday, September 9, 2016

ODI 12c Loop PLSQL Procedure



Here's the procedure I commonly use to implement a odi loop in package.!

create or replace function sys.set_initial_data (P_TOKEN varchar2, P_VALUE varchar2, P_ROW_ID number, p_session number) return varchar2
is
PRAGMA AUTONOMOUS_TRANSACTION;

res varchar2(50);

cursor get_datap is
select *  from process_data_odi
where 1=1--status = (select case P_VALUE when 'ROW' THEN  'R' else 'P' end from  dual)
and status = 'P';
--and id_host = nvl(null,id_host);

vget_datap get_datap%rowtype;

cursor get_datap_id is
select *  from process_data_odi
where 1=1--status = (select case P_VALUE when 'ROW' THEN  'R' else 'P' end from  dual)
and id_host = nvl(P_ROW_ID,id_host);
--and status = 'P'

vget_datap_id  get_datap_id%rowtype;


begin

if p_token = 'INIT' then
delete from process_data_odi;
insert into process_data_odi
select p_session, id, 'P', null,IP, puerto from table_info_host;

commit;

return 'OK';
 
elsif p_token = 'GET' then


    open get_datap_id;
    fetch get_datap_id  into vget_datap_id;
    close get_datap_id;


  IF P_VALUE = 'PORT' then
    res := vget_datap_id.PUERTO;
  elsif P_VALUE = 'HOST' then
    res := vget_datap_id.HOST;
  elsif P_VALUE = 'ROW' then


open get_datap;
fetch get_datap into vget_datap;
close get_datap;


    res := vget_datap.ID_host;
 
  update process_data_odi set status = 'R'
  where id_host = vget_datap.ID_host;

  commit;  

  end if;

elsif p_token = 'SET' then

  update process_data_odi set status = 'T'
  where id_host = P_ROW_ID;

  commit;

return 'OK';

end if;

return nvl(RES,'ERR');
end;


SELECT *  FROM process_data_odi;

select set_initial_data('GET','PORT',2,1111) from dual;

select set_initial_data('GET','HOST',2,1111) from dual;

select set_initial_data('GET','ROW',null,1111) from dual;

select set_initial_data('SET',null,1,1111) from dual;

select set_initial_data('INIT',NULL,null,1111) from dual;

commit;

Thursday, August 4, 2016

Configure CDC ODI 12C with Reusable Mappings


1.- Identify the source and target locations
2.- Create your source model, and target model
3- In my case I created the CDC_Test model connected to a Database 11g XE Edition and my target is a Database 12c EE


Goldengate is a oracle product to syncronize legacy systems or databases using the log files, but is quite expensive, in this case we are going to see, how to do a sync between two systems using just ODI 12C,

Using CDC Simple  Mode:

1.- Create a Project and import JKM Oracle Simple



2.- Change de Model of CDC_Test to Simple



3.- Do the Reverse-Engineering for the tables to add to CDC, in this case the table I chose was SRC_CITY.

4.- Once you have the datastore in your data model, Now configure the CDC, right clic over the datastore SRC_CITY and Add to CDC.




5.- Add a subscriber, right clic over datastore and navigate to subscriber, Add subscriber


6.- Add the subscriber SUNOPSIS




7.- Start Journal, select the subscriber, then session is prompted to start, clic ok.
Note:
The steps to undo this are (Unsubscribe, Drop  Journal, Remove from  CDC)

8.- So far, we have configured the basic CDC Simple, let's remember this is intrusive, because it creates triggers over the source tables and may affect the performance, so check carefully.

9- Test




10.- Now let's do this automatically using a package, mapping (ODI Interface in ODI 11G) and reusable mapping

11.- Create a Reusable Mapping, just drag the source table (The one you just added to CDC, see above), and also drag an output signature and do the mapping.

12.- Create a mapping in ODI and drag the reusable mapping created in the last step.

13.- Drag the target table and do the mapping.
14.- Choose the Optimization context to Development
15.- Configure the Journalize Data (select CheckBox)
16.- In the Logical Section change the target to  Incremental Update
17.- In the Physical, select the target TRG_CITY, and in the section Integrated Knowledge Module change to IKM Oracle Incremental Update

Look like this:


18.- Create a package to automatize this.
19.- Drag a OdiWaitForLogData component

OdiWaitForLogData "-CONTEXT=DEVELOPMENT" "-GLOBAL_ROWCOUNT=1" "-LSCHEMA=GG_SOURCE" "-OPTIMIZED_WAIT=AUTO" "-POLLINT=1000" "-SUBSCRIBER_NAME=SUNOPSIS" "-TIMEOUT=0" "-TIMEOUT_WITH_ROWS_OK=YES" "-TABLE_NAME=SRC_CITY"

20.- Drag the interface into the package and make a connection to the OdiWaitForLogData and viceversa

21.- Test the package.

SELECT * FROM SALES_DATA.SRC_city;
SELECT count(*) FROM SALES_DATA.SRC_city;
SELECT * FROM SALES_DATA.SRC_city;
delete from SALES_DATA.SRC_city where city_id = 100;
commit;
insert into SALES_DATA.SRC_city values (100,'Acapulco',20,123456);
commit;

Monday, November 23, 2015

Change JAVA default location of Linux




When you install a product for example 12 C versions Oracle when you are running the installer this ask you for a specific JAVA version and there is no other way to set that if you don't install it, even when set JAVA_HOME, JRE_HOME, JDK_HOME, (Or I haven't find it yet)
So, download the JAVA version you want and move it to:

/usr/lib/jvm/jdk1.7.0_79 (for example)

To set your JAVA version and associate it to java command, then configure the JAVA command, with root privileges run:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_79/bin/java" 1
sudo update-alternatives --config java

Optionally you can set:

export JAVA_HOME=/usr/java/jdk1.7.0_79
export JRE_HOME=/usr/java/jdk1.7.0_79/jre
export JDK_HOME=/usr/java/jdk1.7.0_79

In your bash_profile.

Restart bash or reboot.

Note:

When you install java with rpm  option, this is installed in /user/java/(java_version)

Annexed:

Remove-->

sudo update-alternatives --remove "java" "/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java"  

Sunday, June 7, 2015

Installing ODI 12c and Enterprise Agent


Pre-Requisites of Installation

  1. The environment is set with the next physical characteristics:
    1. Windows 7 Professional 64 bits 
    2. Intel (R) Core (TM) i5-4200U CPU @ 1.60GHz 2.30 GHz
    3. 6 GB in RAM
  2. Download the next software:
    1. jdk-7u75-windows-i586.exe
    2. fmw_12.1.3.0.0_infrastructure.jar
    3. fmw_12.1.3.0.0_odi.jar
  3. Installing of JDK 7
    1. Choose the installation path 
    2. Finish the process of installation
    3. Add the environment variables
    4. Check the value of the variables

Installation of the Infrastructure 12.1.3.0.0

1. Execute the file.jar whit command java –jar fmw_12.1.3.0.0_infrastructure.jar 
2. Wait to that the process continue and click on Next
3. Choose the installation directory and click on Next

4. Choose the option “Infraestructura de Fusion Middleware” and click on Next

5. Wait to that finish  the process of validation of requisites of system and click Next
6. Click on “Install” for installation confirm
7. Click on Next for continue with the process
8. Click on “Terminar” for finish the installation process

Installation of ODI 12.1.3.0.0

1. Execute the file.jar whit command java –jar fmw_12.1.3.0.0_odi.jar 
2. Wait for the process to finish loading files and click on Next 
3. Choose the directory of the infrastructure previously installed and click on Next

4. Choose the installation the Enterprise type and click on Next 
 
5. Wait to that finish  the process of validation of requisites of system and click Next
6. Click on "Instalar" for confirm the installation

7. Click on Next for continue 
8. Click on "Terminar" for finish the installation process


Installation of RCU for odi 12.1.3.0.0  


1. Access to the infrastructure path  C:\Oracle\fmw12c\oracle_common\bin and execute the file rcu.bat
2. Wait for the process to finish loading files and click on Next 
3. Choose the option "Crear Repositorio" 
4. Write the correct data of connection to the DB 

5.  Click Aceptar on the emergent window 
6.  Choose the option "Crear Nuevo Prefijo"

7.  Click Aceptar on the emergent window
8.  Write a password for the schemas
9.  Write the data next: 
     Contraseña para el usuario SUPERVISOR: *** 
     Tipo del Repositorio de Trabajo: D 
     Nombre del Repositorio de Trabajo: WORKREP 
     Contraseña para el Repositorio de Trabajo: *** 
     Algoritmo de cifrado: AES-128
 
10. Click on Next for continue
11. Click Aceptar on the emergent window
12. Click on Crear for confirm the creation of the schemas 
13. Click on Cerrar for finish the process 

Creation of the Domain

1.  Access the directory  C:\Oracle\fmw12c\oracle_common\common\bin and execute the script config.cm 
2.  Choose the option "Crear Nuevo Dominio". Write Name and path the domain and click Next

3.  Choose the products to install and click on Next

4.  Write the credentials for the Administrator user 
5.  Choose Production Mode and check the JDK 

6.  Write the correct information of the schemas and click Next 

7.  Click on Next for continue with the process 
8.  Check that the tests are successfull

9.  Write the credentials for SUPERVISOR user

10. Choose the next options and Click on Next 

11. Leave the defaults and Click on Next 
12. Write the values for NodeManager and Click on Next 
13. Write the values for Managed servers and Click on Next
  
14. Click on Next 
15. Leave the defaults and Click on Next 
16. Write the Machine Name for the Domain 

17. Set the servers to the machine 

18. Leave the defaults and Click on Next

19. Write the values for OracleDIAgent1 and Click on Next 

20. Set OracleDIAgent1 to the machine and Click on Next 
21. Click on "Crear" for continue 
22. Click on Next for continue 
23. Click on "Terminar" for finish the process

Configuration to the Enterprise Agent


1.  Start Adminserver and odi_server1
2.  Navigate to Deployments in the weblogic console and search oraclediagent. Note that the state is Failed

3.  Navigate to Deployments > odiconsole >Test. Click on the first link

4.  Login in the odiconsole with the correct credentials

5.  Navigate to Exploration > Topology > Agents
6.  Right-click on physical agents and choose Create

7.  Write the values for new agent 

8.  Now create the Logic Agent. Right-click Logical Agents > Create 

9.  Right-Click on the new agent logical and click Edit
10.Check the mapping with physical agent
  
11. Navigate a Deployments in the weblogic console 
12. Start oraclediagent 
13. Check that the new state is Active