DBD :: Oracle :: db DESTROY失败:ORA-03135:连接丢失联系

时间:2018-05-24 14:18:57

标签: oracle perl parallel-processing dbi

我正在尝试从一个数据库读取文件并将值更新到另一个数据库当我正在做一些事情而没有Parallel :: ForkManager它在另一方面正常工作时使用Parallel :: ForkManager我正在经历下面错误

错误:

Session ID: 271 Serial number: 28379 (DBD ERROR: OCISessionEnd) during global destruction.
DBD::Oracle::db DESTROY failed: ORA-03135: connection lost contact
Process ID: 0

代码:

use Parallel::ForkManager;  
$pm = Parallel::ForkManager->new(10);

$DB_CONN_ST = DBI->connect("dbi:Oracle:xxxx",xxxx,xxxx, {RaiseError => 1});

$STH_ST = $DB_CONN_ST->prepare("SELECT SUPP_OTLT_IDS,OTLT_PRF_IDS,PAY_FND_TYPE_CODE,CL_YR_MTH_NUMBER,DATA_DT FROM KUDA_TABLE WHERE DATA_DT>= '25-MAY-2018'");
$STH_ST->execute();
@row = $STH_ST->fetchrow_array();
$STH_ST->finish();
$DB_CONN_ST->disconnect();

INCREMENT:
while(($SUPP_OTLT_IDS,$OTLT_PRF_IDS,$PAY_FND_TYPE_CODE,$CL_YR_MTH_NUMBER,$DATA_DT) = @row) {
        $pm-> start and next INCREMENT;
        $SUPP_OTLT_IDS=sprintf("%07d",$SUPP_OTLT_IDS);
        $OTLT_PRF_IDS=sprintf("%02d",$OTLT_PRF_IDS);
        $CL_YR_MTH_NUMBER="M".$CL_YR_MTH_NUMBER;

        $DB_CONN_UD = DBI->connect("dbi:Oracle:xxxx",xxxx,xxxx, {RaiseError => 1});
        $STH_UD = $DB_CONN_UD->prepare("UPDATE JPRX_DETL SET UDA_PROC_STA_TS='$DATA_DT',UDA_PROC_STA_ID=1,UPD_TS=SYSTIMESTAMP WHERE PHA_OLET_CODE='$SUPP_OTLT_IDS' AND PHA_OLET_PREF_CODE='$OTLT_PRF_IDS' AND DAT_PAY_FUND_TYPE=$PAY_FND_TYPE_CODE AND DAT_FILE_MONTH='$CL_YR_MTH_NUMBER'");
        $STH_UD->execute();
        $DB_CONN_UD->disconnect;
        $pm->finish;
}
$pm->wait_all_children;

请建议我如何克服上述错误。

0 个答案:

没有答案