Oracle DB用户别名 [英] Oracle DB User alias
问题描述
是否可以运行一个SQL脚本,或者可以执行一些其他操作来为整个数据库用户创建别名?我遇到了这样的问题:用户名文本对于特定程序而言太长,我想为该UserId创建别名或昵称.
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.
我不是要使用UserId:密码登录,而是要使用UserId:密码登录.
Rather than logging in with UserId: , Password , I want to log in with UserId: , Password.
除了更改oracle用户ID/密码登录凭据之外,该程序不受我的控制.
The program is not under my control beyond chaning the oracle User ID / Password login credentials.
推荐答案
您不能为数据库用户创建别名.
You can't create an alias for a database user, no.
不过,也许您不需要.如果A(具有长名的用户)拥有多个对象,则可以创建一个具有短名的新数据库用户B,为B中的对象授予B特权,然后在B登录时更改current_schema
.使用A的架构解析对对象的引用
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.
这篇关于Oracle DB用户别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!