Поделиться через


Класс Audit

The Audit object represents a SQL Server audit log.

Иерархия наследования

System.Object
  Microsoft.SqlServer.Management.Smo.SmoObjectBase
    Microsoft.SqlServer.Management.Smo.SqlSmoObject
      Microsoft.SqlServer.Management.Smo.NamedSmoObject
        Microsoft.SqlServer.Management.Smo.ScriptNameObjectBase
          Microsoft.SqlServer.Management.Smo.Audit

Пространство имен:  Microsoft.SqlServer.Management.Smo
Сборка:  Microsoft.SqlServer.Smo (в Microsoft.SqlServer.Smo.dll)

Синтаксис

'Декларация
<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)> _
<PhysicalFacetAttribute> _
Public NotInheritable Class Audit _
    Inherits ScriptNameObjectBase _
    Implements ICreatable, IAlterable, IDroppable, IRenamable,  _
    IScriptable, ISfcSupportsDesignMode
'Применение
Dim instance As Audit
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)]
[PhysicalFacetAttribute]
public sealed class Audit : ScriptNameObjectBase, 
    ICreatable, IAlterable, IDroppable, IRenamable, IScriptable, 
    ISfcSupportsDesignMode
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode::CheckOnSchedule)]
[PhysicalFacetAttribute]
public ref class Audit sealed : public ScriptNameObjectBase, 
    ICreatable, IAlterable, IDroppable, IRenamable, IScriptable, 
    ISfcSupportsDesignMode
[<SealedAttribute>]
[<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)>]
[<PhysicalFacetAttribute>]
type Audit =  
    class 
        inherit ScriptNameObjectBase 
        interface ICreatable 
        interface IAlterable 
        interface IDroppable 
        interface IRenamable 
        interface IScriptable 
        interface ISfcSupportsDesignMode 
    end
public final class Audit extends ScriptNameObjectBase implements ICreatable, IAlterable, IDroppable, IRenamable, IScriptable, ISfcSupportsDesignMode

Тип Audit обеспечивает доступ к следующим элементам.

Конструкторы

  Имя Описание
Открытый метод Audit() Initializes a new instance of the Audit class.
Открытый метод Audit(Server, String) Initializes a new instance of the Server class on the specified instance of SQL Server and with the specified name.

В начало

Свойства

  Имя Описание
Открытое свойство CreateDate Gets the date and time when the audit log was created.
Открытое свойство DateLastModified Gets the date and time when the audit log was last modified.
Открытое свойство DestinationType Gets or sets the type of destination to which the audit log information is recorded, such as a file, or an application log.
Открытое свойство Enabled Gets the Boolean value that specifies whether the referenced audit is enabled on the instance of SQL Server. 
Открытое свойство FileName Gets the name of the file in which the audit log information is recorded, when the audit destination is a file.
Открытое свойство FilePath Gets or sets the location of the folder where the audit file is stored when the audit type is a file.
Открытое свойство Filter Gets or sets the filter of the audit.
Открытое свойство Guid Gets or sets the unique system identifier for the referenced audit.
Открытое свойство ID Gets the integer value that uniquely identifies the audit.
Открытое свойство MaximumFiles Gets or sets the maximum files of the audit.
Открытое свойство MaximumFileSize Gets or sets the maximum size of the audit in megabytes.
Открытое свойство MaximumFileSizeUnit Gets or sets the maximum file size unit that an audit is allowed to reach.
Открытое свойство MaximumRolloverFiles Gets or sets the maximum number of rollover files allowed.
Открытое свойство Name Gets or sets the name of the Audit object. (Переопределяет NamedSmoObject.Name.)
Открытое свойство OnFailure Gets or sets the action taken when the audit fails.
Открытое свойство Parent Gets the Server object that is the parent of the Audit object.
Открытое свойство Properties Gets a collection of Property objects that represent the object properties. (Производный от SqlSmoObject.)
Открытое свойство QueueDelay Gets or sets the amount of time in milliseconds that can elapse before audit actions are processed.
Открытое свойство ReserveDiskSpace Gets or sets the Boolean property value that specifies whether disk space is reserved for the audit file.
Открытое свойство State Gets the state of the referenced object. (Производный от SmoObjectBase.)
Открытое свойство Urn Gets the Uniform Resource Name (URN) address value that uniquely identifies the object. (Производный от SqlSmoObject.)
Открытое свойство UserData Gets or sets user-defined data associated with the referenced object. (Производный от SmoObjectBase.)

В начало

Методы

  Имя Описание
