- 论坛徽章:
- 0
|
請問各位大大 當我下
$dbh = DBI->connect("DBI:Oracle:$alert_oracle{'oracle_sid'}","$alert_oracle{'oracle_login_name'}","$alert_oracle{'oracle_login_pwd'}");
die "Unable to connect: $DBI::errstr\n" unless (defined $dbh);
#$dbh = DBI->connect("DBI:Oracle:$alert_oracle{'oracle_sid'}","$alert_oracle{'oracle_login_name'}","$alert_oracle{'oracle_login_pwd'}",{RaiseError => 1});
$sql = qq{
SELECT COUNT(*) FROM V\$SESSION
};
$sth = $dbh->prepare( $sql );
$sth->execute();
my($GetUSERS_Num);
$sth->bind_columns(\$GetUSERS_Num);
while( $sth->fetch() ) {$GetUSERS_Num_A = $GetUSERS_Num;}
$sth->finish();
$dbh->disconnect();
這樣子的指令後
如果 網路斷掉 會跑出以下的訊息 然後程式就當了
如何的方式可以不讓他當掉 且會一直重新試連線
DBI connect('reas3','system',...) failed: ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory (DBD ERROR: OCISessionBegin) at ./Data
base_System/DBstatus/DBstatus_Linux.pl line 9
Unable to connect: ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory (DBD ERROR: OCISessionBegin)
多謝大大的指教
[[i] 本帖最后由 ieting 于 2006-3-17 13:46 编辑 [/i]] |
|