admintools was unable read /opt/vertica/config/admintools.conf

Problem: When attempting to open adminTools in Vertica, you get the following error:

[LIVE.DC1][xxxxxx@xxverticaxx /opt/vertica/bin]$ ./adminTools
admintools was unable read /opt/vertica/config/admintools.conf due to a conflict with another process that was writing to this file.  Please retry or if necessary remove the .lock file in the config directory

Solution: Check initially for a rogue lock on the admintools.conf file and remove if exists:

cd /opt/vertica/config
ls -l | grep lock
-rwxr-xr-x 1 vertica vertica    0 Jul 23 11:20 admintools.conf.lock
rm admintools.conf.lock

Once removed, the adminTools should be accessible again.

Extract SQL Server Roles Script

Excellent way to extract Server roles for users on a SQL Server machine. Useful for Migrations.


SELECT  'USE' + SPACE(1) + QUOTENAME('MASTER') AS '--Database Context' 

-- Role Members 
SELECT  'EXEC sp_addsrvrolemember @rolename =' + SPACE(1) 
        + QUOTENAME(, '''') + ', @loginame =' + SPACE(1) 
        + QUOTENAME(, '''') AS '--Role Memberships' 
FROM    sys.server_principals AS usr1 
        INNER JOIN sys.server_role_members AS rm ON usr1.principal_id = rm.role_principal_id 
        INNER JOIN sys.server_principals AS usr2 ON rm.member_principal_id = usr2.principal_id 
        WHERE not in ('sa','DR')
        and not like '##%##' and not like 'NT%' and not like '%.service%' and not like '%.agent%'
        and not like '%~%'
ORDER BY rm.role_principal_id ASC 

-- Permissions 
SELECT  server_permissions.state_desc COLLATE SQL_Latin1_General_CP1_CI_AS 
        + ' ' + server_permissions.permission_name COLLATE SQL_Latin1_General_CP1_CI_AS 
        + ' TO [' + COLLATE SQL_Latin1_General_CP1_CI_AS 
        + ']' AS '--Server Level Permissions' 
FROM    sys.server_permissions AS server_permissions WITH ( NOLOCK ) 
        INNER JOIN sys.server_principals AS server_principals WITH ( NOLOCK ) ON server_permissions.grantee_principal_id = server_principals.principal_id 
WHERE   server_principals.type IN ( 'S', 'U', 'G' ) 
        and not in ('sa','DR')
        and not like '##%##' and not like 'NT%' and not like '%.service%' and not like '%.agent%'
        and not like '%~%'

Pkgmgr utility to install windows features including Telnet

Install Telnet Client by using a command line

On Windows 7, Windows Server 2008 R2, Windows Server 2008 or Windows Vista you can use the following command line procedure to install Telnet Client.

Open a command prompt window. Click Start, type cmd in the Start Search box, and then press ENTER.
Type the following command:

pkgmgr /iu:"TelnetClient"

If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue. When the command prompt appears again, the installation is complete.

Pkgmgr options:

Full list of windows server packages

Find Lead blocker…quickly

Script below quickly finds a lead blocker in the blocking chain and provides useful information on it.

select loginame, cpu, memusage, physical_io, * 
  from  master..sysprocesses a
 where  exists ( select b.*
     from master..sysprocesses b
    where b.blocked > 0 and
   b.blocked = a.spid ) and not
 exists ( select b.*
     from master..sysprocesses b
    where b.blocked > 0 and
   b.spid = a.spid ) 
order by spid

Enable/Disable Debug for Netapp SnapManager for SQL

Came across a rogue debug log that was generating 500mb of log every time the backup job ran. To initially alleviate the disk filling up Logging was disabled which has to be done via the Registry. I am using SnapManager version

If using SnapManager for SQL 5.X, change the registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Network Appliance\SnapManager for SQL Server\Server\EnableDebug 
Set to 1 to enable, 0 to disable.

In most cases, the SnapManager Service does NOT need to be restarted after setting this value. You DO need to close and reopen the SnapManager for SQL Management console GUI. The additional debug logs will be saved in a subdirectory of the configured ‘report’ directory called Debug [ServerName]. For example:
C:\Program Files\NetApp\SnapManager for SQL Server\Report\Debug [myserver1]

In case you are still using an OLDER SnapManager for SQL versions (1.x through 2.x), follow those steps: 
To enable debug logging for SMSQL, two steps are required:

1. In the Windows Registry, locate the value LoggingLevel in the subkey path 
HKEY_LOCAL_MACHINE\SOFTWARE\NetApp\SnapManager for SQL Server\Debug
Change the value data to 0x00000001 (1)

2. Next, the SnapManagerdebug.exe program must be executed and be a running process.

To disable debug logging, kill the running process SnapManagerDebug.exe from Windows Task Manager GUI, or Windows 2003 cli tasklist / tskill and/or change the value data of the above registry sub key back to the default of 0x00000000 (0)


Netapp Support KB ID: 1011946 Version: 3.0 Published date: 01/31/2013