Create Indices

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Create Indices

Post by kumar_s »

Hi DSXians,
May I know how to create indices for all the project hash files. (DS_JOBS, DS_JOBOBJECTS, DS_CONTAINERS,DS_ROUTINES, DS_METADATA....)

When I do a REINDEX it gives me

Code: Select all

File "DS_JOBS" has no indices defined!
like wise for all the files.

I need help to identify the index columns and CREATE.INDEX for those files.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Kumar,

the list of indices isn't that long or difficult; but I've never seen anyone deleting them and if you don't know how it happened then most likely there is even more wrong with the project than originally surmised. You can create a new project and do a LIST.INDEX on these files to found out which columns are index, you can then use appropriate CREATE.INDEX and BUILD.INDEX commands to get the broken ones re-indexed.

How did this happen?
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Not sure why this happen.

May i know the syntax to build the index. When I tried the follwoing it gives me as shown.

Code: Select all

>LIST.INDEX DS_JOBS ALL
File "DS_JOBS" has no indices.

>CREATE.INDEX DS_JOBS JOBID
Index field JOBID is a duplicate of JOBID, no new index created.

>BUILD.INDEX DS_JOBS JOBID
File "DS_JOBS" has no indices defined!
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Someone probably did rebuld indexes in DS.TOOLS. If a user is connected then it will delete the indexes but not build them. It needs exclusive access to all repository tables like DS_JOBS in order to build the indexes. Try DS.TOOLS again with all th users out of Designer, Director and Manager.
Mamu Kim
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

kduke wrote:Someone probably did rebuld indexes in DS.TOOLS. If a user is connected then it will delete the indexes but not build them. It needs exclusive access to all repository tables like DS_JOBS in order to build the indexes. Try DS.TOOLS again with all th users out of Designer, Director and Manager.

This is a new project, copied from existing project and inserted an entry into UV.ACCOUNT. But even the existing project could not be reindexed.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Kumar,

the INDEX information in hashed files is stored in the files themselves and are absolute paths - so by copying your hashed files from somewhere else you have broken the indices to all these files in both projects. It is for reasons and side effects like this that nodoby recommends doing anything to projects at a low-level such as from TCL unless you know exactly what you are doing.

I don't know what else is wrong - most likely you still have issues with your UV_SCHEMA table as well. I don't recommend reindexing your projects right now since I don't know what else might be wrong. I think your best path is to DELETE.INDEX {file} ALL for the DS_CONTAINERS, DS_JOBS, DS_JOBOBJECTS, DS_ROUTINES, DS_DATATYPES, DS_METATDATA, DS_STAGETYPES and DS_TRANSFORMS files. Then export the complete project using the manager and re-load them into newly created projects. Make sure your objects are all there and delete the original projects (making backups along the way, just in case).

Please don't do a UNIX level project copy in the future.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Actually the soruce projct from which I copied, already has this problem. When I try with other project which has good index, it works fine.
Even when I try to Delete the index, it give me 'File "DS_JOBS" has no indices.'
I am doing export/import since morning. (Sick and tired of it) :evil:
Just curious to know, whether the command I issue to build the index, is any wrong in it?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

To summarize, you tried to "copy" a project. You messed with internal engine files, now things are all messed up.

Don't do this kind of stuff!!! :evil:

I'm loathe to participate in helping out because this is not something you should do. To fix your problem, drop all bad projects, recreate them, and reimport your jobs.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If an index exists on a file then DS will try to use it; if the index is corrupt the results from a SELECT will be wrong - so an export might not work and this is why the DS.REINDEX exists. If you actually delete the indexes then the DS engine will do a full table scan - it will be much slower but at least it will be correct. After dropping your indices do an export, new import into a new project which you have created via the ADMINistrator and then delete the bad project.

I agree with Ken - right now we know parts of the projects are broken, and both of us doubt that this is the only problem so the only thing to do is start anew. I know that I would do the same by exporting/re-creating/deleting in any case.
Post Reply