views and db2look

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dbtoo_dbtoo

    views and db2look

    One of the databases has 50 views and when I do a db2look I only get
    schema for 40 of them. If I select from the sysviews, I can see all 50
    (the text column contains schema for all 10 (missing) views). What's
    going on here? Why can't or how can I get the schema for these 10
    views.

    Aix 5.1 V7.2 EE FP9

    Thanks.
  • Ian

    #2
    Re: views and db2look

    dbtoo_dbtoo wrote:
    [color=blue]
    > One of the databases has 50 views and when I do a db2look I only get
    > schema for 40 of them. If I select from the sysviews, I can see all 50
    > (the text column contains schema for all 10 (missing) views). What's
    > going on here? Why can't or how can I get the schema for these 10
    > views.
    >
    > Aix 5.1 V7.2 EE FP9
    >
    > Thanks.[/color]

    How are you running db2look?

    If you are extracting DDL for a specific schema (-z) or definer (-u),
    then db2look will include DDL for the views that depend on the tables
    you are extacting.

    For example, if you have a schema 'USER1' that has 5 tables, and a
    view that does not reference any of the USER1 tables, then executing

    db2look -e -z user1

    Will NOT include the view.

    To get all views in the database, you need to run db2look -e -a, or
    specify the appropriate table schema. (I know, this is a pain).



    Good luck,



    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

    Comment

    • Blair Adamache

      #3
      Re: views and db2look

      Can you post the syntax of the db2look command? What do the 10 views
      have in common that differentiates them from the other 40? Have you
      checked the valid flag in syscat.views:

      select viewname, valid from syscat.views

      dbtoo_dbtoo wrote:
      [color=blue]
      > One of the databases has 50 views and when I do a db2look I only get
      > schema for 40 of them. If I select from the sysviews, I can see all 50
      > (the text column contains schema for all 10 (missing) views). What's
      > going on here? Why can't or how can I get the schema for these 10
      > views.
      >
      > Aix 5.1 V7.2 EE FP9
      >
      > Thanks.[/color]

      Comment

      • dbtoo_dbtoo

        #4
        Re: views and db2look

        Blair Adamache <badamache@2muc hspam.yahoo.com > wrote in message news:<c00to2$1v d$1@hanover.tor olab.ibm.com>.. .[color=blue]
        > Can you post the syntax of the db2look command? What do the 10 views
        > have in common that differentiates them from the other 40? Have you
        > checked the valid flag in syscat.views:
        >
        > select viewname, valid from syscat.views
        >
        > dbtoo_dbtoo wrote:
        >[color=green]
        > > One of the databases has 50 views and when I do a db2look I only get
        > > schema for 40 of them. If I select from the sysviews, I can see all 50
        > > (the text column contains schema for all 10 (missing) views). What's
        > > going on here? Why can't or how can I get the schema for these 10
        > > views.
        > >
        > > Aix 5.1 V7.2 EE FP9
        > >
        > > Thanks.[/color][/color]

        Here is the syntax:
        db2look -d mydb -o mydb.ddl -e -x -l -z myschema

        i did check sysviews. The other 10 (missing) views have 'mychema' as
        owner/schema name and valid field of syscat.sysviews is Y, not X.

        I got the schema for one of the views from text column of
        syscat.sysviews and manually recreated it and did another db2look as
        above -- same story. It does not show up in the ddl output and valid
        field shows Y.

        Thanx.

        Comment

        Working...