PolyBase 錯誤和可能的解決方案

適用於:SQL Server

本文提供 PolyBase 的常見錯誤案例和解決方案。

如需監視 PolyBase 和疑難排解的詳細資訊,請參閱監視和疑難排解 PolyBase

如需了解 Windows 和 Linux 中常見的 PolyBase 記錄檔位置,請參閱監視和疑難排解 PolyBase

錯誤訊息與可能的解決方案

SQL Server 2022 更新因資料行名稱無效而失敗(區分大小寫)

在已安裝 PolyBase 功能且使用區分大小寫定序的伺服器上套用 SQL Server 累積更新安裝時,可能會發生此錯誤,回報的錯誤升級訊息如下:

錯誤訊息範例:Error: 912, Severity: 21, State: 2. Script level upgrade for database 'master' failed because upgrade step 'polybase_database_upgrade.sql' encountered error 200, state 7, severity 25. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the 'master' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.

原因:

升級程式期間,程序 SQL Server 腳本會因為區分大小寫的值而成功完成。

解決方案:此問題將會在即將推出的累積更新中永久修正。

因應措施

  1. 啟用追蹤旗標 902。
  2. 啟動 SQL Server。
  3. 將資料庫 'DWConfiguration' 的定序從 CS(區分大小寫)變更為 CI(不區分大小寫)。
  4. 執行升級
  5. 停用追蹤旗標 902。
  6. 重新啟動 SQL Server。
  7. 將資料庫 'DWConfiguration' 的定序從 CI(不區分大小寫)變更為 CS(區分大小寫)。

作為追蹤旗標的替代方案,若要防止在累積更新之前發生問題,請檢查 「DWConfiguration」 資料庫是否使用區分大小寫的定序 (CS) 定序。 請考慮將它變更為不區分大小寫的定序、套用累積更新、將其變更回原始。

Error: "100001;Failed to generate query plan"

當 SQL Server 資料庫引擎藉由修補檔達到至少累積更新 8 (15.0.4073),但 PolyBase 功能尚未更新為相同組建時,就有可能發生「無法產生查詢計畫」錯誤。 將 PolyBase 功能新增至現有的 SQL Server 執行個體時,可能會發生這種情況。 如需詳細資訊,請參閱 PolyBase 錯誤 - 100001;無法產生查詢計畫

請依更新時程安裝最新版本的 PolyBase 功能,將新功能提升至相同的版本層級。 視需要安裝 Service Pack (SP)、累積更新 (CU),以及/或一般發行版本 (GDR)。 若要判斷 PolyBase 的版本,請參閱判斷 SQL Server 及其元件的版本、版次和更新層級

服務帳戶變更

錯誤訊息範例:

107035;Dms 授權失敗,因為 [DOMAIN\user] 不是群組 [PdwDataMovementAccess] 的成員
107017;Invalid DMS control header:

此錯誤可能是變更 PolyBase 服務帳戶所致。 若要變更 PolyBase 引擎和 PolyBase 資料移動服務的服務帳戶,請解除安裝並重新安裝 PolyBase 功能。

資料移動服務權限錯誤

如需疑難排解及解決資料移動服務權限問題的詳細資訊,請參閱 PolyBase 服務帳戶權限和缺少權限時的常見錯誤

Windows 驗證失敗

如需疑難排解及解決 Windows 驗證失敗的相關權限問題,請參閱 PolyBase 服務帳戶權限和缺少權限時的常見錯誤

無法執行「遠端查詢」查詢作業

錯誤訊息範例:

Msg 7320, Level 16, State 110, Line 14
Cannot execute the query "Remote Query" against OLE DB provider "SQLNCLI11" for linked server "(null)". Query aborted-- the maximum reject threshold (0 rows) was reached while reading from an external source: 1 rows rejected out of total 1 rows processed. (/nation/sensors.ldjson.txt)Column ordinal: 0, Expected data type: INT, Offending value: {"id":"S2740036465E2B","time":"2016-02-26T16:59:02.9300000Z","temp":23.3,"hum":0.77,"wind":17,"press":1032,"loc":[-76.90914996169623,38.8929314364726]} (Column Conversion Error), Error: Error converting data type NVARCHAR to INT.

