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
用法
Dim instance As Audit
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)]
[PhysicalFacetAttribute]
public sealed class Audit : ScriptNameObjectBase,
ICreatable, IAlterable, IDroppable, IRenamable, IScriptable
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode::CheckOnSchedule)]
[PhysicalFacetAttribute]
public ref class Audit sealed : public ScriptNameObjectBase,
ICreatable, IAlterable, IDroppable, IRenamable, IScriptable
[<SealedAttribute>]
[<EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)>]
[<PhysicalFacetAttribute>]
type Audit =
class
inherit ScriptNameObjectBase
interface ICreatable
interface IAlterable
interface IDroppable
interface IRenamable
interface IScriptable
end
public final class Audit extends ScriptNameObjectBase implements ICreatable, IAlterable, IDroppable, IRenamable, IScriptable
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. | |
ExecuteForScalar | Gets or sets the Boolean property value that specifies whether the object is set to the execute for scalar option. (从 SqlSmoObject 继承。) | |
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. | |
Guid | Gets or sets the unique system identifier for the referenced audit. | |
ID | Gets the integer value that uniquely identifies the audit. | |
IsTouched | Gets the Boolean property value that specifies whether the object properties have been updated but not yet persisted on the server. (从 SqlSmoObject 继承。) | |
MaximumFileSize | Gets or sets the maximum size of the audit in megabytes. | |
MaximumFileSizeUnit | ||
MaximumRolloverFiles | Gets or sets the maximum number of rollover files allowed. | |
Name | Gets or sets the name of the object. (从 NamedSmoObject 继承。) | |
ObjectInSpace | Gets the Boolean property value that specifies whether the object exists in isolation, or whether it is directly or indirectly connected to the instance of SQL Server. (从 SqlSmoObject 继承。) | |
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. | |
ScalarResult | Gets the scalar result for the referenced object. (从 SqlSmoObject 继承。) | |
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 继承。) |
页首
方法
页首
显式接口实现
名称 | 说明 | |
---|---|---|
IAlienObjectDiscover | (从 SqlSmoObject 继承。) | |
IAlienObjectGetParent | (从 SqlSmoObject 继承。) | |
IAlienObjectGetProperty | (从 SqlSmoObject 继承。) | |
ISfcPropertyProviderGetPropertySet | (从 SqlSmoObject 继承。) | |
IAlienObjectGetUrn | (从 SqlSmoObject 继承。) | |
IAlienObjectResolve | (从 SqlSmoObject 继承。) | |
IAlienObjectSetProperty | (从 SqlSmoObject 继承。) |
页首
注释
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 an audit log, users must have ALTER ANY SERVER AUDIT or CONTROL SERVER permission on the parent server.
To 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. |
线程安全
此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。不保证所有实例成员都是线程安全的。