Home » RDBMS Server » Server Administration » How to run a Script...need some ideas...
How to run a Script...need some ideas... [message #53926] Fri, 18 October 2002 01:02 Go to next message
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 Go to previous messageGo to next message
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 Go to previous message
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
Previous Topic: What s the mistake ? ?
Next Topic: While installing....ORA-01041: internal error. hostdef extension doesn't exist
Goto Forum:
  


Current Time: Fri Sep 20 03:31:16 CDT 2024