how can I create a full db by db2batch?

Giuseppe

how can I create a full db by db2batch?
Hi,
I need to create a db by db2batch command or similar from a file ddl
created by db2look command.
The file ddl contains the connect instruction "connect to ...", how can

I create the same db on another machine without the db descript in this
command? How can I create the complete db by the ddl file?

Excuse me for bad english.
Best regards
Giuseppe



Kurt Sahlberg

Re: how can I create a full db by db2batch?
(in response to Giuseppe)
I Assume the database does not exist on the other machine,
change the "connect to" statement to a "create database" command.
and the ddl should run fine.
HTH
Kurt


>>> Giuseppe <[login to unmask email]> 12/13/99 12:28PM >>>
Hi,
I need to create a db by db2batch command or similar from a file ddl
created by db2look command.
The file ddl contains the connect instruction "connect to ...", how can

I create the same db on another machine without the db descript in this
command? How can I create the complete db by the ddl file?

Excuse me for bad english.
Best regards
Giuseppe






Giuseppe

Re: how can I create a full db by db2batch?
(in response to Kurt Sahlberg)
Kurt Sahlberg wrote:

> I Assume the database does not exist on the other machine,
> change the "connect to" statement to a "create database" command.
> and the ddl should run fine.
> HTH
> Kurt
>

Ok, but I have this error:

C:\tmp>db2batch -f fileCreateddl
ERROR!!! -> No database name has been specified on thecommand
line nor in the environment variable DB2DBDFT

Is the option -d <db name> necessary?
What have I to put in the environment variable DB2DBDFT?

thank you
giuseppe



Michael McCarthy

Re: how can I create a full db by db2batch?
(in response to Giuseppe)
Giuseppe,

If you're going to use db2batch, you must first create the database you
will be connecting to. If you have modified your command file as per Kurt's
suggestion, just enter db2 -vtf <file name> > <outfile name> from the command
line( DB2 Command Window for Win NT).

This will execute the command file and place the results in <outfile name>.

-Mike.





Giuseppe <[login to unmask email]> on 12/13/99 02:21:26 PM

Please respond to DB2 Data Base Discussion List <[login to unmask email]>

To: [login to unmask email]
cc: (bcc: Michael McCarthy/DTC)
Subject: Re: [DB2-L] how can I create a full db by db2batch?




Kurt Sahlberg wrote:

> I Assume the database does not exist on the other machine,
> change the "connect to" statement to a "create database" command.
> and the ddl should run fine.
> HTH
> Kurt
>

Ok, but I have this error:

C:\tmp>db2batch -f fileCreateddl
ERROR!!! -> No database name has been specified on thecommand
line nor in the environment variable DB2DBDFT

Is the option -d <db name> necessary?
What have I to put in the environment variable DB2DBDFT?

thank you
giuseppe








Kurt Sahlberg

Re: how can I create a full db by db2batch?
(in response to Michael McCarthy)
Just issue db2 -tvf path:\your ddl > output.file from the command line.

Your input file ddl should have a "create db xxxxxxx" followed by a "connect to db" and then the rest of your ddl.
If you want to run the db2batch program you will have to create the database first, and then run your ddl file.
HTH
Kurt






>>> Giuseppe <[login to unmask email]> 12/13/99 01:21PM >>>
Kurt Sahlberg wrote:

> I Assume the database does not exist on the other machine,
> change the "connect to" statement to a "create database" command.
> and the ddl should run fine.
> HTH
> Kurt
>

Ok, but I have this error:

C:\tmp>db2batch -f fileCreateddl
ERROR!!! -> No database name has been specified on thecommand
line nor in the environment variable DB2DBDFT

Is the option -d <db name> necessary?
What have I to put in the environment variable DB2DBDFT?

thank you
giuseppe






Giuseppe

Re: how can I create a full db by db2batch?
(in response to Kurt Sahlberg)
Very well.
Thank you, it works fine. Last question: how can I create un user in this ddl
file?
Bye and thank you very much
giuseppe



Wayne Driscoll

Re: how can I create a full db by db2batch?
(in response to Giuseppe)
In UDB, users are not created in the database, instead the UDB process uses
the native operating system security system to perform authentication. In
addition, system wide authorizations (SYSADM, SYSCTRL and SYSMAINT) are
maintained by virtue of the user being a member of the appropriate group in
the security system.
Wayne Driscoll
Product Developer
Quest Software Inc.
[login to unmask email]
Note: All opinions are strictly my own.

-----Original Message-----
From: Giuseppe [mailto:[login to unmask email]
Sent: Tuesday, December 14, 1999 2:39 AM
To: [login to unmask email]
Subject: Re: [DB2-L] how can I create a full db by db2batch?


Very well.
Thank you, it works fine. Last question: how can I create un user in this
ddl
file?
Bye and thank you very much
giuseppe








Giuseppe

Re: how can I create a full db by db2batch?
(in response to Wayne Driscoll)
Wayne Driscoll wrote:

> In UDB, users are not created in the database, instead the UDB process uses
> the native operating system security system to perform authentication. In
> addition, system wide authorizations (SYSADM, SYSCTRL and SYSMAINT) are
> maintained by virtue of the user being a member of the appropriate group in
> the security system.

Ok, but how can I add the authorities of a user?. I'd like to have a statement to do what I can do by the function "add" on folder "DB Users" of the Control Center.
Can you help me?
Thank you
g.



Jakofcic Darja

Re: how can I create a full db by db2batch?
(in response to Giuseppe)
You can use GRANT sql statement to authority to a user or group . See SQL
reference for details.
LP Darja

> -----Original Message-----
> From: Giuseppe [SMTP:[login to unmask email]
> Sent: 14. december 1999 16:56
> To: [login to unmask email]
> Subject: Re: how can I create a full db by db2batch?
>
> Wayne Driscoll wrote:
>
> > In UDB, users are not created in the database, instead the UDB process
> uses
> > the native operating system security system to perform authentication.
> In
> > addition, system wide authorizations (SYSADM, SYSCTRL and SYSMAINT) are
> > maintained by virtue of the user being a member of the appropriate group
> in
> > the security system.
>
> Ok, but how can I add the authorities of a user?. I'd like to have a
> statement to do what I can do by the function "add" on folder "DB Users"
> of the Control Center.
> Can you help me?
> Thank you
> g.
>
>
>
>
>