Oracle クエリの結果に基づいていくつかのタスクを実行する Powershell スクリプトがあります。
最近、ボックスをWin 8の新しいラップトップに交換しましたが、以前使用していたのと同じpowershellスクリプトを実行しようとすると、機能しません。
Powershell で次のエラー メッセージが表示されました。
Exception calling "Open" with "0" argument(s): "ORA-12154: TNS:could not resolve the connect identifier specified
"
At C:\Users\User1\Desktop\BatchRun\ESS-QUEUE.ps1:146 char:5
+ $connection.Open()
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : OracleException
Exception calling "ExecuteReader" with "0" argument(s): "Invalid operation. The connection is closed."
At C:\Users\User1\Desktop\BatchRun\ESS-QUEUE.ps1:147 char:5
+ $users = $command.ExecuteReader()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : InvalidOperationException
You cannot call a method on a null-valued expression.
At C:\Users\User1\Desktop\BatchRun\ESS-QUEUE.ps1:157 char:12
+ while ($users.Read()) {
+ ~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Oracle Client が欠落していることがわかったので、TOAD Express と Oracle Client 10R2 (32 および 64) を動作させることができました。つまり、実際には sqlplus.exe と TOAD を問題なく実行できます。
この問題を解決してスクリプトを再び機能させる方法を誰かに教えてもらえますか?