Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 06:30 AM
dbtoo_dbtoo
Guest
 
Posts: n/a
Default 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.
  #2  
Old November 12th, 2005, 06:30 AM
Ian
Guest
 
Posts: n/a
Default 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! =-----
  #3  
Old November 12th, 2005, 06:30 AM
Blair Adamache
Guest
 
Posts: n/a
Default 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]

  #4  
Old November 12th, 2005, 06:31 AM
dbtoo_dbtoo
Guest
 
Posts: n/a
Default Re: views and db2look

Blair Adamache <badamache@2muchspam.yahoo.com> wrote in message news:<c00to2$1vd$1@hanover.torolab.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.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,248 network members.