GithubHelp home page GithubHelp logo

rrg92 / custommssql Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 16.36 MB

Módulo para powershell contendo diversos cmdlets que auxiliam na Administração e desenvolvimento de soluções SQL Server

License: MIT License

PowerShell 99.91% SQLPL 0.09%

custommssql's People

Contributors

rrg92 avatar

Watchers

 avatar  avatar

Forkers

jpnr79

custommssql's Issues

[Invoke-NewQuery] sp_WhoIsActive Mode

Allows users pass sp_whoisactive parameters directly on the cmdlets parameters.

For example, user activates sp_WhoIsActive mode using a parameter -WhoIsActive. Then cmdlets accepts all parameters and passes it to sp_WhoIsActive execution, except special parameters, like "ServerInstance".

If sp_WhoIsActive dont exists, a parameter can define if cmdlet will try create it.

In this way, the cmdlet can easily allows user generate sp_WhoIsActive results and export for excel, for example.

[Logging] Implement support for automatic identation

Identation of log messages is possible manually, where user of Log object must add the tab character when calling log method.

The purpose of this enhancement is provided a way to user, via parameters, drive the log engine when tabs must be added or not to message, in order to ident related log messages and creates parent-child relations easily in same way the code stays clean!

For example:

Log "Main message" -RaiseNext
Log "Main Message child 1"
Log "Main Message child 2" -RaiseNext
Log "Main message child 2 child 1"
Log "Main Messae child 3" -Drop
Log "Main Message 2" -Drop -RaiseNext
Log "Main Message 2 child 1"
Log "Main Message 2 child 1 child 1" -Raise
Log "Main Message 3" -Drop 0
Log "Main Message 4"

Must produce this output (each "-" represents a "tab")

Main message
-Main Message child 1
-Main Message child 2
--Main message child 2 child 1
-Main Message child 3
Main Message 2
-Main Message 2 child 1
--Main Message 2 child 1 child 1
Main Message 3
Main Message 4

[Copy-SQLDatabase] Error in restoring permissions, when creating principal of type SQL_USER

This erros is generated when creating a principal which type is SQL_USER. Seems that this happens because backed up user has not a valid login mapped...

MSSQL_ERROR: An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name.

[Copy-SQLDatabase] Separate location for post scripts results

Allows users specify a separate location for post scripts execution results.

This allows a DBA schedule Copy-SQLDatabase in order to attend a specific user request (production to development, for example) and allows that user provider your custom scripts to be applied after database is restored. The results of post scripts will be outputed to this location, instead of just log file, how is in current version.

[Send-SQL2Zabbix] Multiple instances of same host

Cache manager can bug if multiple instances of same host if executed (e.g: different keygroup).

Must there are a way to script create a unique instance or merge databases between all instances.

[Send-SQL2Zabbix] Cache folder name

A non critical bug: The name used for build cache folder full path is got from $HostName paramter and not $VALUES.HOSTNAME variable. This can generate some incorrect paths!

[Copy-SQLDatabase] Implements a concurrency control on read/write backup file

When two instance of Copy-SQLDatabase cmdlet runs in parallel, in some cases, the portion that writes to backup file and read from backup file can be excuted at same time, causing error in some of them.

The proposal is allows the cmdlet detects and coordenates this cenarios, blocking cmdlet invokes BACKUP COMMAND when another instance running "RESTORE COMMAND". Paralell RESTORE commands is acceptable.

Must exists a mechanism that synchronizes different instances when it about to ask a instance write to a file.

Here a example of a flow:

  1. Copy-SQLDatabase instance 1 starts
  2. Instance 1 ask a source instance to generate a backup file
  3. After backup is generated, the instance 1 continue progress and starts part for ask Restore on destination instance
  4. Copy-SQLDatabase instance 2 starts (in different machine)
  5. At this point, we considere it are using Source SQL Server instance with same instance and database.
  6. Instance 1 asks to source instance starts backup. In current version, this will cause a error, because the backup files is being read of destination instance in Copy-SQLDatabase instance 1
  7. For avoid lot of space utilization, the Instance 2 of Copy-SQLDatabase must waits restore ends before try getting new backup. In this case, it can reuse the recent backup file generate (A parameter can allows you disable this behavior)
  8. In some situations, the Instance 2 can try skip backup generation and tru use for read (if, for example, it detects that backup is too recently). I dont have 100% gurantees if UseRecent parameter already can cause this behavior.

[Copy-SQLDatabase] Export Permissions Script

Implement a option to export permissions backed up to be restored after database is restored (KeepPermissions).

By default, the cmdlet extracts permissions and store in memory only. With this enhancement, a new parameter will provider a user a chance to export generated DCL for keep permissions. It is like a backup of existent permissions, before overwrite destination database.

Add a versioning info

Needs a way to add a versioning to each cmdlet in order to allow users check version of cmdlet.

This system, needs allows a standarlized way to check version for each cmdlet.

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.