Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Creating users with a script versus gui
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 - 22:37:14 CDT
![]() |
![]() |