Performing Other Advanced Functions - Lenovo ThinkPad G40 Administrator's Manual

Ibm system information center administrator's guide
Table of Contents

Advertisement

Performing other advanced functions

42
5. When the task executes, the custom report is executed and the results are saved
as a CSV file.
Note: The first line of the CSV will contain the header row. The actual values
will start with the second line.
6. The CSV file can then be imported into DB2. To do this, create a batch or
command file with the following line and name it IMPORT.BAT:
db2 -f import.ddl
7. Next, create the IMPORT.DDL file using a plain text editor such as Notepad.
This file should contain lines similar to the following example:
-- Edit the following line to include the correct userid/password for your database.
CONNECT TO MYUSERS USER db2admin USING password
-- Clear the table
DELETE FROM MY.USERS WHERE USERID <> ''
-- Import the latest data
IMPORT FROM.\custom_report_name.csv OF DEL INSERT INTO MY.USERS
-- Clear the headers from the .csv file
DELETE FROM my.users WHERE userid='USERID'
This file will execute as a DB2 script. The script first connects the DB2
administrator account to the MYUSERS database. Next, the script clears the old
contents of the MY.USERS table (where MY is the schema under which the
USERS table was created). Next, the script imports the contents of the CSV into
the MY.USERS table. Finally, the script removes the row containing the headers
by selecting based on a value in that row. In this example, the first column
contains the userid. In the row that contains the headers, the value in the
userid column equals USERID. Based on this, that row is deleted.
8. To initiate the import of the CSV file into your database, run the DB2CMD
IMPORT.BAT command. This will open a DB2 Command Environment and
execute the IMPORT.BAT file, which, in turn, executes the DB2 importing script
- IMPORT.DDL.
Since the task within the System Information Center program can be scheduled,
this whole process can be set up to run automatically so that data in an external
database can be synchronized with the data in the System Information Center
database.
Note: Each time the task generates a new CSV file, the previous file will be
overwritten.
There are a number of other advanced functions that can be performed using the
System Information Center interface.
The following list highlights other advanced functions available through the
System Information Center. For details about performing other advanced functions,
see the IBM System Information Center online help system.
v Checking asset security: You can check security conditions of all client
computers.
v Viewing logs and server status: You can view application logs and server status
to help diagnose a problem.
v Interrupting the Task Scheduler: In addition to modifying the task scheduler,
you can interrupt, or stop, the scheduler to allow for other processing to take
place, thereby increasing performance.

Advertisement

Table of Contents
loading

Table of Contents