How to manually install and uninstall ApexSQL Log 2014 server side-components

Applies to
ApexSQL Log 2014

Summary
This article explains how to manually install and uninstall the server side components when it is not possible to utilize ApexSQL Log installer or when server side components need to be (un)installed on the passive cluster node.

Installing ApexSQL Log 2014 server-side components
When ApexSQL Log is installed in a cluster environment, the server side components cannot be installed on the passive nodes. To perform the installation of server side components in an environment that prevents installation from the ApexSQL installation wizard, the following steps need to be done:

  1. If old server side components already exist on the target node, uninstall them and delete the remaining files from the ApexSQL Log ‘Binn’ folder from this location:
    C:\ProgramData\ApexSQL\ApexSQLLog\<Instance_Name>\Binn\
  2. Install ApexSQL Log to any other available system that doesn’t require manual installation – default installation does the trick
  3. From the ApexSQL Log installation folder (default location is C:\Program Files\ApexQL\ApexSQL Log 2014), copy ApexSQLLogXprocsx64.dll or ApexSQLLogXprocsx86.dll file, depending of the system architecture (x64 or x86), to the target SQL server ‘Binn’ folder (default ‘Binn’ folder location is C:\Program Files\MicrosoftSQL\<Instance_Name>\MSSQL\Binn)
  4. Rename the copied file to ApexSQLLogXprocs.dll

  5. Run the following install script on the target SQL server:

    IF NOT EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog'
    		)
    	EXEC master.dbo.sp_addextendedproc 'xp_ApexSqlLog'
    		,'ApexSqlLogXprocs.DLL'
    
  6. Copy following files from the ApexSQL Log installation folder to the target SQL server machine folder:

    C:\ProgramData\ApexSQL\ApexSQLLog\<Instance_Name>\Binn\

    Note: In case you are installing to default server instance (MSSQL), the ‘(local)’ must be used in place of the ‘<instance name> ‘ (e.g. C:\ProgramData\ApexSQL\ApexSQLLog\(local)\Binn\)

    The files list:

    ApexSQL.Activation.dll
    ApexSQL.Base.dll
    ApexSQL.Common.ArrayOfflineMetadata.dll
    ApexSQL.Common.DdlAuditing.dll
    ApexSQL.Common.Decry.dll
    ApexSQL.Common.Dependency.dll
    ApexSQL.Common.GrammarParser.dll
    ApexSQL.Common.Logging.dll
    ApexSQL.Common.OfflineMetadata.dll
    ApexSQL.Common.Scripting.dll
    ApexSQL.Diff.dll
    ApexSQL.Engine.dll
    ApexSQL.Log.Auditing.dll
    ApexSQL.Log.CommunicationProtocol.dll
    ApexSQLLogCorex64.dll or ApexSQLLogCorex86.dll (depending on the architecture)
    ApexSQLLogServerAuditor.exe
    ApexSQLLogServerHelperx64.exe or ApexSQLLogServerHelperx86.exe (depending on the architecture)
    ApexSQLServerActivation.exe
    atl90.dll
    Microsoft.VC90.ATL.manifest
    Microsoft.VC90.CRT.manifest
    msvcm90.dll
    msvcp90.dll
    msvcr90.dll

  7. The following files that have just been copied need to be renamed (depending on the system architecture):
    • ApexSQLLogCorex64.dll or ApexSQLLogCorex86.dll should be renamed to ApexSQLLogCore.dll
    • ApexSQLLogServerHelperx64.exe or ApexSQLLogServerHelperx86.exe should be renamed to ApexSQLLogServerHelper.exe

This enables ApexSQL Log 2014 to audit the target SQL server and concludes the manual installation process.