請記住,此錯誤可能會衍生其他問題。 第一個遭到拒絕的檔案會顯示於 SQL Server Management Studio (SSMS),畫面上會一併標示不符規定的資料類型或值。

可能原因:
發生此錯誤的原因是每個檔案的結構描述不同。 指向目錄時,PolyBase 外部表格 DDL 以遞迴方式讀取該目錄中的所有檔案。 當資料行或資料類型不符,SSMS 就會顯示這項錯誤。

可能的解決方案:
如果每個資料表的資料都是由一個檔案組成,請使用 LOCATION 區段提供的檔案名稱,並在前面加上外部檔案的目錄。 如果每個資料表都有多個檔案,請將每個檔案集放到 Azure Blob 儲存體的不同目錄。 將 LOCATION 指向目錄,而不是特定檔案。 建議使用此解決方案。

範例︰

Create External Table foo
(col1 int)WITH (LOCATION='/bar/foobar.txt',DATA_SOURCE…); OR
Create External Table foo
(col1 int) WITH (LOCATION = '/bar/', DATA_SOURCE…);

注意

SQL Server Native Client (通常縮寫為 SNAC) 已從 SQL Server 2022 (16.x) 和 SQL Server Management Studio 19 (SSMS) 中移除。 不建議使用 SQL Server Native Client (SQLNCLI 或 SQLNCLI11) 和舊版 Microsoft OLE DB Provider for SQL Server (SQLOLEDB) 開發新的應用程式。 往後請改用新的 Microsoft OLE DB Driver (MSOLEDBSQL) for SQL Server 或最新的 Microsoft ODBC Driver for SQL Server。 針對 SQL Server 資料庫引擎 (2012 到 2019 版) 的隨附元件 SQLNCLI,請參閱支援生命週期例外狀況

Kerberos 支援

SQL Server 已設定為存取支援的 Hadoop 叢集。 Hadoop 叢集中不會強制執行 Kerberos 安全防護機制。

從外部表格選取的話,系統會傳回下列錯誤:

Msg 105019, Level 16, State 1, Line 55
EXTERNAL TABLE access failed due to internal error: 'Java exception raised on call to HdfsBridge_Connect: Error [Unable to instantiate LoginClass] occurred while accessing external file.'
Msg 7320, Level 16, State 110, Line 55
Cannot execute the query "Remote Query" against OLE DB provider "SQLNCLI11" for linked server "(null)". EXTERNAL TABLE access failed due to internal error: 'Java exception raised on call to HdfsBridge_Connect: Error [Unable to instantiate LoginClass] occurred while accessing external file.'

如果執行 DWEngine 伺服器記錄訊問程序,系統會顯示下列錯誤:

[Thread:16432] [EngineInstrumentation:EngineQueryErrorEvent] (Error, High):
EXTERNAL TABLE access failed due to internal error: 'Java exception raised on call to HdfsBridge_Connect: Error [com.microsoft.polybase.client.KerberosSecureLogin] occurred while accessing external file.' Microsoft.SqlServer.DataWarehouse.Common.ErrorHandling.MppSqlException: EXTERNAL TABLE access failed due to internal error: 'Java exception raised on call to HdfsBridge_Connect: Error [com.microsoft.polybase.client.KerberosSecureLogin] occurred while accessing external file.' ---> Microsoft.SqlServer.DataWarehouse.DataMovement.Common.ExternalAccess.HdfsAccessException: Java exception raised on call to HdfsBridge_Connect: Error [com.microsoft.polybase.client.KerberosSecureLogin] occurred while accessing external file.

可能原因:
Hadoop 叢集中尚未啟用 Kerberos,但 core-site.xml、yarn-site.xml 或預設位於 Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn\PolyBase\Hadoop\conf 底下的 hdfs-site.xml 已啟用 Kerberos 安全防護機制。 在 Linux 中,這些檔案的預設位置為 /var/opt/mssql/binn/polybase/hadoop/conf/。

可能的解決方案:
將上述檔案中的 Kerberos 安全防護資訊註解化。

