大网数据广告活动
数据库与应用安全

Use the SQLIOSim utility on Linux

· 52CE 我爱测

This article describes how to use SQLIOSim utility to simulate SQL Server activity on a disk subsystem on Linux.

Applies to: SQL Server 2022 on Linux, SQL Server 2019 on Linux

Introduction

This article describes the SQLIOSim tool. You can use this tool to perform reliability and integrity tests on disk subsystems for SQL Server on Linux and container platforms. These tests simulate read, write, checkpoint, backup, sort, and read-ahead activities for SQL Server on Linux.

The SQLIOSim tool was first written for and released on the Windows platform. SQLIOSim has a dependency on the SQLPAL platform, which enables the execution of the Windows SQLIOSim utility on Linux.

Supported platforms

Platform File system Installation guide
Red Hat Enterprise Linux 7.9, or 8.x Server XFS or EXT4 Red Hat installation guide
SUSE Enterprise Linux Server v12 (SP4 - SP5), or v15 (SP1 - SP4) XFS or EXT4 SUSE Linux Enterprise Server installation guide
Ubuntu 18.04 LTS, 20.04 LTS XFS or EXT4 Ubuntu installation guide
Docker Engine 1.8+ on Windows, macOS, or Linux N/A Run SQL Server container images with Docker guide

SQLIOSim on Linux installation instructions

To install SQLIOSim, follow the steps relevant to the Linux distribution the host machine is running.

Red Hat Enterprise Linux (RHEL)

  1. Use the following commands to add the repository:

    • For RHEL 7:

      • SQL Server 2019:

        sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2019.repo
        
    • For RHEL 8:

      • SQL Server 2019:

        sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2019.repo
        
      • SQL Server 2022:

        sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2022.repo
        
  2. After you've added the repository, run the installation with the following commands:

    1. Switch to the root user:

      sudo su
      
    2. Set the environment variable ACCEPT_EULA to y, to accept the End-User License Agreement:

      export ACCEPT_SQLIOSIM_EULA=y
      
    3. Install SQLIOSim:

      yum install mssql-server-sqliosim
      

SUSE Linux Enterprise Server (SLES)

  1. Add the repository:

    • For SLES v12:

      • SQL Server 2019:

        sudo zypper addrepo -fc https://packages.microsoft.com/config/sles/12/mssql-server-2019.repo
        
    • For SLES v15:

      • SQL Server 2019:

        sudo zypper addrepo -fc https://packages.microsoft.com/config/sles/15/mssql-server-2019.repo
        
      • SQL Server 2022:

        sudo zypper addrepo -fc https://packages.microsoft.com/config/sles/15/mssql-server-2022.repo
        
  2. Refresh the repository:

    sudo zypper --gpg-auto-import-keys refresh
    
  3. Download Microsoft signing key:

    sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
    
  4. Now, run the installation using the following commands:

    1. Switch to the root user:

      sudo su
      
    2. Set the environment variable ACCEPT_EULA to y, to accept the End-User License Agreement:

      export ACCEPT_SQLIOSIM_EULA=y
      
    3. Install SQLIOSim:

      zypper install mssql-server-sqliosim
      

Ubuntu

  1. Import the public repository GPG keys:

    wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add
    
  2. Add the repository:

    • For Ubuntu 18.04:

      • SQL Server 2019:

        sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/18.04/mssql-server-2019.list)"
        
    • For Ubuntu 20.04:

      • SQL Server 2019:

        sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list)"
        
      • SQL Server 2022:

        sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2022.list)"
        
  3. Run the installation using the following commands:

    1. Switch to the root user:

      sudo su
      
    2. Set the environment variable ACCEPT_EULA to y, to accept the End-User License Agreement:

      export ACCEPT_SQLIOSIM_EULA=y
      
    3. Install SQLIOSim:

      apt-get install mssql-server-sqliosim
      

Run SQLIOSim as a non-root user across all distributions

Non-root users can't install SQLIOSim but can run it. To run SQLIOSim as a non-root user, add the non-root user to the "sqliosim" group. In this example, replace <account_to_add> with the account you wish to add.

sudo usermod -a -G sqliosim <account_to_add>

Sign out and sign back in with the same user credentials to ensure that group permissions take effect.

Now, you're ready to run SQLIOSim:

/opt/mssql-sqliosim/bin/sqliosim -cfg /tmp/sqliosim.default.cfg.ini -dir /tmp -log /tmp/sqliosim_log.xml

SQLIOSim configuration file

Sample configuration files for various tests can be downloaded from SQL Server support team's GitHub repository.

wget https://raw.githubusercontent.com/microsoft/mssql-support/master/sqliosim/sqliosim.cfg.linux/sqliosim.default.cfg.ini -P /tmp
wget https://raw.githubusercontent.com/microsoft/mssql-support/master/sqliosim/sqliosim.cfg.linux/sqliosim.hwcache.cfg.ini -P /tmp
wget https://raw.githubusercontent.com/microsoft/mssql-support/master/sqliosim/sqliosim.cfg.linux/sqliosim.nothrottle.cfg.ini -P /tmp
wget https://raw.githubusercontent.com/microsoft/mssql-support/master/sqliosim/sqliosim.cfg.linux/sqliosim.seqwrites.cfg.ini -P /tmp
wget https://raw.githubusercontent.com/microsoft/mssql-support/master/sqliosim/sqliosim.cfg.linux/sqliosim.sparse.cfg.ini -P /tmp

Note:
/tmp is an example path. Change it to your own path.

Sample command to run SQLIOSim with the default.ini file

/opt/mssql-sqliosim/bin/sqliosim -cfg /tmp/sqliosim.default.cfg.ini -dir /tmp -log /tmp/sqliosim_log.xml

For more information about various configuration parameters for configuration files and how to run SQLIOSim, see Use the SQLIOSim utility to simulate SQL Server activity on a disk subsystem. The article applies to SQLIOSim for Linux ecosystems as well.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors (upstream author metadata: aartig13). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 04/08/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。