彪彪
openkore
全部博文(50)
C编程(0)
软件工具(0)
c++入门(2)
openkore(0)
2010年(38)
2009年(12)
kevin258
wsy52081
ddmumahh
vincerma
raveh
mwx1234
chen_xue
zjwmv
zpbobo11
分类:
2010-04-25 14:58:06
#!/usr/local/bin/perl -wuse DBI;use strict;delete $ENV{ 'ENV' };$ENV{ORACLE_SID} = "ORCL";$ENV{ORACLE_HOME} = "/opt/oracle/product/10.2.0";$ENV{NLS_LANG} = "AMERICAN_AMERICA.AL32UTF8";$ENV{ORA_NLS} = $ENV{ORACLE_HOME} . "/ocommon/nls/admin/data";$ENV{PATH} = $ENV{ORACLE_HOME} . "/bin:/usr/bin";$ENV{LD_LIBRARY_PATH} = $ENV{ORACLE_HOME} . "/lib";my $connect_mode = 2; # 2=SYSDBAmy $dbh = DBI->connect( 'dbi:Oracle:','', '', { ora_session_mode => $connect_mode, PrintError => 1, AutoCommit => 0 } ) or die "Cannot connect: $DBI::errstr\n\n";print "Connected.\n";
#!/usr/bin/perluse DBI;use DBI qw(:sql_types);$dbh = DBI->connect("dbi:Oracle:","sys","abc123", { AutoCommit => 1, PrintError => 1, RaiseError => 0 ,ora_session_mode => 2}) or die("DB connect error! \n");#$sql = "select * from TAB";$sql = 'create user zhangxu identified by zx6819453 default tablespace OPENKORE temporary tablespace TEMP_OPENKORE';$sth = $dbh->prepare($sql);$sth->execute() or die("error!");$sql = 'grant connect,resource,dba to zhangxu';$sth = $dbh->prepare($sql);$sth->execute() or die("error!");$sth->finish;$dbh->disconnect();exit 0;
上一篇:查看oracle拥有表空间
下一篇:存储过程(入门级)
登录 注册