Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
chrish_dexcom
Contributor II
Contributor II

Identifying primary keys from tables already in Qlik Replicate

I understand Qlik requires tables to have a primary key in order to perform replication.  Is there a way to see a list of those fields that Qlik is using for primary keys for a given replication function?  I tried exporting the task (from the web UI) which connects to the database source but that doesn't seem to have any details about the tables' primary keys.  

Does anyone know how I can pull this information out of Qlik Replicate somehow?

 

Labels (1)
2 Solutions

Accepted Solutions
KellyHobson
Support
Support

Hey @chrish_dexcom ,

Within the UI, if you go to Designer mode- > Table Settings -> Transform tab you can see the keys identified on a table.

KellyHobson_0-1649094895037.png

 

Best,

Kelly

 

 

View solution in original post

SwathiPulagam
Support
Support

Hi @chrish_dexcom ,

 

Using the dynamic_metadata.sqlite you will get the table definitions for all the tables in a particular task.

You will find this in the below location:

C:\Program Files\Attunity\Replicate\data\tasks\<Task Name>\dynamic_metadata.sqlite

Run the below command to get the metadata dump:

 

repctl dumpmetadata "C:\Program Files\Attunity\Replicate\data\tasks\<Task name>\dynamic_metadata.sqlite"

 

SwathiPulagam_0-1649096577408.png

table_defs folder will be created and inside the Target file json you can search with "is_pk": true.

You can write a script to find out which tables have PK.

 

Thanks,

Swathi

View solution in original post

8 Replies
KellyHobson
Support
Support

Hey @chrish_dexcom ,

Within the UI, if you go to Designer mode- > Table Settings -> Transform tab you can see the keys identified on a table.

KellyHobson_0-1649094895037.png

 

Best,

Kelly

 

 

SwathiPulagam
Support
Support

Hi @chrish_dexcom ,

 

Replicate will store all the table metadata in metastore.sqllite file. You can get the table metadata from there.

 

Thanks,

Swathi

chrish_dexcom
Contributor II
Contributor II
Author

Wow, thank you for the lightning fast reply!!  For your first suggestion (Designer Mode/Table Settings), that would be limited to a single table at a time correct?

For the second suggestion, could you let me know where that metastore.sqllite file resides?  Would I need console access to the server in order to retrieve it?  Also is there anything available from the API that might help here?

SwathiPulagam
Support
Support

Hi @chrish_dexcom ,

 

Using the dynamic_metadata.sqlite you will get the table definitions for all the tables in a particular task.

You will find this in the below location:

C:\Program Files\Attunity\Replicate\data\tasks\<Task Name>\dynamic_metadata.sqlite

Run the below command to get the metadata dump:

 

repctl dumpmetadata "C:\Program Files\Attunity\Replicate\data\tasks\<Task name>\dynamic_metadata.sqlite"

 

SwathiPulagam_0-1649096577408.png

table_defs folder will be created and inside the Target file json you can search with "is_pk": true.

You can write a script to find out which tables have PK.

 

Thanks,

Swathi

chrish_dexcom
Contributor II
Contributor II
Author

Thank you!  So when I run that command (repctl dumpmetadata) it will generate that "table_defs" folder which has the files I need within?  Sorry but I've never worked with sqlite data before so this is all rather new to me.

SwathiPulagam
Support
Support

Hi @chrish_dexcom ,

 

Yes, you are correct.

 

Thanks,

Swathi

chrish_dexcom
Contributor II
Contributor II
Author

When we try your suggestion,  a sqlite file is generated but we are still getting an error in the console (see attached).  I suspect that might be preventing the "table_defs" folder from being created?

 

chrish_dexcom_0-1649277541170.png

 

Heinvandenheuvel
Specialist II
Specialist II

>> a sqlite file is generated but we are still getting an error in the console

The Replicate data location is probably NOT in the default location and needs to be provided on the repctl command line.

First try something like 'repctl version' or 'repctl help' then go for the desirable command.

Try this

fail!! repctl help

success?? repctl -d d:\attunity\data help

Hein