Uninstalling ApexSQL Log 2014 server-side components

  1. Connect to SQL server with administrator account
  2. Execute the following SQL script:

    -- Stop connection monitor
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlConnectionMonitor_Stop'
    		)
    	EXEC master.dbo.xp_ApexSqlConnectionMonitor_Stop
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlConnectionMonitor2008_Stop'
    		)
    	EXEC master.dbo.xp_ApexSqlConnectionMonitor2008_Stop
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2008ConnectionMonitor_Stop'
    		)
    	EXEC master.dbo.xp_ApexSqlLog2008ConnectionMonitor_Stop
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2010ConnectionMonitor_Stop'
    		)
    	EXEC master.dbo.xp_ApexSqlLog2010ConnectionMonitor_Stop
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLogConnectionMonitor_Stop'
    		)
    	EXEC master.dbo.xp_ApexSqlLogConnectionMonitor_Stop
    
    -- Drop connection monitor xprocs
    -- 2005
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlConnectionMonitor'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlConnectionMonitor_Disable'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor_Disable'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlConnectionMonitor_Enable'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor_Enable'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlConnectionMonitor_Info'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor_Info'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlConnectionMonitor_Stop'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor_Stop'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'sp_ApexSqlConnectionMonitor_Start'
    		)
    	EXEC master.dbo.sp_procoption 'sp_ApexSqlConnectionMonitor_Start'
    		,'startup'
    		,'false'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'sp_ApexSqlConnectionMonitor_Start'
    		)
    	EXEC master.dbo.sp_executesql N'DROP PROCEDURE sp_ApexSqlConnectionMonitor_Start'
    
    -- 2008
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlConnectionMonitor2008'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor2008'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlConnectionMonitor2008_Stop'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor2008_Stop'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlConnectionMonitor2008_Info'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor2008_Info'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlConnectionMonitor2008_Enable'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor2008_Enable'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlConnectionMonitor2008_Disable'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor2008_Disable'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'sp_ApexSqlConnectionMonitor2008_Start'
    		)
    	EXEC master.dbo.sp_procoption 'sp_ApexSqlConnectionMonitor2008_Start'
    		,'startup'
    		,'false'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'sp_ApexSqlConnectionMonitor2008_Start'
    		)
    	EXEC master.dbo.sp_executesql N'DROP PROCEDURE sp_ApexSqlConnectionMonitor2008_Start'
    
    -- 2008.05
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2008ConnectionMonitor'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog2008ConnectionMonitor'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2008ConnectionMonitor_Stop'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog2008ConnectionMonitor_Stop'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2008ConnectionMonitor_Info'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog2008ConnectionMonitor_Info'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2008ConnectionMonitor_Enable'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog2008ConnectionMonitor_Enable'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2008ConnectionMonitor_Disable'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog2008ConnectionMonitor_Disable'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2008ConnectionMonitor_State'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog2008ConnectionMonitor_State'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'sp_ApexSqlLog2008ConnectionMonitor_Start'
    		)
    	EXEC master.dbo.sp_procoption 'sp_ApexSqlLog2008ConnectionMonitor_Start'
    		,'startup'
    		,'false'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'sp_ApexSqlLog2008ConnectionMonitor_Start'
    		)
    	EXEC master.dbo.sp_executesql N'DROP PROCEDURE sp_ApexSqlLog2008ConnectionMonitor_Start'
    
    -- 2010
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2010ConnectionMonitor'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog2010ConnectionMonitor'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2010ConnectionMonitor_Stop'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog2010ConnectionMonitor_Stop'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2010ConnectionMonitor_Info'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog2010ConnectionMonitor_Info'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2010ConnectionMonitor_Enable'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog2010ConnectionMonitor_Enable'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2010ConnectionMonitor_Disable'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog2010ConnectionMonitor_Disable'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2010ConnectionMonitor_State'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog2010ConnectionMonitor_State'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'sp_ApexSqlLog2010ConnectionMonitor_Start'
    		)
    	EXEC master.dbo.sp_procoption 'sp_ApexSqlLog2010ConnectionMonitor_Start'
    		,'startup'
    		,'false'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'sp_ApexSqlLog2010ConnectionMonitor_Start'
    		)
    	EXEC master.dbo.sp_executesql N'DROP PROCEDURE sp_ApexSqlLog2010ConnectionMonitor_Start'
    
    -- 2011
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLogConnectionMonitor'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogConnectionMonitor'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLogConnectionMonitor_Stop'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogConnectionMonitor_Stop'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLogConnectionMonitor_Info'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogConnectionMonitor_Info'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLogConnectionMonitor_Enable'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogConnectionMonitor_Enable'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLogConnectionMonitor_Disable'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogConnectionMonitor_Disable'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLogConnectionMonitor_State'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogConnectionMonitor_State'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'sp_ApexSqlLogConnectionMonitor_Start'
    		)
    	EXEC master.dbo.sp_procoption 'sp_ApexSqlLogConnectionMonitor_Start'
    		,'startup'
    		,'false'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'sp_ApexSqlLogConnectionMonitor_Start'
    		)
    	EXEC master.dbo.sp_executesql N'DROP PROCEDURE sp_ApexSqlLogConnectionMonitor_Start'
    
    -- Drop Log xprocs
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2008'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog2008'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog2010'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog2010'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLog'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog'
    
    -- Drop Log API xprocs
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLogApi2008'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogApi2008'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLogApi2010'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogApi2010'
    
    IF EXISTS (
    		SELECT *
    		FROM master.dbo.sysobjects
    		WHERE NAME = 'xp_ApexSqlLogApi'
    		)
    	EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogApi'
    
    -- Free xprocs
    DBCC ApexSqlServerXprocs(FREE)
    
    DBCC ApexSqlLog2008Xprocs(FREE)
    
    DBCC ApexSqlLog2010Xprocs(FREE)
    
    DBCC ApexSqlLogXprocs(FREE)
    
  3. Uninstall the server helper driver by executing the following command in the command prompt:

    “C:\ProgramData\ApexSQL\ApexSQLLog\<Instance_Name>\Binn\ApexSqlLogServerHelper.exe” /unload

  4. Delete the following extended procedure files from the folder “c:\Program Files\Microsoft SQL Server\<MSSQL.SQL.Server>\MSSQL\Binn\”:

    ApexSqlLogXprocs.dll

  5. Delete the server side auditing components folder

    C:\ProgramData\ApexSQL\ApexSQLLog\<Instance_Name>

Downloads

Please download the script(s) associated with this article on our GitHub repository.

Please contact us for any problems or questions with the scripts.