如需 PolyBase 和 Kerberos 疑難排解的詳細資訊,請參閱 PolyBase Kerberos 連線問題疑難排解

內部查詢處理器錯誤

查詢外部表格時,系統傳回下列錯誤:

Msg 8680, Level 17, State 5, Line 118
內部查詢處理器錯誤:查詢處理器在處理遠端查詢階段時發現意外的錯誤。

The DWEngine server log contains the following messages:

[Thread:5216] [ControlNodeMessenger:ErrorEvent] (Error, High): ***** DMS System has disconnected nodes :
[Thread:5216] [ControlNodeMessenger:ErrorEvent] (Error, High): ***** DMS System has disconnected nodes :
[Thread:5216] [ControlNodeMessenger:ErrorEvent] (Error, High): ***** DMS System has disconnected nodes :

可能原因:
發生此錯誤的原因可能是在設定 PolyBase 後,未將 SQL Server 重新開機。

可能的解決方案:
重新啟動 SQL Server。 檢查 DWEngine 伺服器記錄,確認重新開機之後沒有出現 DMS 連線中斷的現象。

存取 HDFS 需要有使用者

案例:
SQL Server 連線到不安全的 Hadoop 叢集 (未啟用 Kerberos)。 PolyBase 的設定是將計算推送至 Hadoop 叢集。

範例查詢:

select count(*) from foo WITH (FORCE EXTERNALPUSHDOWN);

系統傳回類似以下內容的錯誤訊息:

Msg 105019, Level 16, State 1, Line 1
EXTERNAL TABLE access failed due to internal error: 'Java exception raised on call to JobSubmitter_PollJobStatus: Error [java.net.ConnectException: Call From big1506sql2016/172.16.1.4 to 0.0.0.0:10020 failed on connection exception: java.net ConnectException: Connection refused: no further information; For more information, see: http://wiki.apache.org/hadoop/ConnectionRefused] occurred while accessing external file.'
OLE DB provider "SQLNCLI11" for linked server "(null)" returned message "Unspecified error".
Msg 7421, Level 16, State 2, Line 1
Cannot fetch the rowset from OLE DB provider "SQLNCLI11" for linked server "(null)". .

Hadoop Yarn 記錄錯誤:

Job setup failed : org.apache.hadoop.security.AccessControlException: Permission denied: user=pdw_user, access=WRITE, inode="/user":hdfs:hdfs:drwxr-xr-x at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkFsPermission(FSPermissionChecker.java:265) at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPermissionChecker.java:251) at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPermissionChecker.java:232) org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermission(FSPermissionChecker.java:176) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkPermission(FSNamesystem.java:5525)

可能原因:
在停用 Kerberos 的情況下,PolyBase 會使用 pdw_user 作為存取 HDFS 及提交 MapReduce 作業的使用者。

可能的解決方案:
在 Hadoop 上建立 pdw_user,並給予其在 MapReduce 處理期間存取所用目錄的充足權限。 此外,請確認 pdw_user 是 /user/pdw_user HDFS 目錄的擁有者。

建立主目錄及為 pdw_user 指派權限的範例如下:

sudo -u hdfs hadoop fs -mkdir /user/pdw_user
sudo -u hdfs hadoop fs -chown pdw_user /user/pdw_user

接著,請確認 pdw_user 具有 /user/pdw_user 目錄的讀取、寫入和執行權限, 並確定 /tmp 目錄具有 777 個權限。

如需 PolyBase 和 Kerberos 疑難排解的詳細資訊,請參閱 PolyBase Kerberos 連線問題疑難排解

UTF-8 造成 Java 記憶體錯誤

案例:
SQL Server PolyBase 需使用 Hadoop 叢集或 Azure Blob 儲存體來設定。 任何 Select 查詢作業執行失敗時,系統就會傳回下列錯誤:

Msg 106000, Level 16, State 1, Line 1
Java 堆積空間

可能原因:
輸入不當可能會導致 Java 記憶體不足而收到錯誤訊息。 檔案可能不是 UTF-8 格式。 DMS 無法解碼資料列分隔符號,並發生 Java 堆積空間錯誤,因此嘗試將整個檔案讀取為單一資料列。

