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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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';

---------- ------------------------------
        72 USER1


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

share|improve this question
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
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

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

Your Answer


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.