SSISDB update failed during the SQL CU or SP udpate

Reason: the cu found a SSIDB and wanted to upgrade it.
It failed because SSIS component is not installed to the server.

It needs: Cannot bulk load. The file “C:\Program Files\Microsoft SQL Server\150\DTS\Binn\Microsoft.SqlServer.IntegrationServices.Server.dll” does not exist or you don’t have file access rights.
Yes it is missing , because SSIS component installed.

Without the ssisdb the sql server was not able to start.

It recommended to reinstall the master. Do NOT reinstall the master.

My solution was:

  1. Install (add ) the Integration Service component.
  2. Start the server with 902 flag (admin command prompt)

create a missing SQL login and connect to hte SSISD

 

Reason:

If you don’t create SSISDB locally (you attach by migration), the SQL login will missing.

 

Help:

After installing Integration service it gave enough hint:

2021-07-10 14:12:47.73 spid10s     Cannot find the login ‘##MS_SSISServerCleanupJobLogin##’, because it does not exist or you do not have permission.

2021-07-10 14:12:47.73 spid10s     Error: 912, Severity: 21, State: 2.

2021-07-10 14:12:47.73 spid10s     Script level upgrade for database ‘master’ failed because upgrade step ‘ISServer_upgrade.sql’ encountered error 15151, state 1, severity 16. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the ‘master’ database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.

SUM: Please check if there is a SSIDB in the SQL server before install SP or CU.

Find and list read and writeable user databases which are only in local instance or in primary AG group

List database names, which are in AO AG:

Local databases , which are outside of AO AG:

Writeable databases : primary db or only in local instance

 

Find limited SQL database files and log files

How to list limited database file size in a SQL server?

Subquery inside FROM table VS JOIN

Just an example for the same solution and results:

Oversizing a column in a table – finding varchar(max) and text in MsSQL

It is very commmon when a table have one or more to wide columns.
Sometimes developers choose not supported columns, for example, text type in MS SQL database.
I always looking for text, ntext, varchar(max) and nvarchar(max) :

After it, I check the (n)varchar and (n)char columns.

I am finding the longest string.

Index fragmentation with table row count and index creation and modification date

You can often check the index defragmentation. It is useful if you start checking with the biggest table, because the biggest effect is there.
I like to check the indexes with the creation and modification date. If you rebuild the index your index modification date will be updated.

If you want to see for all database you can replace the

  • DB_ID()
  • with

  • NULL
  • in the script.

    Python and MS SQL connection

    Install ODBC driver for MS SQL>
    pip install pyodbc
    Downloading pyodbc-4.0.30-cp39-cp39-win_amd64.whl (67 kB)
    |████████████████████████████████| 67 kB 745 kB/s
    Installing collected packages: pyodbc
    Successfully installed pyodbc-4.0.30

    Python query:

    Download SQL PASS content

    As announced on December 17, 2020, PASS saddened to share that, due to the impact of COVID-19, PASS is ceasing all regular operations, effective January 15, 2021. PASS will maintain access for members until January 15th. Please read the announcement from the PASS Board for more information.
    The PASS encourage you to take full advantage of any access that you have to PASS content between now and January 15, 2021.

    You can download them in the SQLSatruday website by manually:

    sqlsaturday SQL Pass
    SQLSsaturday – SQL Pass  web page presentation download

    Or you can download by script.
    I created a simple script in python, which can download the files which is not required authentication. Why python? I started to study it two month ago, so I must have a real practice.

    The scripts create a subfolder for every 1000 files, if it stops (I had problem with two special filename, you can rewrite the hinumber and lownumber and continue)

    Be aware!
    So the SQL Pass is a very large community. If you want to download around 3500 pdf ,  4000 ppt and 8000 zip files with a lot of stuff, you need at least 50 GB disk space.
    I am sure this big community will survive in a new form.

    Enjoy the knowledge of SQL Server community!

    Install wget in Python

    You don’t need to downloag and install wget.
    Instead of it, you run the following in cmd (or in python):