Dieser Artikel wurde noch nicht bewertet - Dieses Thema bewerten.

DataFile-Klasse

The DataFile object represents a SQL Server data file.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)
[PhysicalFacetAttribute]
[SfcElementTypeAttribute("File")]
[EvaluationModeAttribute(AutomatedPolicyEvaluationMode.CheckOnSchedule)]
public sealed class DataFile : DatabaseFile, 
	ICreatable, ISfcSupportsDesignMode

Der DataFile-Typ macht folgende Elemente verfügbar.

  NameBeschreibung
Öffentliche MethodeDataFile()Initializes a new instance of the DataFile class.
Öffentliche MethodeDataFile(FileGroup, String)Initializes a new instance of the DataFile class on the specified file group with the specified name.
Öffentliche MethodeDataFile(FileGroup, String, String)Initializes a new instance of the DataFile class on the specified file group with the specified name and file name.
Zum Anfang
  NameBeschreibung
Öffentliche EigenschaftAvailableSpaceGets the amount of available space in the data file in KB.
Öffentliche EigenschaftBytesReadFromDiskGets the number of bytes read from disk.
Öffentliche EigenschaftBytesWrittenToDiskGets the number of bytes written to disk.
Öffentliche EigenschaftFileNameGets or sets the data file name.
Öffentliche EigenschaftGrowthGets or sets the growth increment for the data file in KB or percent.
Öffentliche EigenschaftGrowthTypeGets or sets the growth type for the data file in kilobytes or percent.
Öffentliche EigenschaftIDGets the ID value that uniquely identifies the data file.
Öffentliche EigenschaftIsOfflineGets the Boolean property value that specifies whether the data file is offline or not.
Öffentliche EigenschaftIsPrimaryFileGets the Boolean property value that specifies whether the data file is the primary file of the database.
Öffentliche EigenschaftIsReadOnlyGets the Boolean property value that specifies whether the data file is read-only or can be updated.
Öffentliche EigenschaftIsReadOnlyMediaGets the Boolean property value that specifies whether the data file is stored on read-only media.
Öffentliche EigenschaftIsSparseGets the Boolean value that specifies whether the file is a sparse file. Sparse files are used in database snapshots.
Öffentliche EigenschaftMaxSizeGets or set the maximum size to which the data file can grow in KB.
Öffentliche EigenschaftNameGets or sets the name of the object. (Geerbt von NamedSmoObject.)
Öffentliche EigenschaftNumberOfDiskReadsGets the number of disk reads.
Öffentliche EigenschaftNumberOfDiskWritesGets the number of disk writes.
Öffentliche EigenschaftParentGets or sets the FileGroup object that is the parent of the DataFile object.
Öffentliche EigenschaftPropertiesGets a collection of Property objects that represent the object properties. (Geerbt von SqlSmoObject.)
Öffentliche EigenschaftSizeGets or sets the current size of the data file in KB.
Öffentliche EigenschaftStateGets the state of the referenced object. (Geerbt von SmoObjectBase.)
Öffentliche EigenschaftUrnGets the Uniform Resource Name (URN) address value that uniquely identifies the object. (Geerbt von SqlSmoObject.)
Öffentliche EigenschaftUsedSpaceGets the amount of used space in the data file in KB.
Öffentliche EigenschaftUserDataGets or sets user-defined data associated with the referenced object. (Geerbt von SmoObjectBase.)
Öffentliche EigenschaftVolumeFreeSpaceGets the volume free space in bytes.
Zum Anfang
  NameBeschreibung