Открытый метод Alter Updates any Audit object property changes on the instance of SQL Server. 
Открытый метод Create Creates an audit on the instance of SQL Server as defined by the Audit object.
Открытый метод Disable Disables the audit.
Открытый метод Discover Discovers a list of type Object. (Производный от SqlSmoObject.)
Открытый метод Drop Removes the audit from the instance of SQL Server.
Открытый метод Enable Enables the audit.
Открытый метод EnumDatabaseAuditSpecification Enumerates a list of databases and audit specifications defined by the audit.
Открытый метод EnumServerAuditSpecification Returns the name of the referenced server audit specification.
Открытый метод Equals (Производный от Object.)
Защищенный метод FormatSqlVariant Formats an object as SqlVariant type. (Производный от SqlSmoObject.)
Защищенный метод GetContextDB Gets the context database that is associated with this object. (Производный от SqlSmoObject.)
Защищенный метод GetDBName Gets the database name that is associated with the object. (Производный от SqlSmoObject.)
Открытый метод GetHashCode (Производный от Object.)
Защищенный метод GetPropValue Gets a property value of the SqlSmoObject object. (Производный от SqlSmoObject.)
Защищенный метод GetPropValueOptional Gets a property value of the SqlSmoObject object. (Производный от SqlSmoObject.)
Защищенный метод GetPropValueOptionalAllowNull Gets a property value of the SqlSmoObject object. (Производный от SqlSmoObject.)
Защищенный метод GetServerObject Gets the server of the SqlSmoObject object. (Производный от SqlSmoObject.)
Открытый метод GetType (Производный от Object.)
Открытый метод Initialize() Initializes the object and forces the properties be loaded. (Производный от SqlSmoObject.)
Открытый метод Initialize(Boolean) Initializes the object and forces the properties be loaded. (Производный от SqlSmoObject.)
Защищенный метод IsObjectInitialized Verifies whether the object has been initialized. (Производный от SqlSmoObject.)
Защищенный метод IsObjectInSpace Verifies whether the object is isolated or connected to the instance of SQL Server. (Производный от SqlSmoObject.)
Открытый метод Refresh Refreshes the script name. (Производный от ScriptNameObjectBase.)
Открытый метод Rename Changes the name of the audit to the specified string.
Открытый метод Script() Generates a Transact-SQL script that can be used to re-create the audit.
Открытый метод Script(ScriptingOptions) Generates a Transact-SQL script that can be used to re-create the audit as specified by the script options.
Защищенный метод SetParentImpl Sets the parent of the SqlSmoObject to the newParent parameter. (Производный от SqlSmoObject.)
Открытый метод ToString Returns a String that represents the referenced object. (Производный от SqlSmoObject.)
Открытый метод Validate Validates the state of an object. (Производный от SmoObjectBase.)

В начало

События

  Имя Описание
Открытое событие PropertyChanged Represents the event that occurs when a property is changed. (Производный от SqlSmoObject.)
Открытое событие PropertyMetadataChanged Represents the event that occurs when property metadata changes. (Производный от SqlSmoObject.)

В начало

Явные реализации интерфейса

  Имя Описание
Явная реализация интерфейсаЗакрытый метод IAlienObject.Discover Discovers any dependencies. Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetDomainRoot Returns the root of the domain. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetParent Gets the parent of this object. Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetPropertyType Gets the type of the specified property. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetPropertyValue Gets the value of the specified property. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetUrn Gets the Unified Resource Name (URN) of the object. Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.Resolve Gets the instance that contains the information about the object from the Unified Resource Name (URN) of the object. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.SetObjectState Sets the object state to the specified SfcObjectState value. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.SetPropertyValue Sets the property value. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод ISfcPropertyProvider.GetPropertySet Gets the interface reference to the set of properties of this object. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытое свойство ISfcSupportsDesignMode.IsDesignMode Gets or sets a property that specifies whether the object is open in design mode. Указано только в ознакомительных целях. Не поддерживается. Совместимость с будущими версиями не гарантируется.

В начало

Замечания

To get Audit object properties, users can be a member of the public fixed server role.

To set Audit object properties, users must have ALTER ANY SERVER AUDIT or CONTROL SERVER permission on the parent server.

To create or drop an audit log, users must have ALTER ANY SERVER AUDIT or CONTROL SERVER permission on the parent server.

ПримечаниеПримечание

Any authenticated user can read and write to the Windows Application event log. The Application event log requires lower permissions than the Windows Security event log and is less secure than the Windows Security event log.

Безопасность многопоточности

Любые открытые статический (Shared в Visual Basic) элементы этого типа потокобезопасны. Потокобезопасность с элементами экземпляров не гарантируется.

См. также

Справочник

Пространство имен Microsoft.SqlServer.Management.Smo