How can I find the OWNER of an object in Oracle?

后端 未结 5 1086
攒了一身酷
攒了一身酷 2021-01-31 19:59

I want to find the foreign keys of a table but there may be more than one user / schema with a table with the same name. How can I find the one that the currently logged user is

5条回答
  •  故里飘歌
    2021-01-31 20:26

    Oracle views like ALL_TABLES and ALL_CONSTRAINTS have an owner column, which you can use to restrict your query. There are also variants of these tables beginning with USER instead of ALL, which only list objects which can be accessed by the current user.

    One of these views should help to solve your problem. They always worked fine for me for similar problems.

提交回复
热议问题