SQL Server on Linux – Directory Structure

If you have installed SQL Server using my previous post Install SQL Server 2017 on Linux, this post is to describe the directory structure of SQL Server on Linux.

MSSQL binaries are installed under /opt/mssql folder. This folder further includes mssql binaries & libraries sub-folders:-

  • MSSQL Binaries /opt/mssql/bin :-
├── bin
│   ├── compress-dump.sh
│   ├── crash-support-functions.sh
│   ├── generate-sql-dump.sh
│   ├── handle-crash.sh
│   ├── mssql-conf
│   ├── paldumper
│   └── sqlservr
  • MSSQL Libraries /opt/mssql/lib :-
└── lib
    ├── libc++abi.so.1
    ├── libc++.so.1
    ├── libjemalloc.so.1
    ├── libsqlvdi.so
    ├── libunwind.so.8
    ├── loc
    │   ├── de_DE
    │   │   └── LC_MESSAGES
    │   │       └── sqlservr.mo
    │   ├── en_US
    │   │   └── LC_MESSAGES
    │   │       └── sqlservr.mo
    │   ├── es_ES
    │   │   └── LC_MESSAGES
    │   │       └── sqlservr.mo
    │   ├── fr_FR
    │   │   └── LC_MESSAGES
    │   │       └── sqlservr.mo
    │   ├── it_IT
    │   │   └── LC_MESSAGES
    │   │       └── sqlservr.mo
    │   ├── ja_JP
    │   │   └── LC_MESSAGES
    │   │       └── sqlservr.mo
    │   ├── ko_KR
    │   │   └── LC_MESSAGES
    │   │       └── sqlservr.mo
    │   ├── pt_BR
    │   │   └── LC_MESSAGES
    │   │       └── sqlservr.mo
    │   ├── ru_RU
    │   │   └── LC_MESSAGES
    │   │       └── sqlservr.mo
    │   ├── zh_CN
    │   │   └── LC_MESSAGES
    │   │       └── sqlservr.mo
    │   └── zh_TW
    │       └── LC_MESSAGES
    │           └── sqlservr.mo
    ├── mssql-conf
    │   ├── checkinstall.sh
    │   ├── checkrunninginstance.sh
    │   ├── collations.txt
    │   ├── invokesqlservr.sh
    │   ├── loc
    │   │   └── mo
    │   │       ├── mssql-conf-de_DE.mo
    │   │       ├── mssql-conf-en_US.mo
    │   │       ├── mssql-conf-es_ES.mo
    │   │       ├── mssql-conf-fr_FR.mo
    │   │       ├── mssql-conf-it_IT.mo
    │   │       ├── mssql-conf-ja_JP.mo
    │   │       ├── mssql-conf-ko_KR.mo
    │   │       ├── mssql-conf-pt_BR.mo
    │   │       ├── mssql-conf-ru_RU.mo
    │   │       ├── mssql-conf-zh_CN.mo
    │   │       └── mssql-conf-zh_TW.mo
    │   ├── mssqlconfhelper.py
    │   ├── mssql-conf.py
    │   ├── mssqlsettingsmanager.py
    │   ├── mssqlsettings.py
    │   └── set-collation.sh
    ├── secforwarderxplat.sfp
    ├── sqlagent.sfp
    ├── sqldkxplat.sfp
    ├── sqlservr.sfp
    ├── system.certificates.sfp
    ├── system.common.sfp
    ├── system.netfx.sfp
    └── system.sfp

Then comes the MSSQL Client tools (mssql-tools) directory structure. MSSQL Tools parent folder is /opt/mssql-tools which further contains its binaries and libraries.

  • MSSQL Tools binaries:-
├── bin
│   ├── bcp
│   └── sqlcmd

  • MSSQL Tools libraries:-
└── share
    └── resources
        └── en_US
            ├── BatchParserGrammar.dfa
            ├── BatchParserGrammar.llr
            ├── bcp.rll
            └── SQLCMD.rll

Then comes the MSSQL Data/Log files which is /var/opt/mssql, this is the default directory where all of configuration and user data files are stored. All the files that you can modify are kept under this directory and thus we need to be mostly concerned with this directory.

/var/opt/mssql further contains:-

  • Data Directory – /var/opt/mssql/data
├── data
│   ├── master.mdf
│   ├── mastlog.ldf
│   ├── modellog.ldf
│   ├── model.mdf
│   ├── msdbdata.mdf
│   ├── msdblog.ldf
│   ├── tempdb.mdf
│   └── templog.ldf
  • (Error) Log Directory – /var/opt/mssql/log
├── log
│   ├── errorlog
│   ├── errorlog.1
│   ├── errorlog.2
│   ├── errorlog.3
│   ├── HkEngineEventFile_0_131498572439160000.xel
│   ├── HkEngineEventFile_0_131498572623350000.xel
│   ├── HkEngineEventFile_0_131498575226920000.xel
│   ├── log_1.trc
│   ├── log_2.trc
│   ├── log_3.trc
│   ├── log_4.trc
│   ├── log.trc
│   ├── sqlagent.out
│   ├── sqlagentstartup.log
│   ├── system_health_0_131498572467540000.xel
│   ├── system_health_0_131498572634770000.xel
│   └── system_health_0_131498575237110000.xel

  • MSSQL Configuration File – /var/opt/mssql/mssql.conf
├── mssql.conf

  • Authentication Keys – /var/opt/mssql/secret
└── secrets
    └── machine-key

 

NOTE: All these files are owned by mssql user, thus can be accessed only by mssql user or root.

In the next post we would further dwell into these directories especially the configuration files /var/opt/mssql/mssql.conf and mssql-conf utility which is going to play a very important role in SQL Server configuration in Linux.

One thought on “SQL Server on Linux – Directory Structure

  1. Pingback: SQL Server | Oracle Database Internal Mechanism

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s