Solved

DB2 installation - Silent install plus create database

Posted on 2008-10-15
5
1,223 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 45

Expert Comment

by:Kent Olsen
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:
Kent Olsen 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:Kent Olsen
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 (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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

752 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