From: Anwei Shen on
Is there a way to get the DDL for all the tables?
Thinking to use db2dart to dump necessary sysibm table,

Then recreate similar views
syscat.tables
syscat.views
syscat.columns
syscat.triggers
....
Compose DDL based on those views.

It is really a tedious work.

Any other suggestion?
From: Mark A on
"Anwei Shen" <shenanwei(a)gmail.com> wrote in message
news:ec22cc99-0d2f-431b-8bcb-c7f16ac0ed60(a)k39g2000yqb.googlegroups.com...
> Is there a way to get the DDL for all the tables?
> Thinking to use db2dart to dump necessary sysibm table,
>
> Then recreate similar views
> syscat.tables
> syscat.views
> syscat.columns
> syscat.triggers
> ...
> Compose DDL based on those views.
>
> It is really a tedious work.
>
> Any other suggestion?

db2look command (see Command Reference manual)

db2look -d sample -e -a -l > sample.ddl

There are some other options if you also want statistics, etc.


From: Helmut Tessarek on
Can you be a little bit more descriptive?

crash recovery failed. so what? are you able to connect to the database?
I'm sorry, how do you think somebody should help you w/o having any info?

What is the error message? What is your problem?

On 23.06.10 23:44 , Anwei Shen wrote:
> Is there a way to get the DDL for all the tables?
> Thinking to use db2dart to dump necessary sysibm table,
>
> Then recreate similar views
> syscat.tables
> syscat.views
> syscat.columns
> syscat.triggers
> ...
> Compose DDL based on those views.
>
> It is really a tedious work.
>
> Any other suggestion?


--
Helmut K. C. Tessarek
DB2 Performance and Development

/*
Thou shalt not follow the NULL pointer for chaos and madness
await thee at its end.
*/
From: Anwei Shen on
On Jun 24, 3:43 am, Helmut Tessarek <tessa...(a)evermeet.cx> wrote:
> Can you be a little bit more descriptive?
>
> crash recovery failed. so what? are you able to connect to the database?
> I'm sorry, how do you think somebody should help you w/o having any info?
>
> What is the error message? What is your problem?
>
> On 23.06.10 23:44 , Anwei Shen wrote:
>
> > Is there a way to get the DDL for all the tables?
> > Thinking to use db2dart to dump necessary sysibm table,
>
> > Then recreate similar views
> > syscat.tables
> > syscat.views
> > syscat.columns
> > syscat.triggers
> > ...
> > Compose DDL based on those views.
>
> > It is really a tedious work.
>
> > Any other suggestion?
>
> --
> Helmut K. C. Tessarek
> DB2 Performance and Development
>
> /*
>    Thou shalt not follow the NULL pointer for chaos and madness
>    await thee at its end.
> */

db2 is crashed, no connection can be made even the db2look.
when you connect, just give you simple system error.
in db2diag.log, it said crash recovery failed.
From: Helmut Tessarek on
Hi Anwei,

> db2 is crashed, no connection can be made even the db2look.
> when you connect, just give you simple system error.
> in db2diag.log, it said crash recovery failed.

db2look won't work, since it has to connect to the database and bind a package
to the db.

The only way for you now is using db2dart and dump the data somehow to disk.

BUT:
If you have a support contract, you can open a PMR with IBM support and
explain your situation. There are ways to get a connection to the database,
but you will have to sign a disclaimer before support will do anything. It
will sat that the database might not be in a consistent state.

I'm sorry, there is nothing I can do. Or let's put it that way: my hands are
tied. You will have to contact support.

I don't know how to say it, so please forgive my blunt delivery:
Why the heck do you think there is a backup command?

--
Helmut K. C. Tessarek
DB2 Performance and Development

/*
Thou shalt not follow the NULL pointer for chaos and madness
await thee at its end.
*/