Setting up the Cognos 8 Samples on DB2
Cognos 8 Business Intelligence ships with sample data and reports for a fictional company named “The Great Outdoors”. The samples are useful for testing the functionality of the product and for following the examples in the documentation. The Cognos 8 samples are similar to the samples shipped with Series 7 and ReportNet, but not exactly the same. It is recommended to use the sample data that shipped with the version of the product installed, or some of the sample reports will not work correctly. If you are using several versions of the Cognos software concurrently, this means restoring the data into different schemas or different databases. This tutorial will walk through restoring the sample data on DB2 and then setting up the sample reports. The five SQL scripts used to setup the database can be downloaded here: cognos8_sample_setup_db2.
Create the sample database
To start, connect to the DB2 database.
Create a database named cogsamp83 to use for the sample data by running this script:
db2 -tvf create_sample_db.sql

Create the Buffer Pools and Tablespaces. This step is not required if the buffer pools already exist. Prefix the names with ‘COG’ to indicate that they were created for the use of the Cognos databases.
db2 –tvf create_buffer_pools.sql

Create a tablespace called COGSAMPLE:
db2 –tvf create_tablespace.sql
Create the five database schemas. If you are using Data Manager, create the optional sixth schema to use as a target for data manager.
- GOHR GO Human Resources
- GOMR GO Multilingual Retailers
- GORT GO Retailers
- GOSL GO Sales
- GOSLDW GO Sales Data Warehouse
- GODMT GO Data Manager Target
db2 –tvf create_schemas.sql

db2 –tvf tune_sampledb.sql
CATALOG TCPIP NODE dbnode
REMOTE dbhost SERVER 50000
CATALOG DATABASE cogsam83
AT NODE dbnode
WITH ‘Sample Data for Cognos 8′
Restore the sample data
The sample files for DB2 are located here: <InstallationLocation>\c8\webcontent\samples\datasources\db2. If you only installed the Cognos 8 BI Server, then the samples schemas will have not been installed. You must retrieve the files from a separate Cognos installation package.
Extract the files in the GS_DB.tar archive. If you are using WinZip, you must disable CR/LF conversion; otherwise DB2MOVE will not read the files correctly. This done under the WinZip options menu, configuration, miscellaneous.
Be sure to extract the files to a location where you have full permissions. You might have to copy the GS_DB.tar.gz file to another location if you are using Windows Vista or a Windows Server edition.
DB2MOVE cogsam83 IMPORT -U cognos -P admin1234
The command will write to a log file named import.out in the same directory.
Create the views and stored procedures. Edit the first line of the gs_db_modify.sql file to connect to your sample database with the correct user id and password. Then execute gs_db_modify.bat, which will run the SQL, creating the views and stored procedures required for the Cognos samples. This will create a log file called gs_db_modify.log.
Connect from the Cognos Connection portal
DB2 LIST NODE DIRECTORY
DB2 LIST DATABASE DIRECTORY











Create another datasource called ‘great_outdoors_warehouse’. Use the exact same steps, connecting to the same database, with the additional step of adding a session command. We need to point the connection explicitly to the gosldw schema.

<commandBlock>
<commands>
<sqlCommand>
<sql>SET CURRENT SCHEMA = GOSLDW</sql>
</sqlCommand>
</commands>
</commandBlock>



Restore the sample packages and reports
With the database connections created, the next step is to restore the sample packages and reports. The packages are located in <install directory>\webcontent\samples\content. Depending on what Cognos software is installed, the number of files here will vary. The reporting samples are in Cognos_Samples.zip.
Copy over the Cognos_Samples.zip file to the deployment folder. If this is a multi-server installation, copy over the zip file to the <install>\cognos\c8\deployment folder on the server where content manager is running.


Click the New Import icon.












Drill into a folder and select a report to run to test the samples setup.

Comments
One Response to “Setting up the Cognos 8 Samples on DB2”
Leave a Reply









[…] IBM Cognos 8 Business Intelligence. I have posted an install guide, and a guide to setting up the Cognos 8 samples on […]