Oracle 中的简单查询

发布于 2024-08-14 08:07:20 字数 113 浏览 5 评论 0原文

在 Oracle 中执行以下操作的查询是什么?

  1. 获取所有视图的名称 展示 ? (类似于从中选择* 查看,但我想获得的不是视图 表)
  2. 参见特定来源 看法。

what are the queries to do the following in Oracle?

  1. get names of all views which are
    present ? (Similar to select * from
    view, but i want to get views not
    tables)
  2. See source of a particular
    view.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

当梦初醒 2024-08-21 08:07:20
  1. 获取所有视图的名称:

    a.当前用户拥有的:

    选择视图名称
    来自 USER_VIEWS;
    

    b.当前用户可见:

    选择视图名称
    来自 ALL_VIEWS;
    

    c.存在哪些:

    选择视图名称
    来自 DBA_VIEWS;
    
  2. 查看特定视图的来源

    选择文本
    来自 xxx_VIEWS
    WHERE view_name = :myviewname;

(xxx 可以是 USER、ALL 或 DBA)

DBA_VIEWS

  1. get names of all views:

    a. which are owned by the current user:

    SELECT view_name
    FROM USER_VIEWS;
    

    b. which are visible to the current user:

    SELECT view_name
    FROM ALL_VIEWS;
    

    c. which are present:

    SELECT view_name
    FROM DBA_VIEWS;
    
  2. See source of a particular view

    SELECT text
    FROM xxx_VIEWS
    WHERE view_name = :myviewname;

(xxx can be USER, ALL or DBA)

DBA_VIEWS

潇烟暮雨 2024-08-21 08:07:20

查看sqlplus中视图的定义:

describe MY_VIEW;

To see the definition of a view in sqlplus:

describe MY_VIEW;
习ぎ惯性依靠 2024-08-21 08:07:20

此查询将获取架构中视图的名称。

select object_name
  from user_objects
 where object_type = 'VIEW'

获取查看源的查询?

SQL> select dbms_metadata.get_ddl('VIEW', 'VIEW_NAME', 'USERNAME')
 2     from dual
 3   /

This query will get the names of views in your schema.

select object_name
  from user_objects
 where object_type = 'VIEW'

The query for getting the view source?

SQL> select dbms_metadata.get_ddl('VIEW', 'VIEW_NAME', 'USERNAME')
 2     from dual
 3   /
§普罗旺斯的薰衣草 2024-08-21 08:07:20

用户拥有的视图

 select * from USER_VIEWS ;

检查 oracle 对象元数据

http://cisnet.baruch.cuny。 edu/holowczak/oracle/sqlplus/

views owned by user

 select * from USER_VIEWS ;

check for oracle objects metadata

http://cisnet.baruch.cuny.edu/holowczak/oracle/sqlplus/

无力看清 2024-08-21 08:07:20
1. select  OWNER,
 OBJECT_NAME,
 to_char(CREATED,'MM/DD/YYYY HH24:MI:SS') created,
 status
from   dba_objects
where OWNER not in ('SYS','SYSTEM')
and OBJECT_TYPE='VIEW'
order by OWNER,OBJECT_NAME

  1. 选择 TEXT FROM DBA_VIEWS,其中 OWNER ='owner_name' 且 VIEW_NAME='view_name'

1. select  OWNER,
 OBJECT_NAME,
 to_char(CREATED,'MM/DD/YYYY HH24:MI:SS') created,
 status
from   dba_objects
where OWNER not in ('SYS','SYSTEM')
and OBJECT_TYPE='VIEW'
order by OWNER,OBJECT_NAME

  1. select TEXT FROM DBA_VIEWS where OWNER ='owner_name' and VIEW_NAME= 'view_name'

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文