|
Re: Add System User [message #58707 is a reply to message #58706] |
Fri, 26 September 2003 09:56 |
Thiru
Messages: 1089 Registered: May 2002
|
Senior Member |
|
|
Yes and No, but why ?
Did you drop the SYSTEM user ?!! SYSTEM user gets created on database creation and gets populated with certain product tables(like Advanced Queuing,Replication,etc) using the cat* scripts and SHOULD NOT be dropped.
I dont think there is an Oracle 'supported' way for creating the SYSTEM user. If you have a full database export, you might be able to recreate the user and do a schema level import of SYSTEM. But I am not going into details of this.
I heard that there is an UNSUPPORTED Oracle doc that will detail how to do this,but I cant seem to locate it.
All the best.
Thiru
|
|
|
Re: Add System User [message #58715 is a reply to message #58707] |
Fri, 26 September 2003 11:29 |
Antonio Marcos Souza
Messages: 13 Registered: September 2003
|
Junior Member |
|
|
No. I did not drop System User.
The question is: how could I create an user account programmatically? We are creating an installation and need to do this via some kind of script...
|
|
|
Re: Add System User [message #58716 is a reply to message #58715] |
Fri, 26 September 2003 12:06 |
Thiru
Messages: 1089 Registered: May 2002
|
Senior Member |
|
|
You can get the values for Username,password,default_Tablespace,temporary_tablespace etc through the script and store them in substituition variables and create the user with those values .
eg)
SQL> accept Username prompt " Enter username : "
Enter username : test
SQL> accept Password prompt " Enter password : " HIDE
Enter password : ****
SQL> create user &username identified by &password;
old 1: create user &username identified by &password
new 1: create user test identified by test
User created.
You could also pass the values as arguements to a shell script which in turn passes the values as substituion variables to the sql script that creates the user.
Full syntax of CREATE USER statement is as follows :(extracted from doc)
CREATE USER user IDENTIFIED
{ BY password | EXTERNALLY | GLOBALLY AS 'external_name' }
[[{ DEFAULT TABLESPACE tablespace
| TEMPORARY TABLESPACE tablespace
| QUOTA { integer [[ K | M ]] | UNLIMITED } ON tablespace
[[QUOTA { integer [[ K | M ]] | UNLIMITED } ON tablespace]]...
| PROFILE profile
| PASSWORD EXPIRE
| ACCOUNT { LOCK | UNLOCK }
}
[[ DEFAULT TABLESPACE tablespace
| TEMPORARY TABLESPACE tablespace
| QUOTA { integer [[ K | M ]] | UNLIMITED } ON tablespace
[[QUOTA { integer [[ K | M ]] | UNLIMITED } ON tablespace]]...
| PROFILE profile
| PASSWORD EXPIRE
| ACCOUNT { LOCK | UNLOCK }
]]...
]]
;
Eg)
SQL> create user test identified by test default tablespace users temporary tablespace temp1
2 quota unlimited on users quota 0 on system;
User created.
SQL> grant create session to test;
Grant succeeded.
HTH
Thiru
|
|
|
Re: Add System User [message #58718 is a reply to message #58707] |
Fri, 26 September 2003 12:38 |
Kartik Nair
Messages: 15 Registered: August 2003
|
Junior Member |
|
|
The SYS and SYSTEM users get created when you create the database. Doesn't matter if you are using a GUI or creating using scripts.
You should not have to explicitely create the SYSTEM user in the database while creating an Oracle database.
Kartik
|
|
|
|