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.

SET NOCOUNT ON 

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

-- Role Members 
SELECT  'EXEC sp_addsrvrolemember @rolename =' + SPACE(1) 
        + QUOTENAME(usr1.name, '''') + ', @loginame =' + SPACE(1) 
        + QUOTENAME(usr2.name, '''') 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 usr2.name not in ('sa','DR')
        and usr2.name not like '##%##' and usr2.name not like 'NT%' and usr2.name not like '%.service%' and usr2.name not like '%.agent%'
        and usr2.name 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 [' + server_principals.name 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 server_principals.name not in ('sa','DR')
        and server_principals.name not like '##%##' and server_principals.name not like 'NT%' and server_principals.name not like '%.service%' and server_principals.name not like '%.agent%'
        and server_principals.name not like '%~%'
ORDER BY server_principals.name, 
        server_permissions.state_desc, 
        server_permissions.permission_name 
GO

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.

http://technet.microsoft.com/en-us/library/cc771275(v=ws.10).aspx

Pkgmgr options:

http://technet.microsoft.com/en-us/library/cc749465(v=ws.10).aspx

Full list of windows server packages

http://technet.microsoft.com/en-us/library/cc748930(v=ws.10).aspx

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 6.0.0.1170

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)

Source

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