Tips for finding Knowledge Articles

  • - Enter just a few key words related to your question or problem
  • - Add Key words to refine your search as necessary
  • - Do not use punctuation
  • - Search is not case sensitive
  • - Avoid non-descriptive filler words like "how", "the", "what", etc.
  • - If you do not find what you are looking for the first time,reduce the number of key words you enter and try searching again.
  • - Minimum supported Internet Explorer version is IE9
Home  >
article

KB-4168: How to make a previously active Audit Store database active again?

Centrify DirectAudit ,  

12 April,16 at 11:11 AM

Applies to: Centrify Direct Audit for all versions
 
Question:

How to make a previously active Audit Store database active again?

Use case:

Have two (or more) Audit Store databases in the Audit Store viz. "Database A" and "Database B". "Database A" (referred to as "old Audit Store database" in this document) was active Audit Store database for some time after which "Database B" was created and set as active database. Now, want to make "Database A" active again.


Answer:

Design limitation -

DA does not allow recycling the previously active Audit Store database. If a database has been previously active, it cannot be made active again using the Administrator console. This is because there are two conditions that are checked by DA before it can mark the database as active:

Condition#1 - The database to be marked as active must be empty.
Condition#2 - The database must not be in the history of previously active Audit Store databases.

Workaround:

The workaround is to fix Condition#1 and Condition#2 specified above so that the old database can be marked as active again.

!!!IMPORTANT!!! - Before proceeding with step#1, please make sure that the database recovery mode is set to "Simple" on the old Audit Store database that you want to reactivate.

Step#1 - Clear all the session data from the database that wanted to reactivate. Before this step, take a full backup of the old Audit Store database in case if needed to retrieve the sessions in future. Once the backup is ready, use one of the two approaches to clear the session data from the old Audit Store database.

1. Run the following SQL command on the old database,

DELETE FROM dbo.Session

Please note that deleting any entries from Session table results into a cascade delete operation and it may take a lot of time on a large database. Please see

Step #2 for a faster approach.

2. Run the following SQL commands on the old database,
TRUNCATE TABLE dbo.Argument
TRUNCATE TABLE dbo.Command
TRUNCATE TABLE dbo.RawData
TRUNCATE TABLE dbo.SessionDetail
TRUNCATE TABLE dbo.Snapshot
TRUNCATE TABLE dbo.Status
TRUNCATE TABLE dbo.WashData
TRUNCATE TABLE dbo.WashEvent
DELETE FROM dbo.Session

3. (Optional) Run the following SQL command on the old database and make sure it returns 0 (zero) results,
SELECT COUNT(*) FROM dbo.Session

Step#3 - Clear the history. Use the steps below to remove the old Audit Store database from history of active Audit Store databases.

1. Run the following SQL command on the Audit Server database (CentrifyDA_Audit_Server_Prod) and note down the unique identifier of the old database,
SELECT [Guid] FROM dbo.AuditStoreDatabase WHERE [Database] = '<OLD_DATABASE_NAME>' AND [Server] = '<DATABASE_SERVER_NAME>'
e.g.
SELECT [Guid] FROM dbo.AuditStoreDatabase WHERE [Database] = 'CentrifyDA_AuditStore_Prod_2013_Q1' AND [Server] = 'wsqlrib00001211.corp.internal.citizen'

2. Run the following SQL command on the same Audit Server database to clear the history,
DELETE FROM dbo.AuditStoreActiveDatabaseHistory WHERE [Guid]='<GUID_RETURNED_BY_PREV_COMMAND>'
e.g.
DELETE FROM dbo.AuditStoreActiveDatabaseHistory WHERE [Guid]='C5C5C623-E82D-4CC1-A736-6ED3ECF4BBEC'

Step#4 - Open the DirectAudit 2012 Administrator Console and right click on the old Audit Store database. Click on the "Set as Active" option to make the database active again.

 

Still have questions? Click here to log a technical support case, or collaborate with your peers in Centrify's Online Community.