Save-SqlMigrationReport

Generates In-Memory OLTP Migration Checklist

语法

Default (默认值)

Save-SqlMigrationReport
    [-Server <String>]
    [-Database <String>]
    [-Schema <String>]
    [-Username <String>]
    [-Password <String>]
    [-Object <String>]
    [-InputObject <SqlSmoObject>]
    [-MigrationType <MigrationType>]
    [-FolderPath <String>]
    [<CommonParameters>]

说明

The Save-SqlMigrationReport generates an In-Memory OLTP Migration Checklist.

This informs you about which tables in your database will benefit if ported to use In-Memory OLTP. After you identify a table that you would like to port to use In-Memory OLTP, you can use the memory optimization advisor in SQL Server Management Studio to help you migrate the disk-based table to a memory-optimized table.

Note: This cmdlet is only available for PowerShell 5 (v21). It is not longer available in v22+ of the SQLServer module.

示例

Example 1

PS C:\> Save-SqlMigrationReport -Server 'MySQLServer' -Database 'MyDB' -FolderPath 'C:\MigrationReports'

This command will generate a report for all tables and stored procedures in database MyDb on server MySQLServer. Report file (.html format) will be created for each database object and saved under C:\MigrationReports\MyDB either under Stored Procedure or Tables.

Example 2

PS C:\> $db = Get-Item 'SQLSERVER:\SQL\MySQLServer\DEFAULT\Databases\MyDB'
PS C:\> Save-SqlMigrationReport -FolderPath 'C:\MigrationReports' -InputObject $db

This command will generate the same report as Example 1; the InputObject is passed explicitly and encapsulate both the information about the server and the database.

Example 3

PS C:\> CD 'SQLSERVER:\SQL\MySQLServer\DEFAULT\Databases\MyDB'
PS SQLSERVER:\SQL\MySQLServer\DEFAULT\Databases\MyDB> Save-SqlMigrationReport -FolderPath 'C:\MigrationReports'

This command will generate the same report as Example 1 and 2. Note that the InputObject is inferred from the context, i.e. the current working directory.

参数

-Database

The name of the databased for which the report is going to be generated.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-FolderPath

A path to a folder where the report files will be saved to. Report files will be organized under a folder with the same name as the the value of the Database parameter nested under either a Stored Procedure or Tables folder, depending on the type of the object.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-InputObject

The object (either a Database, a Table, or a Stored Procedure SMO object) on which to generate the report.

参数属性

类型:SqlSmoObject
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-MigrationType

The type of the migration. Currently, only OLTP is supported.

参数属性

类型:MigrationType
默认值:None
接受的值:OLTP
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Object

The name of the object (Table or Stored Procedure) for which the report is going to be generated.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Password

Specifies the password for the SQL Server Authentication login ID that was specified in the Username parameter. Passwords are case-sensitive. When possible, use Windows Authentication. Do not use a blank password, when possible use a strong password.

If you specify the Password parameter followed by your password, the password is visible to anyone who can see your monitor.

If you code Password followed by your password in a .ps1 script, anyone reading the script file will see your password.

Assign the appropriate NTFS permissions to the file to prevent other users from being able to read the file.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Schema

The schema of the object (Table or Stored Procedure) for which the report is going to be generated.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Server

The name of server to connect to (either MYCOMPUTER or MYCOMPUTER\MYINSTANCE).

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Username

Specifies the login ID for making a SQL Server Authentication connection to an instance of the Database Engine.

The password must be specified through the Password parameter.

If Username and Password are not specified, this cmdlet attempts a Windows Authentication connection using the Windows account running the Windows PowerShell session. When possible, use Windows Authentication.

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.