How to run a Script...need some ideas... [message #53926] |
Fri, 18 October 2002 01:02 |
sai sreenivas jeedigunta
Messages: 370 Registered: November 2001
|
Senior Member |
|
|
hi all,
we have a product..i can define that in terms of database as a user with his default tablespace and some schema objects...i have a script file that will create tablespace, users , etc etc...
now the problem is , this script file need to be run from setup... and user will have a chance to give his own username and select his own database...
my Questions:
1. how do i update my script file with the new username
2. in case of multiple databases in his machine, How do i execute the script depending on his selectionn...
Please throw some light...
sai
|
|
|
Re: How to run a Script...need some ideas... [message #53928 is a reply to message #53926] |
Fri, 18 October 2002 02:27 |
B
Messages: 327 Registered: August 1999
|
Senior Member |
|
|
for unix
#!/bin/ksh
echo USER ?
read USER
echo DATABASE ?
read DATABASE
sqlplus SYS/***@$DATABASE << EOF
create user $USER identified by PASSWORD;
grant PRIVILEGE to $USER;
connect $USER/PASSWORD@$DATABASE;
@/PATH/SCRIPT;
EOF
|
|
|
Re: How to run a Script...need some ideas... [message #53930 is a reply to message #53926] |
Fri, 18 October 2002 02:33 |
B
Messages: 327 Registered: August 1999
|
Senior Member |
|
|
for unix
#!/bin/ksh
echo USER ?
read USER
echo DATABASE ?
read DATABASE
sqlplus SYS/***@$DATABASE << EOF
create user $USER identified by PASSWORD;
grant PRIVILEGE to $USER;
connect $USER/PASSWORD@$DATABASE;
@/PATH/SCRIPT;
EOF
|
|
|