Audit.MaximumFileSizeUnit 속성

Gets or sets the maximum file size unit that an audit is allowed to reach.

네임스페이스:  Microsoft.SqlServer.Management.Smo
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

구문

‘선언
<SfcPropertyAttribute(SfcPropertyFlags.Standalone)> _
Public Property MaximumFileSizeUnit As AuditFileSizeUnit 
    Get 
    Set
‘사용 방법
Dim instance As Audit 
Dim value As AuditFileSizeUnit 

value = instance.MaximumFileSizeUnit

instance.MaximumFileSizeUnit = value
[SfcPropertyAttribute(SfcPropertyFlags.Standalone)]
public AuditFileSizeUnit MaximumFileSizeUnit { get; set; }
[SfcPropertyAttribute(SfcPropertyFlags::Standalone)]
public:
property AuditFileSizeUnit MaximumFileSizeUnit {
    AuditFileSizeUnit get ();
    void set (AuditFileSizeUnit value);
}
[<SfcPropertyAttribute(SfcPropertyFlags.Standalone)>]
member MaximumFileSizeUnit : AuditFileSizeUnit with get, set
function get MaximumFileSizeUnit () : AuditFileSizeUnit 
function set MaximumFileSizeUnit (value : AuditFileSizeUnit)

속성 값

유형: Microsoft.SqlServer.Management.Smo.AuditFileSizeUnit
An AuditFileSizeUnit value specifying the type of the maximum audit file size.

주의

The MaximumFileSizeUnit property specifies whether the maximum size of the audit log file can be measured in megabytes, gigabytes, or terabytes. When the audit is created, it defaults to the megabytes setting.

The following code example shows how to set the maximum file type size of the audit log file to gigabytes.

C#

using System;
using Microsoft.SqlServer.Management.Smo;

namespace samples
{
    class Program
    {
        static void Main(string[] args)
        {
            //Create the audit 
            Server dbServer = new Server("(local)");
            Audit dbAudit = new Audit(dbServer, "Test Audit");
            dbAudit.DestinationType = AuditDestinationType.File;
            dbAudit.FilePath = "C:\\AuditDirectory";
            dbAudit.Create();

            //Set the audit file size unit
            dbAudit.MaximumFileSizeUnit = AuditFileSizeUnit.Gb;  
        }
    }
}

Powershell

#Create the audit 
$dbServer = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$dbAudit = New-Object Microsoft.SqlServer.Management.Smo.Audit($dbServer, "Test Audit")
$dbAudit.DestinationType = [Microsoft.SqlServer.Management.Smo.AuditDestinationType]'File'
$dbAudit.FilePath = "C:\AuditDirectory"
$dbAudit.Create()

#Set the audit file size units
$dbAudit.MaximumFileSizeUnit = [Microsoft.SqlServer.Management.Smo.AuditFileSizeUnit]'Gb'

참고 항목

참조

Audit 클래스

Microsoft.SqlServer.Management.Smo 네임스페이스