Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Read data from a file

RE: Read data from a file

From: Mladen Gogala <mladen_at_wangtrading.com>
Date: Wed, 03 Sep 2003 05:54:33 -0800
Message-ID: <F001.005CEA2A.20030903055433@fatcity.com>


To make things perfectly clear, this procedure was written while I was enjoying
my 1st morning coffee and is not meant to be used without editting. It is just a
template, not a finished script. If you are on a unix box, then this is just what
you do. You write perl scripts which interact with the database. That's precisely
what perl is for.

--
Mladen Gogala
Oracle DBA 



-----Original Message-----
Mladen Gogala
Sent: Wednesday, September 03, 2003 8:15 AM
To: Multiple recipients of list ORACLE-L


#!/usr/bin/perl
use DBI;
my $username=undef;
my $dbh=DBI->connect("dbi:Oracle:sid",system,password);
while ($username=<STDIN>) {
   chomp($username);
   $dbh->do("create user $username identified by $username
             default tablespace syastem
             temporary tablespace system");
   $dbh->do("grant connect,resource, dba to $username");
}
print "You got yourself a few new usernames!\n";




On 2003.09.03 01:34, setiady wrote:

> MessageHi All,
> I wonder if it is possible for me to execute a script file to
> create
> user
> while I have another file (a text file) consisting the names of the users
I
> want to create. Assuming that all the users are having the same
privileges,
> what is the procedure to read the names from the other file? Thank you.
>
-- Mladen Gogala Oracle DBA -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Mladen Gogala INET: mgogala_at_adelphia.net Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Note: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Mladen Gogala INET: mladen_at_wangtrading.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Received on Wed Sep 03 2003 - 08:54:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US