可能的解決方案:
將檔案轉換成 UTF-8 格式,因為目前 PolyBase 使用的文字分隔檔案均需採用 UTF-8 格式。

Hadoop 連線設定

設定 SQL Server PolyBase 以連線至 Azure Blob 儲存體時,SQL Server 會傳回下列錯誤訊息:

Msg 105019, Level 16, State 1, Line 74
EXTERNAL TABLE access failed due to internal error: 'Java exception raised on call to HdfsBridge_Connect: Error [No FileSystem for scheme: wasbs] occurred while accessing external file.'

可能原因:
Hadoop 連線未設定為存取 Azure Blob 儲存體所需的組態值。

可能的解決方案:
將 Hadoop 連線設定為支援 Azure Blob 儲存體及重新啟動 SQL Server 的值 (最好是設為 7)。 如需連線值和支援類型清單,請參閱 PolyBase 連線設定

Create Table As Select 錯誤

案例:
嘗試使用 PolyBase 搭配 CREATE EXTERNAL TABLE AS SELECT (CETAS) 語法從 SQL Server 將資料匯出至 Azure Blob 儲存體或 Hadoop 檔案系統失敗,系統顯示下列錯誤訊息:

Msg 156, Level 15, State 1, Line 177
Incorrect syntax near the keyword 'WITH'.
Msg 319, Level 15, State 1, Line 177
關鍵字 'with' 附近的語法不正確。 如果這個陳述式是一般資料表運算式、xmlnamespaces 子句或變更追蹤內容子句,則前一個陳述式必須以分號結束。

可能原因:
當透過 PolyBase 將檔案匯出到 Hadoop 或 Azure Blob 儲存體時,會如 CREATE EXTERNAL TABLE 命令中所定義,只有資料會被匯出,而不含資料行名稱 (中繼資料)。

可能的解決方案:
先建立外部表格,然後使用 INSERT INTO SELECT 匯出至外部位置。 如需範例程式碼,請參閱 PolyBase 查詢案例

從 Azure Blob 儲存體建立外部表格失敗

案例:
專用 SQL 集區 (先前稱為 SQL DW) 已設定為從 Azure Blob 儲存體匯入資料。 外部表格建立失敗,系統顯示下列訊息。

Msg 105019, Level 16, State 1, Line 34
External TABLE access failed due to internal error: 'Java exception raised on call to HdfsBridge_IsDirExist. Java exception message:com.microsoft.azure.storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.: Error [com.microsoft.azure.storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.] occurred while accessing external file.'

可能原因:
使用錯誤的 Azure 儲存體金鑰來建立資料庫範圍認證。

可能的解決方案:
卸除所有相關物件 (亦即資料來源、檔案格式),然後使用正確的儲存金鑰,卸除並重新建立資料庫範圍認證。

Kerberos 設定大寫

案例:
SQL Server 已透過啟用了 Kerberos 的 Cloudera 叢集完成設定。 所有設定完成變更後,SQL Server 已重新開機。 PolyBase 引擎和 PolyBase 資料移動服務在重新開機後已順利執行。 系統傳回下列錯誤訊息:

資料來源未設定作業追蹤器位置:

org.apache.hadoop.fs.FileSystem: Provider org.apache.hadoop.fs.viewfs.ViewFileSystem could not be instantiated

資料來源已設定作業追蹤器位置:

