Code Monkey home page Code Monkey logo

databasefilesizemaintenance's People

Contributors

eitanblumin avatar evya696 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

databasefilesizemaintenance's Issues

Add parameter to filter by File Type

Let's call it @FileTypes which will accept the following values:

  • ROWS
  • LOG
  • ALL

With the exception of ALL (which should also be the default), it should match the type_desc column of the sys.master_files and sys.database_files system tables.

It should be used for specifying the file types which we want to manage using the procedure.

Verify and add validations for unsupported SQL versions

This procedure should not be supported in Azure SQL editions.

We should also test this across all supported SQL server versions - SQL server 2012 and up to 2019. Should probably even test on SQL server 2008 just in case.

Create a snippet to be used for job creation

The snippet should be compatible with Ola Hallengren's "MaintenanceSolution.sql" script, which uses insertions into a temp table in its implementation.

For example:

  INSERT INTO @Jobs ([Name], CommandTSQL, DatabaseName, OutputFileNamePart01)
  SELECT 'DatabaseIntegrityCheck - SYSTEM_DATABASES',
         'EXECUTE [dbo].[DatabaseIntegrityCheck]' + CHAR(13) + CHAR(10) + '@Databases = ''SYSTEM_DATABASES'',' + CHAR(13) + CHAR(10) + '@LogToTable = ''' + @LogToTable + '''',
         @DatabaseName,
         'DatabaseIntegrityCheck'

Consider which parameters to include as default.

Allow NULL Values for Parameters

In order to make this solution similar to other stored procedures in Ola's solution, you need to allow to pass NULL values to relevant parameters, which means the corresponding operation or features should be ignored.

For example, I would like to pass NULL to the @MinFileSizeToShrinkMB parameter, because I don't want files to be shrunk at all. As far as I can tell, NULL values aren't currently handled gracefully, and also the documentation doesn't specify them as optional values.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.