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

Home -> Community -> Usenet -> c.d.o.server -> Re: Creating users with a script versus gui

Re: Creating users with a script versus gui

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sat, 7 Apr 2001 06:34:05 +0200
Message-ID: <9an86u$4bqek$1@ID-62141.news.dfncis.de>

Identified by values 'passwd' should have been identified by passwd
so the shell script is buggy.

Hth,

Sybrand Bakker, Oracle DBA

"Galen Boyer" <galenboyer_at_yahoo.com> wrote in message news:u1yr58jms.fsf_at_yahoo.com...
> Okay,
>
> Oracle 8i, windows NT.
>
> I'm getting a bit stumped. I have been using DBArtisan for
> awhile. (Very nice tool) I go and use its user creation wizard
> and then, right before it sends off the SQL, it presents to me
> the SQL that it is going to send (One of the nice features about
> it). So, I copy that and try to run it as a script. Here is the
> code:
>
> CREATE USER tst_user IDENTIFIED BY "passwd"
> DEFAULT TABLESPACE USERS
> TEMPORARY TABLESPACE TEMP
> PROFILE DEFAULT
> ACCOUNT UNLOCK;
> GRANT RESOURCE TO tst_user WITH ADMIN OPTION;
> ALTER USER tst_user DEFAULT ROLE RESOURCE;
>
> So, I execute this from Artisan and I get the user created. I
> also execute this same SQL from a shell script (I have to change
> the double quotation marks to single quotation marks to get the
> user created from the script though) and get the user created.
> (The shell script is executed with the Cygwin utils #!/bin/sh).
> So, here is the difference. When I created the user using
> Artisan, I see the user has been created and I can log in as that
> user no problem. Using the copied sql from Artisan but executed
> from the script, I see the user has been created but I can't log
> in as that user.
>
> The main thing I noticed is, when created from Artisan, and then
> looked at through Artisan, the password is '7293B8A20F438785'.
> When created from the script and then extracted with Artisan, the
> password is 'passwd'.
>
> Here is the script used to create the user.
>
> #!/bin/sh
>
> USERNAME=$1
>
> if [ -z $USERNAME ];then
> echo "Must provide username"
> exit
> fi
>
> plus80 sys/primix_at_clientname817 <<EOF
>
> drop user $USERNAME;
> CREATE USER $USERNAME IDENTIFIED BY VALUES 'password'
> DEFAULT TABLESPACE USERS
> TEMPORARY TABLESPACE TEMP
> PROFILE DEFAULT
> ACCOUNT UNLOCK;
> GRANT CONNECT TO $USERNAME;
> GRANT RESOURCE TO $USERNAME;
> ALTER USER $USERNAME DEFAULT ROLE CONNECT,RESOURCE;
> GRANT UNLIMITED TABLESPACE TO $USERNAME;
>
> EOF
>
> --
> I don't want to be the rock. Yeah, okay, what do you want to be?
> I want to be the piece of glass.
Received on Fri Apr 06 2001 - 23:34:05 CDT

Original text of this message

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