Tuesday, July 1, 2014

Converting the SQL Developer created CTL and LDR files

After loading the files using the command line SQLLDR I found that a new entry for the Transaction_Config had to be included.

The transaction_ID (5237 is what I used) had to be valid and unused on the destination Data Manager.

Also a valid DataSource_ID for VMWARE data type had to be in the system.
--Added the VMWARE DA, and created a fake Datasource without testing it...just saved it.
This gave me the new DataSource_ID (21 is what this created) I needed.

The staging tables imported will have the WRONG transaction ID and DataSourceID.

These must be corrected with code like this:

(Where clause was set to the wrong Transaction_ID=174.  I ran this twice. So the second time I had to use transaction ID = 5237 in my where clause...because it had already been fixed, but the Datasource_ID was still wrong.)

update server_Virtual_staging 
set Transaction_id=5237,DATASOURCE_ID=21
where transaction_id = 5237;  
commit;

update server_staging 
set Transaction_id=5237,DATASOURCE_ID=21
where transaction_id = 5237;
commit;

update Server_Metrics_staging
set Transaction_id=5237,DATASOURCE_ID=21
where transaction_id = 5237;
commit;

update resource_pool_staging
set Transaction_id=5237,DATASOURCE_ID=21
where transaction_id = 5237;
commit;

update RESOURCE_POOL_METRICS_STAGING
set Transaction_id=5237,DATASOURCE_ID=21
where transaction_id = 5237;
commit;

update GROUP_CONFIG_STAGING
set Transaction_id=5237,DATASOURCE_ID=21
where transaction_id = 5237;
commit;

update ENTITY_METRICS_STAGING
set Transaction_id=5237,DATASOURCE_ID=21
where transaction_id = 5237;
commit;

update CLUSTER_STAGING
set Transaction_id=5237,DATASOURCE_ID=21
where transaction_id = 5237;
commit;

update CLUSTER_METRICS_STAGING
set Transaction_id=5237,
DATASOURCE_ID=21
where transaction_id = 5237;
commit;

No comments:

Post a Comment