1

現在、OpenFileStream (SqlFileStream C# クラス内のプライベート メソッド) を使用しているライブ環境の 1 つで発生した問題を確認しています。

System.ComponentModel.Win32Exception (0x80004005): The system cannot find the path specified at System.Data.SqlTypes.SqlFileStream.OpenSqlFileStream(String path, Byte[] transactionContext, FileAccess access, FileOptions options, Int64 allocationSize)at System.Data.SqlTypes.SqlFileStream..ctor(String path, Byte[] transactionContext, FileAccess access, FileOptions options, Int64 allocationSize)at System.Data.SqlTypes.SqlFileStream..ctor(String path, Byte[] transactionContext, FileAccess access)

これは別の環境で問題なく動作しています。呼び出しに使用しているコードは次のとおりです。

using (SqlCommand command = new SqlCommand(insertFileSql, conn, transaction))
                {
                    string path = null;
                    byte[] context = null;
                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        reader.Read();
                        path = reader.GetString(reader.GetOrdinal("PathName"));
                        fileID = reader.GetGuid(reader.GetOrdinal("FileId"));
                        context = (byte[])reader[reader.GetOrdinal("Context")];
                    }

                    richTextBox1.AppendText(
                        string.Format("Path: {0}, FileID:{1}, content: {2}", path, fileID, Convert.ToString(context)));

                    using (SqlFileStream strm = new SqlFileStream(path, context, FileAccess.ReadWrite))
                    {
                        // copy the user file to the Filestream
                        inputFileStream.CopyTo(strm);
                    }

ポート/ファイアウォールを調べたところ、.Net ソース コード内で NtCreateFile が失敗していることがわかりました (値は 3221225530) が、その値またはIOStatusBlock から返された値に関するドキュメントが見つかりません。これは戻りパラメータの 1 つです。

\\v02-A60EC2F8-2B24-11DF-9CC3-AF2E56D89593\dbFileStore\dbo\tblFile\DataFile\AC50B769-B6F8-43AA-B266-E4E837D78BA0\VolumeHint-HarddiskDmVolumes\\SQLData

他に何か提案できるものはありますか?

乾杯、J

4

2 に答える 2

2

かなりの時間が経過しましたが、SQL Server 2012 では ReadWrite にこの問題がありました。Read は問題ありません。Write も問題ありませんが、ReadWrite のみです。

SQL Server 更新プログラムのインストール/アンインストール中に何かが発生したようです - レジストリ設定がセットアップによって誤って削除されます。.reg ファイルでそれを読む:

 Windows Registry Editor Version 5.00

 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\FsctlAllowlist]
 "FSCTL_SQL_FILESTREAM_FETCH_OLD_CONTENT"=dword:00092560
于 2016-03-01T11:19:19.300 に答える
0

SQL FileStream で動作していなかったのは Veritas Storage Foundation であることがわかりました。Windows API 呼び出しを実行するときに VSF に少し問題があるようです。

于 2013-02-23T20:44:22.533 に答える