Wednesday, October 26, 2011

Viewing Old Map Version at Informatica....

If you are relying on Infomatica's versioning functionality - dependance is poor death. Had a very bad experience .. please read below...


Not sure, what was the day, most of the ppl were not in office. Got a new QC and RK assigned that to me. To start with exported the workflow and before importing to ravi's folder, just confirmed with him if someone else is using or not. After his Yes, imported workflow, and started working on new qc.


Process is, we have write access to user and poroject fodler but not for qa and prod. We need to export workflows from qa and import those to user folder. Have to complete development and testing at User folder and after UAT sign-off, we migrate code to project folder. From Project -->> QA -->> Prod pada will take care the migration process. PADA is a tool for migration.


Till 5, completed the 10% of work, went for the tea, came up by 5:30; that time got a ping from Sergey that when he tries to do testing for scenario, mapping is getting failed. Thought, my qc is not so urgent, so will help sergey to resolve the issue.


Went to feed, and checked from which folder his is running the mapping and felt like standing alone in desert, no water, and close to dye. :-(


Yes, I had imported my new code, where Mansi had did his development. I had replaced my all overlapping targets, sources, maps, tranformations in ravi's folder where mansi's code was there for UAT. All got messed now, and map got invalidated and because of which Sergey could not test the things.


Informed him that we have some issues at informatica level and trying to resolve those. As this situation was quite new to me, I asked help to dada (abhishek sengupta).


Below are the things we tried...


1. Checked for the versions, that what all objects got affected. But it was very hard to find it out, as numberof maps and source/targets were involved.
2. So, decided to go one by one with maps, which are affected. Took first map, checked the version..from the comment which I gave while importing, I could easy find out the affect maps.
3. To get the old version, I right click on respective version and click on Open In Workspace, and that particular map version got opened.
4. For first time, I felt my ass got saved, and I can re-commit this version, but when I checked the targets, it was still showing as latest version, it was not same as the map version.
5. I checked if really old target version is present at informatica, and went to targets and checked the versioning, yes that version was present,
6. I checked the dependancies for old target, it showed me map of that version.
7. I opened that map in workspace again, but no luck, again target was of latest version :-(..


This is a dam bug in informatica, that it shows everything of old version except the targets and because of which though you could see rest old part, its of no use.


Below is a replica of such scenario...
1. I am reducing the target table ports in my project folder map; keep in mind - only when your ports gets reduced, it will really affect the map as original ports will get dis-connected. When you add new ports, it will not affect the map.
2. Refresh the affected map, where this target got used.
3. Export the map and import it at QA folder. Replace all objects, so now QA will have also one target for which one port got deleted.
4. Check in all objects which you have newly imported to QA folder.
5. Now, right click on map and click on versioning --> View History
When you click on view history, new window will appar which will display you the total number versions exists till now.
6. Just again right click on object (here its map) of version you want, and click on Open In Workspace.














Here, all things work fine - means you will be able to view all objects in a map which belogs to that old verison, except target definition. This is a bug of informatica, that it wont show Target of that particular version but the target is always of latest version.

So, suppose you in-intentionally or un-knowingly copied your map or done some changes in map of a particular folder, and if the older version of that map got updated. Then you can view/get your old map iff the target defination is not changed.

If you have done some changes at target definition like added more columns, connected more ports to target level etc.. then there is no way to get your old version back, and you need to do your development again for earlier version.

Migration :-(

Ya, Migration was never so tedius, boaring and bugging job for me. It all depends on work you are doing. On the eve of Dipavali, I was all set to run for mumbai and never thought that simple migration will eat my time like anything.


It was a GT migration, as Nilesh was on leave it came on my head. Totally there were 7 workflows needs to be migrated. First time I saw that all workflows under particular folder are getting migrated. Though changes are in only 3 mappings not sure why do they migrate whole code :-(


Each workflow out of 7 has again 12 sessions each. Every sessions was of particular map, so 12 mapping for each session. Out of 12 mappings, 2 mappings were so big, that if you try to open those at Mapping Developer, it was getting hang. Those maps were having 15-16 pipelines each and number of tranformations. yes, that migration was really big.


Around 5 pm, started the migration, and had a plan pack the bags by 6 completing the migration and applying the label.
First Took export of all 7 workflows each and checked for verbose mode. Ya, that thing cs ppl do not like :-(. After getting clear on that, started importing one by one. As changes were not made by me, was very conscious while verifying each and every tranformations, especially targets and source. [THere is a separate nightmare of versioning, will describe it some other time]. For first successful import it took me 20 mins :). After that completed the second workflow which took another 20 mins. Clock's pointer were almost reaching 6, and this time Bikram asked me to call Nilesh again. As was already frustrated, without any hesitation I dialed Nilesh again. and asked him how much time the whole migration usually takes?
He first asked me, how you are doing the migration, one - by - one workflow? and obviouly the answer was Yes.
He started laughing, and said, first take the export by all 7 workflows simultaneously and import only one xml as mostly all trnaformations - source, targets, lookups, filters, expressiosn etc - are common.


* first lesson learned - if you are migrating such large number of workflows, took export of all at same time. As below


At Repository Manager
1. Select all workflows which needs to be migrated and go to repository menu and inside that click on export.


2. Save the wolething as a single xml, give anyname you want. e.g. 7_workFlow_Migration_26Oct.xml


3. Import that xml again, into project or qa folder. 
As you click on import, another window will get popup. Depending upon your requirement, select objects which you want to migrate. In my case, I had selected all objects. and click on next.


Another widow will get appear which will ask you to select the folder - source to destination. Tool is such claver, that it will pick source folder information from xml which you have exported from - hats of to the informaitca coders. For first time, destination folder will be same as source folder name - tool is still not able to read what's in your mind, wait for some more years.


After choosing correct source and destination folders, go ahead by click next. A new Window will ask you whether you want to checkin your new objects in new folder? Now here, Its a belief - its a belief as I never tried it - that if we checkin hear, comments which we give will not appear for checked in objects. So, as per advice by our seniors, please skip this step and do not click on check in.


To resolve the conflicts between objects, new window will appear which will ask you to create any rule if you want. I never came across any such need, so just skip this step and click next.
When you go to next window, here its an important task for decision. You need to resolve the conflicts here either you have to reuse, replace or rename the objects in new folder where you are copying into. In my case, as new folder was totally empty, its showing conflicts only for session properties. 
This is the last step which you will be follwing. and after it you just have to click on import button and all mappings, sessions, wokflow and tranformations inside it will get copied.
The story do not end here actually, after importing all objects, last task was to check-in all the objects with proper comment, so that we can identify what all objects we have imported.


If you observe, here ASA_QA folder is empty, even though we have imported the 3 workflows. Why? because those are not yet checked in. Now, once we check in those all objects, hopfully tool will work fine and will show the objects at QA folder.
give proper comment for objects you are checking in.
Once you checked in those, as per your expectations, tool do not work :). You need to re-connect to the repository and again need to open the QA folder. And now, you can view the things which you are expecting.

But, still my story do not end here, if you have observed, while importing, my all objects were in checked out status, but after importing and checkin in at QA, not a single object was impacted or invalid. Yes that thing you need to verify after you done with the import.

At the time of my migraion, means once I had imported all 7 workflows, one mapping was showing me as impacted. Initially I thought, because of my migration, map got impacted, so I went to map designer, checked it out, did the validation and again checked. I varified the comment just to verify if its been migrated from my user folder, and found the comment was missing. I checked for dependancing now and I could see number of dependant tranformations. "How will you check the dependancy --> just right click on map [or any object for that matter] and click on ' view dependancies..'.

Now I lost my temper, and cursying myself like anything, what went wrong I was not sure. I checked all objects [totally 130+] one by one, noted those which do not have comment which I gave while importing. Searched those missing comments objects at old user folder and found, those objects were not present. Eureka !! Got a clque, might be those sessions and mappings are not connected with those 7 workflows wich I had migrated. So, this time while checking the dependancing, I just click on workflow
Fortune favors the brave, and there were no results :). I had did my job correctly. Only thing I missed is, before importing the objects, I forgot to check if any object is checked-out, impacted or invalid in project or QA folder. Be sure you will verify that...
Now only thing, which was remaining was applying the label.

LABEL -- though not important for developers, but very crucial for ppl who are doing actual migration. Because from Stg --> QA --> Prod migration happens without humam intervation, automatically by tools like pvcs, or pada depending on company.
Go to versioning menu --> inside that Labels ..
After clicking on Label, new window will appear which will ask you to give lavel name which you want to create.
Just give appropriate label name and click on OK. imp: though at image label name is starting with number, it wont allow first character as number and it has to be alphabet. Now, you want to apply label to all workflows which you have migrated.  Thought in a folder, there are only 7 workflows, you are not supposed to add label on whole folder level, reason is, there can be number of objects which are not dependant on 7 workflows, and those will get migrated un-necessarily.
How will you apply label :- Select folder name which contains your workflows, go to Versioning -->Apply Label
Once you click on apply label, new window will appear as below
Click on Next, and window will appear where you want to select the objects for which you want to apply the label.
Here, do not select whole folder, but all required workflows.
Click on Add, and again Next. New windlow will appear where you will actually select the label which you are going to apply.
After selecting the required label, click on OK, give the meaningful comment, and do not forgot to check "Label All Chindren" and "Label All Parents". Click on finish and you are done with your job.
Just to verify, for how many objects label has been applied, you can create a query at informatica level.
Query :-- Go to tool at menubar and inside that click on queries..A new window will appear which will ask you to create new query as below
Give query name you want, select parameter - here I have selected as label, give the respective criteria.


 And shoot on blue arrow. You will get to see all objects which which this label got applied.


 Just verify how many objects you were actually migrated, and for how many objects the label got assigned. Note - label will get assigned only for latest checked in version of an object.

Before I end up - below are the things to always check at the time of migration
1. First verify at ur project/qa or developer folder any object is impacted, checkedout or invalid. If its so, first resolve that and then start for migration.
2. In case of large migration, do not do it one by one, rather take export of all worklows in single go and import all things in single go.
3. Do not checkin object while you are importing it, as comment will not appear in such cases if you do so.
4. After you imported all workflows/objects, please checkin those objects first.
5. Just re-verify if any of the object is impacted, checked out or invalid at project or qa folder.
6. Again write a query on the basis of comment, and count actual number of objects you were migrated and actualy numbr of objects for which comment has been assigned.
7. Once you confirm all above things, apply label only to those objects which you have actually migrated, be careful at this step.
8. Again write a query on basis of applied label and count number of objects again.

Hope this will help you..good luck

Saturday, October 15, 2011

Query at ReportExtract

While working on report extract, came across a situation which I thought can not be handled using simple sql query and needs to write pl-sql block; but Sandesh Birwatkar gave a simple solution.

Solution is quite simple, but I never thought of that..

As an example, below is the scenario

You have an employee table, and user will give department number and from which you need to fetch out the respective employees.

select *
from employees
where department_id in (
select distinct department_id
from departments
where department_id = '&DepID'
)

But, twist is, if department table do not have any records, query should return all employee records.

How will you do it? below is the solution

create table departmentsBKP
as
select * from departments

select *
from employees
where department_id in (
select distinct department_id
from departmentsBKP
where department_id = '&DepID'
)
union
select *
from employees
where 0 = (select count(*) from departmentsBKP)

delete from departmentsBKP

and now again if u fire select statement, you will get all records of employees table.

Monday, October 10, 2011

jQuery Test






Hola


This will be hidden slowly.
This will be hidden quickly.
This will not be hidden.




All about CSS

From book HTML & CSS - Design and Build Websites - Jon Duckett CSS works by associating rules with HTML elements. These rules govern how...