问题
Is there a SQL script I could run, or some other action I could take, that would create an alias for an entire DB User? I'm running in to an issue where the User name text is too long for a particular program, and I want to create an alias or nickname for that UserId.
Edits:
Rather than logging in with UserId: , Password , I want to log in with UserId: , Password.
The program is not under my control beyond chaning the oracle User ID / Password login credentials.
回答1:
You can't create an alias for a database user, no.
Perhaps you don't need to, though. If A (the user with the long name) owns a number of objects, you can create a new database user B with a short name, grant B privileges on the objects in A, and then change the current_schema when B logs in so that references to objects are resolved using A's schema
ALTER SESSION
SET current_schema = A;
That should accomplish most of what the alias would provide.
回答2:
Perhaps you can use a proxy user that can connect to the DB on behalf of the longNamed user:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::p11_question_id:21575905259251
Actually, if it's only for login purpose then maybe you can use Secure External Password Store and avoid putting any username/password
来源:https://stackoverflow.com/questions/9381638/oracle-db-user-alias