FAQ - CORACLEANUP UTILITY

Document created by Naveen_Desham Employee on Oct 13, 2014
Version 1Show Document
  • View in full screen mode

CORACLEANUP UTILITY


Coracleanup is an NT command line utility that helps apply the latest changes to CORA to the existing and registered assets in the Database. It does not delete the assets from the product's table but only from CORA and then it re-registers them by sending a request to CORA to register the assets using the info that it got from the product's tables. If there is a duplicate and CORA can't register the asset then an error will be logged and the asset will not be registered. Coracleanup is distributed via Test Fix.

 

Command to check the version of CORA:


Coraver

 

Below is the example output:

 

coraapi     12.5.0.59    May 17 2012    02:38:28

corajava    12.5.0.59 May 17 2012    02:39:46

coramss     12.5.0.59    May 17 2012    02:38:59

coraorcl    12.5.0.59 May 17 2012    02:38:42

corasql     12.5.0.59    May 17 2012    02:38:17

corasys     12.5.0.59    May 17 2012    02:38:04

corauuid    12.5.0.59 May 17 2012    02:37:56


Syntax to run coracleanup:


CORACLEANUP /DATABASE <mdb> /SERVER <servername> /SCOPE all /METHOD reinit /TYPE sqlServer /USERNAME <sqluser> /PASSWORD <sql password> /LOG full

 

For SDM product Installs use _SD.jcl

 

Supported scopes:


  • USD - Apply the method only to SDM
  • NSM - Apply the method only to NSM
  • DSM - Apply the method only to DSM
  • SPM - Apply the method only to SPM
  • ALL - Apply the method too all (USD, NSM, DSM, SPM) products

 

Does it improve performance by using the /scope switch?


With the logging on CORA turned on about 100 assets per minute, without the logging turned on somewhere around 300 assets per minute, depending on the existing data it CORA could process data at even 600 assets per minute. The scope switch just limits the number of assets that will be processed, will not affect the overall time.


Supported methods:

 

Reinit - this will delete all the assets from CORA that belong to the product specified in the scope and re-register based on the information from the product's table all the assets.

 

Delete - this will delete all the assets from CORA that belong to the product specified in the scope. There is no need to take backup of MDB because you might get errors during coracleanup but no information will be lost. We delete only the information that we can restore. If there are any errors they might be errors generated by the product table.


Example Scenario: Because of the changes in CORA, there should be no new asset creation, but because of a bug, it creates a new one now, after fixing that bug, you might get an error telling you that the asset you are trying to register is a duplicate. In this case you will have to manually investigate the product table to confirm if this is an error on CORA side or a duplicate in the product table because the old version of CORA did not detect a duplicate.


Log files for coracleanup:


  • Coraout.log
  • Corautil.log
  • Coracleanup.log


These files should be available in the NX_ROOT\bin folder.


Troubleshooting Checklist:


1)Very often you will be asked from SE to set CORA in debug mode and deliver the coraout.log file after the problem is reproduced.

 

Setting CORA in debug mode is a two steps process:

 

a) CORA Logging is enabled by defining an environment variable called GC_CONFIG. The value of this variable should be the path of logging configuration file CoraLog4cplus.cfg. By default it is NX_ROOT/bin

b)

  1. Take a backup and open NX_ROOT\bin\coralog4cplus.cfg
  2. Change log4cplus.logger.Cora=ERROR, CoraAppender1

  to log4cplus.logger.Cora=DEBUG, CoraAppender1 

  1. Save and close
  2. Recycle mdb_registration_nxd

 

The coraout.log file can also be found in the NX_ROOT/bin directory.

 

2)The most common error message in the coracleanup.log file is from the following:

 

2012-01-19 17:23:13> Cora API returned error: 470200

2012-01-19 17:23:13> RegisterAsset - registration properties: !label!AD.READER.9.3.REL.2!asset_tag!Adobe Reader 9.3 Rel. 2!

2012-01-19 17:23:13> CheckApiReturnCode - CORA Error message:DuplicateErrorReasonA subschema passed in the same properties with different source UUIDsOldUUID04F5802985155D4A9FF1D922415C6507New UUID0A77D7FFFB5A16418CC218F0BB5671D8__FILE__coraapi.cpp__LINE__5084__DATE__Mar 15 2010__TIME__11:35:02

 

The duplicates need to be remediated. The coracleanup has left an easy way to identify machines that where flagged duplicates. The asset_source_id in ca_owned_resource is NULL for these assets. Now there is no order that coracleanup works so just because it has a NULL field doesn't identify it as the machine that doesn t belong. This could be the asset you want to keep active and the duplicate that happen to register first in coracleanup may be the one you want to make inactive.

 

Once we have the name of an asset that is duplicated. Pick the one you want to make the healthy asset. The one you will make inactive should NOT have a federated asset association. Once this is confirmed make it inactive if it isn’t already. Now we have to update the attributes to make it is unique. For exampleyou can take the label and just add _duplicate then copy the result into all other fields. hostname, dnsname, macaddress, serialnumber and alt ci id. This identifies the machine well and also ensures that the asset will be unique.Then once the dupes are remediated we will need to run again coracleanup and make sure we don t see any errors.

 

Some SQL queries:

 

With this query you can identify which assets haven a UUID=Null

 

SELECT * FROM ca_owned_resource WHERE asset_source_uuid IS NULL and asset_type_id=1 (Here asset_type_id = 1 means that the asset is hardware and CORA handles only hardware not software.)

 

The following query can be run in the SQL Query Analyzer by selecting the 'mdb' to check if the information available in CORA is correct:

 

select asset_source_uuid, ca_logical_asset.logical_asset_uuid,

ca_asset.asset_uuid, host_name, serial_number, label, asset_tag, dns_name,

mac_address from ca_asset_source, ca_logical_asset, ca_asset,

ca_logical_asset_property where host_name like '<HOST NAME>'

and ca_asset.asset_uuid = ca_logical_asset.asset_uuid

and ca_logical_asset.logical_asset_uuid = ca_asset_source.logical_asset_uuid

and ca_logical_asset.logical_asset_uuid =

ca_logical_asset_property.logical_asset_uuid

 

The above query lists all the attributes of the Asset as per the WHERE clause

The WHERE Clause can be changed to check on the other properties like

Serial_Number, Asset_Tag, DNS_NAME, MAC_ADDRESS, LABEL as well

 

3)Known SQL Server 2008 Error


If the DMBS is SQL Server 2008, coracleanup will not be able to connect to the database. To bypass this problem and be able to run it, please open support issue to get registry files which needs to be updated.

Attachments

    Outcomes