Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Database Link Permissions
Walt wrote:
> Walt wrote:
>
>> I've got a database link that needs to be used by two different users. >> Currently, it's a Public database link, which is great in the sense >> that both users who need it can use it, but very bad in the sense that >> every other user who shouldn't need it can use it too. So, I'd like to >> create a Private Database Link and grant both users the right to use >> it. However, I'm not seeing any way to do that - if it was a table, >> sequence, view, etc no problem, but I'm not seeing anything in the BNF >> syntax diagram for the grant statement that pertains to DB links, and >> educated guesses like "grant select on [linkname] to MYUSER" don't >> work. >> >> Anybody done this? Shoud I just create two diffferent private links, >> one owned by each user, and call it a day? >> >> BTW, there's a fair amount of code base that references the db link, >> and I'd strongly prefer not to change the name of the link and then >> have to find and change it everywhere the code references it. >> >> Oracle 9.2 W2k3
Continuing the conversation with myself... the *right* way to do this is not with views, but with packages or stored proceedures.
Privileged user A owns the link and creates stored procs or packages that do what needs to be done. A grants execute rights on the proc to users B and C.
This way, users B and C can't see or do anything on the remote database that's not allowed by the proc.
Obvious, eh?
//Walt Received on Fri May 12 2006 - 18:17:27 CDT