Solved

DB2 installation - Silent install plus create database

Posted on 2008-10-15
5
1,175 Views
Last Modified: 2008-10-20
Hello,

I am very new to DB2 but I am hoping this is common enough that it is simple to do.

I want to create a silent install for DB2 Express C database on a windows machine such that it installs the typical database with the LocalSystem as the user.  Once DB2 is installed I want to create a script that creates a database with two tables.

Basically I need this to be very simple installation for people who know very little about databases.

I am not even sure where to start as I have been searching for 2 hours.

I have a response file that I created (which I think is ok) but I do not see a way to create a database after DB2 installs.

Thanks for any advice/direction.

MAC
0
Comment
Question by:mac-will
  • 3
  • 2
5 Comments
 
LVL 45

Expert Comment

by:Kdo
ID: 22724530
Hi Mac,

Installing DB2 and creating a database are separate processes.  Once DB2 is installed, it's nearly trivial to create a database and a couple of tables.  Just create the DDL and run it through the command line processor.

Installing DB2 isn't quite so simple.  There are installation options that must be resolved, such as file locations, controlling users, etc.

The DB2 installation isn't tough, particularly if you've got a guide to help you with the decisions, but I'm not aware of there being a true "silent install" available.


Kent
0
 
LVL 8

Author Comment

by:mac-will
ID: 22724961
Hi Kent.

Thanks!

So if I have say a batch file I can run the "setup -u <response file>" command followed by??

An SQL script to create the DB, connect to it and create the tables?

Thanks

MAC
0
 
LVL 45

Accepted Solution

by:
Kdo earned 500 total points
ID: 22725044
You can do something very similar.

Create a file with the required commands.

CREATE DATABASE mydatabase
CONNECT TO mydatebase
CREATE TABLE Names (ID integer IDENTITY generated by default, NAME varchar(40))
CREATE TABLE Addresses (ID integer IDENTITY generated by default, ADDRESS1 varchar(30), ADDRESS2 varchar(30))

Then run that through the CLI.  

Kent
0
 
LVL 8

Author Comment

by:mac-will
ID: 22725624
Thanks again Kent.

If this is something that will be deployed to several independent machines is it wise to create a schema first? something like:

CREATE DATABASE mydatabase
CONNECT TO mydatebase

CREATE SCHEMA mySchema AUTHORIZATION GUEST;

CREATE TABLE  mySchema.Names (ID integer IDENTITY generated by default, NAME varchar(40))
CREATE TABLE  mySchema.Addresses (ID integer IDENTITY generated by default, ADDRESS1 varchar(30), ADDRESS2 varchar(30))

And AUTHORIZATION GUEST seems to have no effect on my machine, do you know what this does?

Thanks again

MAC
0
 
LVL 45

Expert Comment

by:Kdo
ID: 22725726
That's an advanced topic probably well beyond what you're going to need.  In a nutshell, it changes the current user authorization to the permissions of user 'GUEST'.

If you want to read more about it, the IBM documentation is here:

  http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.sqls.doc/sqls806.htm

It's probably better to read the IBM literature than have me paraphrase up a long description.  :)


Kent
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now