Solved

DB2 installation - Silent install plus create database

Posted on 2008-10-15
5
1,202 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
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 Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

776 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