Solved

DB2 installation - Silent install plus create database

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

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 (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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

623 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