IBM® Data
Studio provides
dialogs that are called task assistants that help you create and run
database administration commands for objects in DB2 for Linux, UNIX,
and Windows databases. For example, you can use task assistants to
start and stop databases and instances, configure database parameters,
reorganize tables and indexes, back up and restore databases or table
spaces, and import and export table data.
Before you begin
To run a database administration command for an object, you
must have the appropriate permission or authorization for the object,
and you must have a connection to the database that contains the object.
- For Linux operating systems
- Before users who do not have DB2 instance level privileges can
use the DB2 client CLP to run commands, including commands for importing,
loading, exporting, or unloading tables, the DB2INSTANCE system
environment variable must be set.
Note: You must set the DB2INSTANCE system
environment variable for each time that you log in or open a command
terminal.
To set the
DB2INSTANCE system
environment variable:
- Ensure that the Data Studio client is closed and not running before
you run the script.
- Set the environment variable at the instance level by running
one of the following scripts:
- For a Bourne or Korn shell, run: db2profile
- For a C shell, run: db2cshrc
- Start IBM Data Studio client.
For detailed information about setting the system environment
variable, see the Setting environment variables outside the
profile registries on Linux and UNIX operating systems topic
in the IBM DB2 online information for your version of the DB2 database.
Procedure
To open the task assistant for the command, specify additional
settings for the command, and run the generated commands, complete
the following steps:
- Find the object that you want to work with. You
can find the object either in the Administration Explorer or
the Object List.
Table 1. Which view to
use to find objectsView and objects |
Example |
Administration Explorer Hosts
Instances
Databases
|
From the Administration Explorer, you can
open a task assistant for hosts, instances, and databases. Figure 1. Example
of the Administration Explorer
|
Object List Databases
Table spaces
Indexes
Views
Aliases
Packages
|
When you click a database or a data object
folder in the Administration Explorer, the list
of objects is displayed in the Object List. Figure 2. Example of selecting the Table Spaces folder to display the
table spaces in the Object List
Tip: If the Object List is
already open for the database, you can use the drop-down arrow that
is displayed after the database name in navigation breadcrumb trail
to display other objects in the Object List. Figure 3. Example of
using a drop-down arrow in the Object List to select other objects
to display
|
- Right-click the object and select the command to run from
the context-sensitive menu.
For example, the following
figure shows how to back up the GSDB database.
Figure 4. Example
of the context-sensitive menu for databases and selecting to back
up a database
The task assistant opens for the
database administration task that you selected. Each task assistant
has four sections:
Connection,
Settings,
Command,
and
Messages. The following graphic shows how
the
Connection,
Command,
and
Messages sections are expandable. The
Settings section
is always expanded.
Figure 5. Example of a task assistant with its
four sections
- In the Settings section, specify
the options for the command:
- Click each of the tabs to step through the process of
specifying the settings and options to use in the command.
- Click Preview Command to shift
down to and expand the Command section, where
the generated commands that are based on the options that you specified
are displayed.
For example, the following figure shows selecting the Backup
Performance tab to specify options that improve the performance
of the backup operation.
Figure 6. Example of selecting a tab
and specifying options on that tab
- In the Command section, review the
commands that were generated and then run them.
Figure 7. Example of the commands being displayed in the Command section
If you are satisfied with the displayed
commands, click Run to run them.
Tip: In some cases, you might want to edit the displayed commands.
Click
Edit to open the
SQL and XQuery editor
where you can edit and run the commands. You might also want to schedule
a time to run the commands. For more information, see
Scheduling command scripts.
The focus of the task assistant shifts to the Messages section.
- In the Messages section, monitor
the progress of the commands that are being run in the progress bar
and review any messages that are issued.
Figure 8. Example
of the Messages section while the commands are being run
To view detailed information about any command that does
not run successfully, click the message number or SQL code that is
displayed.
Results
The commands to perform your database administration task
were run.