Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Is it possible to specify the user_id of a user while creating it?

SQL> create user user1 identified by user1;

User created.

SQL> select user_id, username from all_users where username='USER1';

   USER_ID USERNAME
---------- ------------------------------
        72 USER1

SQL>

Instead of 72, can it be a number that I specify?

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

Not in a supported fashion, no.

Why would you care what the USER_ID of a new user was? That would seem to raise a pile of red flags in my mind.

share|improve this answer
2  
Even dropping a user that currently has the desired USER_ID does not cause new user creation to use that number. –  Leigh Riffel Mar 23 '11 at 17:22
add comment

If you want to migrate logins and users from a server to another there should be another way then forcing their ids and names.

In SQL Server for example there is a system stored procedure (sp_help_revlogin) that generates the necessary scripts to migrate users between servers. I don't know for Oracle, but I'm sure someone has met the problem before.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.