Error [Can't get Kerberos realm] occurred while accessing external file

可能原因:
Coresite.xml 中,"hadoop.security.authentication" 屬性的值為 kerberos。

可能的解決方案:
Coresite.xml 的 "hadoop.security.authentication" 屬性值應該要是 KERBEROS (全部大寫)。

如需 PolyBase 和 Kerberos 疑難排解的詳細資訊,請參閱 PolyBase Kerberos 連線問題疑難排解

Mapred-site.xml 遺漏所需的值

案例:
SQL Server 或 APS 已使用支援的 HDP 叢集完成設定。 查詢作業不要求下推工作,但執行失敗並傳回以下訊息,其中下列錯誤訊息中使用了 'FORCE PUSHDOWN' 提示:

Msg 7320, Level 16, State 110, Line 35
Cannot execute the query "Remote Query" against OLE DB provider "SQLNCLI11" for linked server "(null)". EXTERNAL TABLE access failed due to internal error: 'Java exception raised on call to JobSubmitter_PollJobStatus: Error [org.apache.hadoop.ipc.RemoteException(java.lang.NullPointerException): java.lang.NullPointerException
at org.apache.hadoop.mapreduce.v2.hs.HistoryClientService$HSClientProtocolHandler.getTaskAttemptCompletionEvents(HistoryClientService.java:277)
at org.apache.hadoop.mapreduce.v2.api.impl.pb.service.MRClientProtocolPBServiceImpl.getTaskAttemptCompletionEvents(MRClientProtocolPBServiceImpl.java:173)
at org.apache.hadoop.yarn.proto.MRClientProtocol$MRClientProtocolService$2.callBlockingMethod(MRClientProtocol.java:283)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:619)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:962)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2127)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2123)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2121)
] occurred while accessing external file.'

可能原因:
Mapred-site.xml 遺漏幾個檢查中繼和最終結果所需的值。

可能的解決方案:
當 SQL Server 的 mapred-site.xml 檔案 Ambari 上顯示 Mapred-site.xml 時,新增下列屬性,並與正確的值建立關聯。

<property>
<name>yarn.app.mapreduce.am.staging-dir</name>
<value>/user</value>
</property>
<property>
<name>mapreduce.jobhistory.done-dir</name>
<value>/mr-history/done</value>
</property>
<property>
<name>mapreduce.jobhistory.intermediate-done-dir</name>
<value>/mr-history/tmp</value>
</property>

依主機名稱設定存取權

案例:
SQL Server 設定為存取支援的 Hadoop 叢集。 建立外部表格時,系統傳回下列任一錯誤:

Cannot execute the query "Remote Query" against OLE DB provider "SQLNCLI11" for linked server "(null)". 110802;An internal DMS error occurred that caused this operation to fail. Details: Exception: Microsoft.SqlServer.DataWarehouse.DataMovement.Workers.DmsSqlNativeException, Message: SqlNativeBufferReader.Run, error in OdbcExecuteQuery: SqlState: 42000, NativeError: 8680, 'Error calling: SQLExecDirect(this->GetHstmt(), (SQLWCHAR *)statementText, SQL_NTS), SQL return code: -1 | SQL Error Info: SrvrMsgState: 26, SrvrSeverity: 17, Error <1>: ErrorMsg: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Internal Query Processor Error: The query processor encountered an unexpected error during the processing of a remote query phase. | Error calling: pReadConn->ExecuteQuery(statementText, bufferFormat) | state: FFFF, number: 24, active connections: 8', Connection String: Driver={pdwodbc};APP=RCSmall-DmsNativeReader:WAD1D16HD2001\mpdwsvc (3600)-ODBC-PoolId1433;Trusted_Connection=yes;AutoTranslate=no;Server=\.\pipe\sql\query

[Thread:30544] [AbstractReaderWorker:ErrorEvent] (Error, High): QueryId QID2433 PlanId 6c3a4551-e54c-4c06-a5ed-a8733edac691 StepId 7:
Could not obtain block: BP-1726738607-192.168.225.121-1443123675290:blk_1159687047_86196509 file=/user/hive/warehouse/u_data/000000_0
Microsoft.SqlServer.DataWarehouse.Common.ErrorHandling.MppSqlException: Could not obtain block: BP-1726738607-192.168.225.121-1443123675290:blk_1159687047_86196509 file=/user/hive/warehouse/u_data/000000_0
at Microsoft.SqlServer.DataWarehouse.DataMovement.Common.ExternalAccess.HdfsBridgeReadAccess.Read(MemoryBuffer buffer, Boolean& isDone)
at Microsoft.SqlServer.DataWarehouse.DataMovement.Workers.DataReader.ExternalMoveBufferReader.Read()
at Microsoft.SqlServer.DataWarehouse.DataMovement.Workers.ExternalMoveReaderWorker.ReadAndSendData()
at Microsoft.SqlServer.DataWarehouse.DataMovement.Workers.ExternalMoveReaderWorker.Execute(Object status)