Öffentliche MethodeAlterUpdates any property changes to the object to the instance of Microsoft SQL Server. (Geerbt von DatabaseFile.)
Öffentliche MethodeCreateCreates a data file on the instance of SQL Server as defined by the DataFile object.
Öffentliche MethodeDiscoverDiscovers a list of type Object. (Geerbt von SqlSmoObject.)
Öffentliche MethodeDropDrops a database file. (Geerbt von DatabaseFile.)
Öffentliche MethodeEquals (Geerbt von Object.)
Geschützte MethodeFormatSqlVariantFormats an object as SqlVariant type. (Geerbt von SqlSmoObject.)
Geschützte MethodeGetContextDBGets the context database that is associated with this object. (Geerbt von SqlSmoObject.)
Geschützte MethodeGetDBNameGets the database name that is associated with the object. (Geerbt von SqlSmoObject.)
Öffentliche MethodeGetHashCode (Geerbt von Object.)
Geschützte MethodeGetPropValueGets a property value of the SqlSmoObject object. (Geerbt von SqlSmoObject.)
Geschützte MethodeGetPropValueOptionalGets a property value of the SqlSmoObject object. (Geerbt von SqlSmoObject.)
Geschützte MethodeGetPropValueOptionalAllowNullGets a property value of the SqlSmoObject object. (Geerbt von SqlSmoObject.)
Geschützte MethodeGetServerObjectGets the server of the SqlSmoObject object. (Geerbt von SqlSmoObject.)
Öffentliche MethodeGetType (Geerbt von Object.)
Öffentliche MethodeInitialize()Initializes the object and forces the properties be loaded. (Geerbt von SqlSmoObject.)
Öffentliche MethodeInitialize(Boolean)Initializes the object and forces the properties be loaded. (Geerbt von SqlSmoObject.)
Geschützte MethodeIsObjectInitializedVerifies whether the object has been initialized. (Geerbt von SqlSmoObject.)
Geschützte MethodeIsObjectInSpaceVerifies whether the object is isolated or connected to the instance of SQL Server. (Geerbt von SqlSmoObject.)
Öffentliche MethodeMarkForDropMarks the database file to be dropped next time its parent object is altered by the Alter method. (Geerbt von DatabaseFile.)
Öffentliche MethodeRefreshRefreshes the object and retrieves properties when the object is next accessed. (Geerbt von SqlSmoObject.)
Öffentliche MethodeRenameRenames a database file. (Geerbt von DatabaseFile.)
Öffentliche MethodeSetOfflineSets the database file status to offline.
Geschützte MethodeSetParentImplSets the parent of the SqlSmoObject to the newParent parameter. (Geerbt von SqlSmoObject.)
Öffentliche MethodeShrinkShrinks a database file. (Geerbt von DatabaseFile.)
Öffentliche MethodeToStringReturns a String that represents the referenced object. (Geerbt von SqlSmoObject.)
Öffentliche MethodeValidateValidates the state of an object. (Geerbt von SmoObjectBase.)
Zum Anfang
  NameBeschreibung
Öffentliches EreignisPropertyChangedRepresents the event that occurs when a property is changed. (Geerbt von SqlSmoObject.)
Öffentliches EreignisPropertyMetadataChangedRepresents the event that occurs when property metadata changes. (Geerbt von SqlSmoObject.)
Zum Anfang
  NameBeschreibung
Explizite SchnittstellenimplementierungPrivate MethodeIAlienObject.DiscoverDiscovers any dependencies. Verweisen Sie nicht direkt im Code auf dieses Element. Unterstützt die SQL Server-Infrastruktur. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate MethodeIAlienObject.GetDomainRootReturns the root of the domain. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate MethodeIAlienObject.GetParentGets the parent of this object. Verweisen Sie nicht direkt im Code auf dieses Element. Unterstützt die SQL Server-Infrastruktur. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate MethodeIAlienObject.GetPropertyTypeGets the type of the specified property. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate MethodeIAlienObject.GetPropertyValueGets the value of the specified property. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate MethodeIAlienObject.GetUrnGets the Unified Resource Name (URN) of the object. Verweisen Sie nicht direkt im Code auf dieses Element. Unterstützt die SQL Server-Infrastruktur. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate MethodeIAlienObject.ResolveGets the instance that contains the information about the object from the Unified Resource Name (URN) of the object. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate MethodeIAlienObject.SetObjectStateSets the object state to the specified SfcObjectState value. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate MethodeIAlienObject.SetPropertyValueSets the property value. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate MethodeISfcPropertyProvider.GetPropertySetGets the interface reference to the set of properties of this object. (Geerbt von SqlSmoObject.)
Explizite SchnittstellenimplementierungPrivate EigenschaftISfcSupportsDesignMode.IsDesignModeGets a Boolean value that indicates whether the object supports design mode.
Zum Anfang

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

To set the DataFile object properties, users must have ALTER permission on the database or be a member of the db_owner fixed database role.

To create a data file, users must have ALTER permission on the database or be a member of the db_owner fixed database role.

To drop a data file, users must have ALTER permission on the database or be a member of the db_owner fixed database role.

Thread Safety

Alle öffentlichen, statischen Elemente dieses Typs (Shared in Microsoft Visual Basic) sind für Vorgänge mit mehreren Threads sicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Alle öffentlichen static (Shared in Visual Basic)-Elemente dieses Typs sind Threadsicher. Für Instanzelemente wird die Threadsicherheit nicht gewährleistet.
Fanden Sie dies hilfreich?
(1500 verbleibende Zeichen)

Community-Beiträge

HINZUFÜGEN
© 2013 Microsoft. Alle Rechte vorbehalten.