follower database 功能允許你將位於不同叢集的資料庫附加到你的 Azure Data Explorer 叢集。
後續資料庫會以只讀模式附加,讓您能夠檢視數據,並在內嵌至領導者資料庫的數據上執行查詢。 從屬資料庫會同步主資料庫中的變更。 由於同步處理,數據可用性會有幾秒鐘到幾分鐘的數據延遲。 時間延遲的長度取決於領導者資料庫元數據的整體大小。 領導者和追蹤者資料庫會使用相同的記憶體帳戶來擷取數據。 領導者資料庫擁有記憶體。 後續資料庫會檢視數據,而不需要擷取數據。 由於附加資料庫是只讀資料庫,因此資料庫中的數據、數據表和原則無法修改,除了快取原則、主體和許可權。 無法刪除附加的資料庫。 領導者或追蹤者必須先卸離資料庫,才能刪除。
使用追隨者功能將資料庫附加至不同的叢集,作為在組織與團隊之間共享數據的基礎設施。 此功能有助於隔離計算資源,以保護生產環境免於非生產使用案例。 Follower 也可以用來將 Azure Data Explorer 叢集的成本關聯到執行資料查詢的方。
注意
如需以舊版 SDK 為基礎的程式代碼範例,請參閱 封存一文。
追蹤哪些資料庫?
下列適用於叢集:
- 叢集可以遵循一個資料庫、數個資料庫或領導者叢集的所有資料庫。
- 單一叢集可以追蹤來自多個領導者叢集的資料庫。
- 叢集可以同時包含追蹤者資料庫和領導者資料庫。
必要條件
- 一個 Azure 訂閱。 建立一個免費Azure帳號。
- 一個 Azure Data Explorer 叢集與資料庫,供領導者與跟隨者使用。
建立叢集和資料庫。
- 領導者資料庫應該包含數據。 您可以使用資料載入概觀中所討論的其中一種方法來載入數據。
附加資料庫
您可以使用各種方法來附加資料庫。 本文討論如何使用 C#、Python、PowerShell 或 Azure Resource Manager 範本來附加資料庫。
若要附加資料庫,您必須擁有使用者、群組、服務主體或受控識別,並且在主叢集和從叢集上至少具備貢獻者角色。 使用 Azure portal、PowerShell、Azure CLI 以及 ARM 模板 來新增或移除角色指派。 了解更多關於Azure角色基礎存取控制(Azure RBAC)以及不同角色 。
注意
不需要預先建立追蹤資料庫,因為在附加過程中會自動建立。
數據表層級共用
當您附加資料庫時,也會追蹤所有數據表、外部數據表和具體化檢視。 您可以藉由設定 『TableLevelSharingProperties』 來共用特定的數據表/外部數據表/具體化檢視。
'TableLevelSharingProperties' 包含八個字符串陣列:tablesToInclude、tablesToExcludeexternalTablesToInclude、、externalTablesToExcludematerializedViewsToInclude、materializedViewsToExclude、 functionsToInclude和 functionsToExclude。 所有陣列中的項目數目上限為100。
注意
- 使用 『*』 所有資料庫表示法時,不支持數據表層級共用。
- 當包含具現化視圖時,也會包含它們的數據源表。
範例
下列範例包含所有數據表。 根據預設,所有資料表都會遵循某種規則,且不需使用『*』表示法:
tablesToInclude = []
下列範例包含所有函式。 根據預設,所有函式的操作都不需要使用『*』符號表示法。
functionsToInclude = []
下列範例包含名稱開頭為 「Logs」 的所有資料表:
tablesToInclude = ["Logs*"]
下列範例包含所有外部資料表:
externalTablesToExclude = ["*"]
下列範例包含所有具體化檢視:
materializedViewsToExclude=["*"]
資料庫名稱覆寫
您可以選擇性地讓追蹤叢集中的資料庫名稱與領導者叢集不同。 例如,您可能想要將多個領導者叢集的相同資料庫名稱附加至追蹤者叢集。 若要指定不同的資料庫名稱,請設定 『DatabaseNameOverride』 或 'DatabaseNamePrefix' 屬性。
使用 C# 附加資料庫
必要的 NuGet 套件
C# 範例
var followerClusterId = KustoClusterResource.CreateResourceIdentifier(subscriptionId: "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx", resourceGroupName: "followerResourceGroup", clusterName: "follower");
var leaderClusterId = KustoClusterResource.CreateResourceIdentifier(subscriptionId: "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx", resourceGroupName: "leaderResourceGroup", clusterName: "leader");
var attachedDatabaseConfigurationName = "attachedDatabaseConfiguration";
var credentials = new ManagedIdentityCredential();
var resourceManagementClient = new ArmClient(credentials);
var followerCluster = resourceManagementClient.GetKustoClusterResource(followerClusterId);
var attachedDatabaseConfigurations = followerCluster.GetKustoAttachedDatabaseConfigurations();
var attachedDatabaseConfigurationData = new KustoAttachedDatabaseConfigurationData
{
ClusterResourceId = leaderClusterId,
DatabaseName = "<databaseName>", // Can be a specific database name in a leader cluster or * for all databases
DefaultPrincipalsModificationKind = KustoDatabaseDefaultPrincipalsModificationKind.Union,
Location = AzureLocation.NorthCentralUS
};
// Table level sharing properties are not supported when using '*' all databases notation.
if (attachedDatabaseConfigurationData.DatabaseName != "*")
{
// Set up the table level sharing properties - the following is just an example.
attachedDatabaseConfigurationData.TableLevelSharingProperties = new KustoDatabaseTableLevelSharingProperties();
attachedDatabaseConfigurationData.TableLevelSharingProperties.TablesToInclude.Add("table1");
attachedDatabaseConfigurationData.TableLevelSharingProperties.TablesToExclude.Add("table2");
attachedDatabaseConfigurationData.TableLevelSharingProperties.ExternalTablesToExclude.Add("exTable1");
attachedDatabaseConfigurationData.TableLevelSharingProperties.ExternalTablesToInclude.Add("exTable2");
attachedDatabaseConfigurationData.TableLevelSharingProperties.MaterializedViewsToInclude.Add("matTable1");
attachedDatabaseConfigurationData.TableLevelSharingProperties.MaterializedViewsToExclude.Add("matTable2");
attachedDatabaseConfigurationData.TableLevelSharingProperties.FunctionsToInclude.Add("func1");
attachedDatabaseConfigurationData.TableLevelSharingProperties.FunctionsToExclude.Add("func2");
}
await attachedDatabaseConfigurations.CreateOrUpdateAsync(WaitUntil.Completed, attachedDatabaseConfigurationName, attachedDatabaseConfigurationData);
使用 Python 附加資料庫
必修模組
pip install azure-identity
pip install azure-mgmt-kusto
Python 範例
from azure.mgmt.kusto import KustoManagementClient
from azure.mgmt.kusto.models import AttachedDatabaseConfiguration, TableLevelSharingProperties
from azure.identity import ClientSecretCredential
import datetime
#Directory (tenant) ID
tenant_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
#Application ID
client_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
#Client Secret
client_secret = "xxxxxxxxxxxxxx"
follower_subscription_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
leader_subscription_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
credentials = ClientSecretCredential(
tenant_id=tenant_id,
client_id=client_id,
client_secret=client_secret
)
kusto_management_client = KustoManagementClient(credentials, follower_subscription_id)
follower_resource_group_name = "followerResourceGroup"
leader_resource_group_name = "leaderResourceGroup"
follower_cluster_name = "follower"
leader_cluster_name = "leader"
attached_database_Configuration_name = "uniqueNameForAttachedDatabaseConfiguration"
database_name = "db" # Can be a specific database name in a leader cluster or * for all databases
default_principals_modification_kind = "Union"
location = "North Central US"
cluster_resource_id = "/subscriptions/" + leader_subscription_id + "/resourceGroups/" + leader_resource_group_name + "/providers/Microsoft.Kusto/Clusters/" + leader_cluster_name
table_level_sharing_properties = None
if (database_name != "*"):
#Set up the table level sharing properties - the following is just an example.
tables_to_include = ["table1", "table2", "table3"]
external_tables_to_exclude = ["Logs*"]
table_level_sharing_properties = TableLevelSharingProperties(tables_to_include = tables_to_include, external_tables_to_exclude = external_tables_to_exclude)
attached_database_configuration_properties = AttachedDatabaseConfiguration(cluster_resource_id = cluster_resource_id, database_name = database_name, default_principals_modification_kind = default_principals_modification_kind, location = location, table_level_sharing_properties = table_level_sharing_properties)
#Returns an instance of LROPoller, see https://learn.microsoft.com/python/api/msrest/msrest.polling.lropoller?view=azure-python
poller = kusto_management_client.attached_database_configurations.begin_create_or_update(follower_resource_group_name, follower_cluster_name, attached_database_Configuration_name, attached_database_configuration_properties)
使用 PowerShell 附加資料庫
必要條件模組
Install : Az.Kusto
PowerShell 範例
$FollowerClustername = 'follower'
$FollowerClusterSubscriptionID = 'xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx'
$FollowerResourceGroupName = 'followerResourceGroup'
$DatabaseName = "db" ## Can be a specific database name in a leader cluster or * for all databases
$FollowerDatabaseName = 'followerdbname' ## Use this option if the follower database requires a different name than the leader database.
$LeaderClustername = 'leader'
$LeaderClusterSubscriptionID = 'xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx'
$LeaderClusterResourceGroup = 'leaderResourceGroup'
$DefaultPrincipalsModificationKind = 'Union'
##Construct the LeaderClusterResourceId and Location
$getleadercluster = Get-AzKustoCluster -Name $LeaderClustername -ResourceGroupName $LeaderClusterResourceGroup -SubscriptionId $LeaderClusterSubscriptionID -ErrorAction Stop
$LeaderClusterResourceid = $getleadercluster.Id
$Location = $getleadercluster.Location
## Handle the config name if all databases need to be followed. The config name can be given any unique name
if($DatabaseName -eq '*') {
$configname = $FollowerClustername + 'config'
}
else {
$configname = $DatabaseName
}
##Table level sharing is not supported when using '*' all databases notation. If you use the all database notation please remove all table level sharing lines from the powershell command.
New-AzKustoAttachedDatabaseConfiguration -ClusterName $FollowerClustername `
-Name $configname `
-ResourceGroupName $FollowerResourceGroupName `
-SubscriptionId $FollowerClusterSubscriptionID `
-DatabaseName $DatabaseName ` ## Leader database name.
-DatabaseNameOverride $FollowerDatabaseName ` ## Use this option if the follower database requires a different name than the leader database. Otherwise, this parameter can be removed.
-ClusterResourceId $LeaderClusterResourceid `
-DefaultPrincipalsModificationKind $DefaultPrincipalsModificationKind `
-Location $Location `
-TableLevelSharingPropertyTablesToInclude "table1", "table2", "table3" `
-TableLevelSharingPropertyExternalTablesToExclude "Logs*" `
-ErrorAction Stop
使用 Azure Resource Manager 範本附加資料庫
你可以使用 Azure Resource Manager 模板將資料庫附加到現有叢集上。
使用下列步驟附加資料庫:
使用下表中的資訊建立範本,以協助您進行設定。
|
參數 |
說明 |
範例 |
|
followerClusterName |
追蹤者叢集的名稱;部署範本的位置。 |
|
|
已附加資料庫配置名稱 |
附加資料庫組態物件的名稱。 名稱可以是叢集層級唯一的任何字串。 |
|
|
databaseName |
要追蹤的資料庫名稱。 若要遵循所有領導者的資料庫,請使用 『*』。 |
|
|
leaderClusterResourceId |
領導者叢集的資源標識碼。 |
|
|
defaultPrincipalsModificationKind |
默認主要修改類型。 |
可以是 Union、Replace 或 None。 如需默認主體修改種類的詳細資訊,請參閱 主體修改種類管理命令。 |
|
包含的表格 |
要包含的數據表清單。 若要包含以 『Logs』 開頭的所有數據表,請使用 [“Logs*”]。 |
["table1ToInclude", "table2ToInclude"] |
|
要排除的表格 |
要排除的數據表清單。 若要排除所有數據表,請使用 [“*”]。 |
["table1ToExclude", "table2ToExclude"] |
|
要包含的外部表格 |
要包含的數據表清單。 若要包含以 『Logs』 開頭的所有外部數據表,請使用 [“Logs*”]。 |
["ExternalTable1ToInclude", "ExternalTable2ToInclude"] |
|
外部表格排除 |
要排除的數據表清單。 若要排除所有外部數據表,請使用 [“*”]。 |
["ExternalTable1ToExclude", "ExternalTable2ToExclude"] |
|
materializedViewsToInclude(使用的物化视图) |
要包含的具體化視圖清單。 若要包含以 『Logs』 開頭的所有具體化檢視,請使用 [“Logs*”]。 |
["Mv1ToInclude", "Mv2ToInclude"] |
|
要排除的物化視圖 |
要排除的具體化檢視清單。 若要排除所有具體化檢視,請使用 [“*”]。 |
["Mv11ToExclude", "Mv22ToExclude"] |
|
要包含的功能 |
要包含的函式清單。 |
["FunctionToInclude"] |
|
排除功能 |
函數排除清單。 |
["FunctionToExclude"] |
|
位置 |
所有資源的位置。 領導者和追蹤者必須位於相同的位置。 |
|
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"followerClusterName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Name of the cluster to which the database will be attached."
}
},
"attachedDatabaseConfigurationsName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Name of the attached database configurations to create."
}
},
"databaseName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The name of the database to follow. You can follow all databases by using '*'."
}
},
"leaderClusterResourceId": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The resource ID of the leader cluster."
}
},
"defaultPrincipalsModificationKind": {
"type": "string",
"defaultValue": "Union",
"metadata": {
"description": "The default principal modification kind."
}
},
"tablesToInclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of tables to include. Not supported when following all databases."
}
},
"tablesToExclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of tables to exclude. Not supported when following all databases."
}
},
"externalTablesToInclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of external tables to include. Not supported when following all databases."
}
},
"externalTablesToExclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of external tables to exclude. Not supported when following all databases."
}
},
"materializedViewsToInclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of materialized views to include. Not supported when following all databases."
}
},
"materializedViewsToExclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of materialized views to exclude. Not supported when following all databases."
}
},
"functionsToInclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of functions to include."
}
},
"functionsToExclude": {
"type": "array",
"defaultValue": [],
"metadata": {
"description": "The list of functions to exclude."
}
},
"location": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Location for all resources."
}
}
},
"variables": {},
"resources": [
{
"name": "[concat(parameters('followerClusterName'), '/', parameters('attachedDatabaseConfigurationsName'))]",
"type": "Microsoft.Kusto/clusters/attachedDatabaseConfigurations",
"apiVersion": "2021-01-01",
"location": "[parameters('location')]",
"properties": {
"databaseName": "[parameters('databaseName')]",
"clusterResourceId": "[parameters('leaderClusterResourceId')]",
"defaultPrincipalsModificationKind": "[parameters('defaultPrincipalsModificationKind')]",
"tableLevelSharingProperties":{
"tablesToInclude": "[parameters('tablesToInclude')]",
"tablesToExclude": "[parameters('tablesToExclude')]",
"externalTablesToInclude": "[parameters('externalTablesToInclude')]",
"externalTablesToExclude": "[parameters('externalTablesToExclude')]",
"materializedViewsToInclude": "[parameters('materializedViewsToInclude')]",
"materializedViewsToExclude": "[parameters('materializedViewsToExclude')]",
"functionsToInclude": "[parameters('functionsToInclude')]",
"functionsToExclude": "[parameters('functionsToExclude')]"
}
}
}
]
}
使用 Azure portal 或 PowerShell 部署 Azure Resource Manager 範本。
確認資料庫已成功附加
要確認資料庫是否成功連結,請在 Azure 入口網站 找到你已連結的資料庫。 您可以確認資料庫已成功附加在 追蹤者 或 領導者 叢集中。
**
查看您的粉絲群組
流覽至追蹤叢集,然後選取 [ 資料庫]。
在資料庫清單中,搜尋新的唯讀資料庫。
您也可以在資料庫概觀頁面中檢視此清單:
檢查您的領導者叢集
瀏覽至領導者叢集,然後選取 [ 資料庫]
檢查相關資料庫是否標示為 [與其他人>共用] 是
切換關聯性連結以檢視詳細數據。
您也可以在資料庫概觀頁面中檢視此專案:
分離從屬資料庫
注意
若要從追隨者或領導者角色卸離資料庫,您必須擁有使用者、群組、服務主體或受管識別,且在您要卸離資料庫的叢集上至少具有貢獻者角色。 在下列範例中,我們使用服務主體。
使用 C# 將附加的追蹤者資料庫與追蹤者叢集中斷連結
追蹤者叢集可以中斷連結任何附加的追蹤者資料庫,如下所示:
var attachedDatabaseConfigurationId = KustoAttachedDatabaseConfigurationResource.CreateResourceIdentifier(
subscriptionId: "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx", resourceGroupName: "testrg", clusterName: "follower",
attachedDatabaseConfigurationName: "attachedDatabaseConfiguration");
var credentials = new ManagedIdentityCredential();
var resourceManagementClient = new ArmClient(credentials);
var attachedDatabaseConfiguration = resourceManagementClient.GetKustoAttachedDatabaseConfigurationResource(attachedDatabaseConfigurationId);
await attachedDatabaseConfiguration.DeleteAsync(WaitUntil.Completed);
使用 C# 將附加的從屬資料庫從主伺服器集群中分離
主叢集可以卸載任何附加的資料庫,如下所示:
var leaderClusterId = KustoClusterResource.CreateResourceIdentifier(subscriptionId: "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx", resourceGroupName: "testrg", clusterName: "leader");
var followerClusterId = KustoClusterResource.CreateResourceIdentifier(subscriptionId: "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx", resourceGroupName: "followerResourceGroup", clusterName: "follower");
var followerDatabaseDefinition = new KustoFollowerDatabaseDefinition(
clusterResourceId: followerClusterId,
attachedDatabaseConfigurationName: "attachedDatabaseConfiguration"
);
var credentials = new ManagedIdentityCredential();
var resourceManagementClient = new ArmClient(credentials);
var leaderCluster = resourceManagementClient.GetKustoClusterResource(leaderClusterId);
await leaderCluster.DetachFollowerDatabasesAsync(WaitUntil.Completed, followerDatabaseDefinition);
使用 Python 將附加的跟隨者資料庫從跟隨者叢集中分離
追蹤者集群可以卸除任何已連結的資料庫,如下所示:
from azure.mgmt.kusto import KustoManagementClient
from azure.common.credentials import ServicePrincipalCredentials
import datetime
#Directory (tenant) ID
tenant_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
#Application ID
client_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
#Client Secret
client_secret = "xxxxxxxxxxxxxx"
follower_subscription_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
credentials = ServicePrincipalCredentials(
client_id=client_id,
secret=client_secret,
tenant=tenant_id
)
kusto_management_client = KustoManagementClient(credentials, follower_subscription_id)
follower_resource_group_name = "followerResourceGroup"
follower_cluster_name = "follower"
attached_database_configurationName = "uniqueName"
#Returns an instance of LROPoller, see https://learn.microsoft.com/python/api/msrest/msrest.polling.lropoller?view=azure-python
poller = kusto_management_client.attached_database_configurations.delete(follower_resource_group_name, follower_cluster_name, attached_database_configurationName)
使用 Python 將附加的跟隨者資料庫從領導者叢集中分離
主控叢集可以卸載任何已連接的資料庫,如下所示:
from azure.mgmt.kusto import KustoManagementClient
from azure.mgmt.kusto.models import FollowerDatabaseDefinition
from azure.common.credentials import ServicePrincipalCredentials
import datetime
#Directory (tenant) ID
tenant_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
#Application ID
client_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
#Client Secret
client_secret = "xxxxxxxxxxxxxx"
follower_subscription_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
leader_subscription_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
credentials = ServicePrincipalCredentials(
client_id=client_id,
secret=client_secret,
tenant=tenant_id
)
kusto_management_client = KustoManagementClient(credentials, follower_subscription_id)
follower_resource_group_name = "followerResourceGroup"
leader_resource_group_name = "leaderResourceGroup"
follower_cluster_name = "follower"
leader_cluster_name = "leader"
attached_database_configuration_name = "uniqueName"
location = "North Central US"
cluster_resource_id = "/subscriptions/" + follower_subscription_id + "/resourceGroups/" + follower_resource_group_name + "/providers/Microsoft.Kusto/Clusters/" + follower_cluster_name
#Returns an instance of LROPoller, see https://learn.microsoft.com/python/api/msrest/msrest.polling.lropoller?view=azure-python
poller = kusto_management_client.clusters.detach_follower_databases(resource_group_name = leader_resource_group_name, cluster_name = leader_cluster_name, cluster_resource_id = cluster_resource_id, attached_database_configuration_name = attached_database_configuration_name)
使用 PowerShell 分離資料庫
必要條件模組
Install : Az.Kusto
範例
$FollowerClustername = 'follower'
$FollowerClusterSubscriptionID = 'xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx'
$FollowerResourceGroupName = 'followerResourceGroup'
$DatabaseName = "sanjn" ## Can be specific database name or * for all databases
##Construct the Configuration name
$confignameraw = (Get-AzKustoAttachedDatabaseConfiguration -ClusterName $FollowerClustername -ResourceGroupName $FollowerResourceGroupName -SubscriptionId $FollowerClusterSubscriptionID) | Where-Object {$_.DatabaseName -eq $DatabaseName }
$configname =$confignameraw.Name.Split("/")[1]
Remove-AzKustoAttachedDatabaseConfiguration -ClusterName $FollowerClustername -Name $configname -ResourceGroupName $FollowerResourceGroupName -SubscriptionId $FollowerClusterSubscriptionID
管理主體、許可權和快取原則
管理主體
附加資料庫時,請指定 「預設主體修改種類」。 預設值是將覆寫的授權主體與授權主體的資料庫集合結合在一起。
|
類型 |
說明 |
|
聯盟 |
附加的資料庫主體一律會包含原始資料庫主體,以及新增至追蹤資料庫的其他新主體。 |
|
取代 |
原始資料庫的使用者或角色無法被繼承。 您必須為附加的資料庫建立新的主體。 |
|
沒有 |
附加的資料庫主體只包含原始資料庫的主體,沒有其他主體。 |
如需使用管理命令來設定授權主體的詳細資訊,請參閱 管理命令來管理追蹤者叢集。
管理權限
管理唯讀資料庫許可權與所有資料庫類型的許可權相同。 關於權限分配,請參見Azure入口網站<>中的 管理資料庫權限或使用管理指令管理資料庫安全角色。
下列資料庫管理員可以修改 附加資料庫的快取原則 ,或裝載叢集上任何數據表的快取原則。 預設值是將領導者叢集資料庫和數據表層級快取原則中的源資料庫與資料庫和數據表層級覆寫原則中定義的原則結合在一起。 例如,您可以在主資料庫上設定 30 天快取原則,用於執行每月報告,在從資料庫上設定三天快取原則,只查詢最近的數據以進行疑難排解。 如需使用管理命令在追蹤資料庫或資料表上設定快取原則的詳細資訊,請參閱 用於管理追蹤者叢集的管理命令。
備註
檢閱下列附註:
- 如果領導者/追蹤者叢集的資料庫之間發生衝突,當所有資料庫被追蹤者叢集追蹤時,衝突會這樣解決:
- 在追蹤者叢集上建立名為 DB 的資料庫優先於在領導者叢集上建立的相同名稱的資料庫。 這就是為什麼追蹤叢集中的資料庫 DB 必須移除或重新命名,讓追蹤者叢集包含領導者的資料庫 DB。
- 兩個或多個主導叢集的資料庫 DB 將會隨機從其中一個主導叢集中選擇,且不會被追蹤超過一次。
- 顯示追蹤 叢集上執行叢集活動記錄和歷程記錄 的命令會顯示追蹤者叢集上的活動和歷程記錄,而其結果集不包含領導者叢集或叢集的結果。
- 例如:
.show queries 在追蹤者叢集上執行的命令,只會顯示在追蹤者叢集追蹤的資料庫中執行的查詢,而不會顯示在領導叢集中的相同資料庫上執行的查詢。
限制
查看下列限制條件:
- 追蹤者和領導者叢集必須位於相同的區域中。
- 如果在被追蹤的資料庫上使用串流擷取,則應在追蹤叢集上啟用串流擷取功能,以便追蹤串流擷取數據。
- 支援使用客戶管理金鑰(CMK)進行資料加密的叢集具有以下限制:
- 追蹤者叢集或領導者叢集未追蹤其他叢集。
- 如果追蹤者叢集追蹤已啟用 CMK 的領導者叢集,且領導者對密鑰的存取權被撤銷,則領導者和追蹤者叢集都會暫停。 在此情況下,您可以解決 CMK 問題,然後繼續追蹤者叢集,或者將追蹤者資料庫從追蹤者叢集卸離,並獨立於領導者叢集來繼續操作。
- 在卸離資料庫之前,您無法刪除附加至不同叢集的資料庫。
- 您無法刪除一個已連結到其他叢集的資料庫而不先將其卸離的叢集。
- 在追蹤所有資料庫時,不支援數據表層級共用屬性。
- 在追蹤資料庫中,若要查詢使用受控識別做為驗證方法的外部數據表,必須將受控識別新增至追蹤者叢集。 當領導者和追蹤者叢集布建在不同的租使用者中時,這項功能將無法運作。
- 你無法將查詢結果儲存在只讀追蹤的資料庫中。
後續步驟