Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6906503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:19:06+00:00 2026-05-27T08:19:06+00:00

So i need to do a mapping from a Employee table (idEmployee, name, etc..)

  • 0

So i need to do a mapping from a Employee table (idEmployee, name, etc..) to a real user with a account created. I decided to add a table Mapping_Employee_User(idEmployee, userName) like below

CREATE TABLE Mapping_Employee_User( 
    idEmployee NUMBER(6)
        CONSTRAINT FK_Mapping_Employee_User1 REFERENCES Employee (idEmployee),
    userName VARCHAR2(30 BYTE)
        CONSTRAINT FK_Mapping_Employee_User2 REFERENCES ALL_USERS(USERNAME),
    CONSTRAINT PK_Mapping_Employee_User PRIMARY KEY (idEmployee, userName)
);

But i am getting a “ORA01031 insufficient privileges Cause: An attempt was made to change the current username or password…” But I am not actually doing that, I just want to make a reference.

As a note: I have full rights with this user

Logged as SYS I can see that the actual table is named “USER$”, and I cant find table ALL_USERS…anyway how do I do this kind of reference??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:19:08+00:00Added an answer on May 27, 2026 at 8:19 am

    ALL_USERS and USER$ are both system tables/views. They are maintained at a low level by Oracle itself. At a level too low to enforce those constraints. You simply can’t do what you’re trying to do.

    (Think of it this way: what’d happen if you tried to DROP USER bob? Do you expect Oracle to enforce your foreign key constraint? What’d happen if your user tablespace is offline?)

    edit: I suggest you just leave off the foreign key on userName. You may want to schedule some job to compare the users in Mapping_Employee_User vs. DBA_USERS to make sure they stay in sync. Alternatively, you may want to manage your Oracle users with, say, LDAP (which I hear is possible).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a mapping from a list of keys to a value. I know
I need to create a mapping from objects of my own custom class (derived
When using NHibernate you need to provide some mapping files with the name .hbm.xml
Let's say that I need to make a mapping from String to an integer.
I need to use ClassMaps instead of auto mapping because of legacy database. But
I'm writing a mapping application that I am writing in python and I need
In order to use normal mapping in GLSL shaders, you need to know the
I'm using Fluent NHibernate auto mapping. I need to access more than one database
If I want to do bi-directional mapping, do I need to create two mapping?
I have a mapping from xml schema(number) to copybook, copybook field is a number

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.