簡單測試Oracle連線的指令碼

2021-04-19 04:02:36 字數 878 閱讀 3128

#!/bin/perl

use dbi;

$dbname = "jsbss_test";

$user   = "oss";

$passwd = "as1a1nf0";

$dbh    = "";

$dbh    = dbi->connect( "dbi:oracle:$dbname", $user, $passwd )

or die "can't connect to oracle database: $dbi::errstr/n";

#******************************====

#選擇資料方法1--簡單sql

#******************************====

#連線資料庫

my $sth = $dbh->prepare("select table_name from user_tables where rownum < 10")

or die "can't prepare sql statement: $dbi::errstr/n";

$sth->execute or die "can't execute sql statement: $dbi::errstr/n";

#讀取記錄資料

while ( my @recs = $sth->fetchrow_array )

warn "data fetching terminated early by error: $dbi::errstr/n"

if $dbi::err;

}$dbh->disconnect or warn "disconnection failed: $dbi::errstr/n";

#斷開連線

exit 0;

ORACLE的左 右連線測試

用於測試的兩張表 select from user emp empno ename sal1 ben0133 5000.00 2liam 10000.00 5kipling 123.00 select from user email empno email 1ben0133 xx.com 3admi...

LR TCP 長連線測試指令碼設計

建立對應的tcp長連線指令碼 建立場景進行使用者併發,檢查服務端的效能情況 之前一直是建立web的介面效能指令碼,要想建立乙個tcp指令碼,在對協議和指令碼方法不熟悉的情況下,可以採用兩個方式。通過錄製 如果pc有客戶端,直接通過錄製得到第乙個指令碼 網上其實有很多教程,但資訊太過繁雜,有的通篇講協...

簡單指令碼測試 對談式指令碼 read

bin bash user inputs his first name and last name.program shows his full name.history path bin sbin usr bin usr sbin usr local bin usr local sbin bin ...