可能原因:
如果組態中對 Hadoop 叢集的設定,限制只能使用主機名稱 (而不是 IP 位址) 從叢集外部存取資料節點,系統就可能會顯示此錯誤訊息。

可能的解決方案:
將下列內容新增至用戶端 (SQL Server 端) 的 hdfs-site.xml 檔案。 此設定會強制名稱節點傳回資料節點的 URI,並附上主機名稱而不是內部 IP 位址。

<property>
<name>dfs.client.use.datanode.hostname</name>
<value>true</value>
</property>

資料夾組織強制執行大量的記憶體負荷

案例:
SQL Server 對具有大量檔案的目錄 (目錄路徑底下以遞迴方式存在的檔案 >30,000 個) 執行 PolyBase 查詢作業,系統傳回以下任一錯誤訊息:

Msg 105019, Level 16, State 1, Line 1
EXTERNAL TABLE access failed due to internal error: 'Java exception raised on call to HdfsBridge_GetFileNameByIndex. Java exception message: GC overhead limit exceeded: Error [GC overhead limit exceeded] occurred while accessing external file.'

Msg 105019, Level 16, State 1, Line 1
EXTERNAL TABLE access failed due to internal error: 'Java exception raised on call to HdfsBridge_GetDirectoryFiles. Java exception message: Java heap space: Error [Java heap space] occurred while accessing external file.'

可能原因:
處理路徑時,PolyBase 會列舉該路徑底下的所有檔案,而表示檔案所使用的資料結構具有相關聯的固定記憶體負荷。 存在大量檔案時,此負荷會變得相當顯著,而且最終會耗盡 JVM 可用的所有記憶體。

可能的解決方案:
重新排列多個目錄中的資料,使每個目錄中都包含檔案的子集,然後將原本要在部分原始路徑上一次運作的查詢拆分成多個查詢,並將資料表具體化為 SQL Server 資料表 (之後再將這些資料表聯結起來)。

範例:假設您的外部表格資料位於下列位置:Orders/file1.txt,...,file30K.txt。

變更版面配置,讓資料採取 Orders/yyyy/mm/dd/file1.txt 的傳統檔案分割結構呈現。 將您的外部表格指向較低的目錄路徑 (例如 month (mm) 或 day (dd)),並將檔案分開匯入 SQL Server 資料表,然後以單一資料表的形式新增這些檔案。 即使一開始您擁有正確的目錄結構,仍請依循步驟 2 操作,如此雖然必須處理許多檔案,但不會耗盡所有 JVM 儲存體。

組態檔中的非預期字元

案例:
使用 Hadoop 叢集設定 SQL Server 或 APS 涉及修改 yarn-site.xml、hdfs-site.xml 和其他組態檔。 系統會顯示以下 SQL Server 錯誤訊息:

Msg 105019, Level 16, State 1, Line 1
Microsoft.SqlServer.DataWarehouse.Common.ErrorHandling.MppSqlException: EXTERNAL TABLE access failed due to internal error: 'Java exception raised on call to HdfsBridge_Connect. Java exception message:com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.: Error [com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.] occurred while accessing external file.' --->

可能原因:
如果您是從網站或聊天視窗複製文字並貼到組態檔中,就可能會發生這種情況。 組態檔中可能有不需要/不可列印的字元。

可能的解決方案:
在不同的文字編輯器中開啟檔案 (記事本除外),然後找到這些字元並加以刪除。 重新啟動必要的服務。

差異資料表查詢可能會失敗,錯誤 2571 和 16513

案例:
查詢外部 Delta 資料表時,可能會遇到下列錯誤:

Msg 2571, Level 14, State 3, Line 1
User '<user>' does not have permission to run DBCC TRACEON.
Msg 16513, Level 16, State 0, Line 1
Error reading external metadata.

可能原因:
這種情況可能會發生,因為有一個 QUERYTRACEON 查詢提示可以新增至 Delta 檔案中繼資料查詢,而且需要 sysadmin 伺服器角色才能執行。

可能的解決方案:
如果發生這種情況,可以藉由全域啟用追蹤旗標 14073 來解決此問題,這可防止新增查詢提示。

另請參閱