Skip to content

Microsoft SQL-Server Profiler (command-line) for Linux/Mac/Windows (works over ssh)

Notifications You must be signed in to change notification settings

ststeiger/sql_profiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MS-SQL-Server command line profiler Travis-CI Status AppVeyor Status

sql_profiler is a simple and fast replacement for SQL Server Profiler.
It's a .NET-Core command-line port of ExpressProfiler, and runs everywhere .NET Core runs. So it runs on

  • Windows (x86-32, x86-64)
  • Linux (x86-64, ARM-32)
  • Mac/OS-X.

It's a fork of ExpressProfiler for MS-SQL-Server (actually a fork of a slightly modified version - working datetime-format for any language).
I used it to port ExpressProfiler to .NET Core (command-line).

sql_profiler can be used with both Express and non-Express editions of SQL Server 2005/2008/2008r2/2012/2014.
Installation or administrative rights are not required.
Trace permission are required for the SQL-user.

Invocation

./sql_profiler --server {computername\instance} --username WebAppWebServices --password TOP_SECRET --db "The DB you want to profile";

or from the project:

dotnet run sql_profiler --server {computername\instance} --username WebAppWebServices --password TOP_SECRET --db "The DB you want to profile";

If you omit the username, it will attempt to connect with integrated security.

Windows-Console-Profiler: This is Sparta !

Linux-Console-Profiler: This is Sparta !

Grant rights:

-- To Grant access to a Windows Login
USE Master;
GO
GRANT ALTER TRACE TO [DomainNAME\WindowsLogin]
GO

-- To Grant access to a SQL Login
USE master;
GO
GRANT ALTER TRACE TO manvendra
GO

(source)

Standalone Building

Build for Windows x86-64:

dotnet restore -r win-x64
dotnet build -r win-x64
dotnet publish -f netcoreapp2.0 -c Release -r win-x64

Build for Windows x86-32:

dotnet restore -r win-x86
dotnet build -r win-x86
dotnet publish -f netcoreapp2.0 -c Release -r win-x86

Build for Linux x86-32:

not supported by framework

Build for Linux x86-64:

dotnet restore -r linux-x64
dotnet build -r linux-x64
dotnet publish -f netcoreapp2.0 -c Release -r linux-x64

Build for Linux ARM-32 (Raspberry PI/Chromebook/Android):

dotnet restore -r linux-arm
dotnet build -r linux-arm
dotnet publish -f netcoreapp2.0 -c Release -r linux-arm

Build for Linux ARM-64:

not supported by framework

Build for Mac OSX x86-32:

not supported by framework

Build for Mac OSX x86-64:

dotnet restore -r osx-x64
dotnet build -r osx-x64
dotnet publish -f netcoreapp2.0 -c Release -r osx-x64

Mac build requires MacOS >= Sierra (10.12+)

Future:

Build for Android (arch?):

dotnet restore -r android
dotnet build -r android
dotnet publish -f netcoreapp2.0 -c Release -r android

List of RIDs