16.10.2015 Views

Getting Started with Open Source Development

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix B - Up and running <strong>with</strong> DB2 123<br />

db2 get instance<br />

Lists the current active instance<br />

Table B.1 - Useful instance-level DB2 commands<br />

Within an instance you can create many databases. A database is a collection of objects<br />

such as tables, views, indexes, and so on. For example, in Figure B.8, the database MYDB1<br />

has been created <strong>with</strong>in instance myinst. Table B.2 shows some commands you can use<br />

at the database level.<br />

Command/SQL statement<br />

create database <br />

drop database <br />

connect to <br />

create table/create view/create index<br />

Description<br />

Creates a new database<br />

Drops a database<br />

Connects to a database<br />

SQL statements to create table, views, and<br />

indexes respectively<br />

Table B.2 - Commands and SQL Statements at the database level<br />

B.6 DB2 configuration<br />

DB2 parameters can be configured using the Configuration Advisor GUI tool. The<br />

Configuration Advisor can be accessed through the Control Center by right clicking on a<br />

database and choosing Configuration Advisor. Based on your answers to some questions<br />

about your system resources and workload, the configuration advisor will provide a list of<br />

DB2 parameters that would operate optimally using the suggested values. If you would like<br />

more detail about DB2 configuration, keep reading. Otherwise, use the Configuration<br />

Advisor and you are ready to work <strong>with</strong> DB2!<br />

A DB2 server can be configured at four different levels as shown earlier in Figure B.8:<br />

• Environment variables are variables set at the operating system level. The main<br />

environment variable to be concerned about is DB2INSTANCE. This variable<br />

indicates the current instance you are working on, and for which your DB2 commands<br />

will apply.<br />

• Database Manager Configuration File (dbm cfg) includes parameters that affect the<br />

instance and all the databases it contains. Table B.3 shows some useful commands to<br />

manage the dbm cfg.<br />

Command<br />

get dbm cfg<br />

Description<br />

Retrieves information about the dbm cfg

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!