db2 create db c83 alias c83 using codeset UTF-8 territory CA
创建sample数据库
db2set db2codepage= db2 change db c83 comment with 'Sample Data for Cognos 8.3'
修改数据库编码方式 因为之后在从sample中导入数据库的时候需要按照sample资源文件规定的编码方式才可以正常导入数据库数据
db2 connect to c83
连接数据库
db2 update db cfg using applheapsz 1024 deferred db2 update db cfg using locktimeout 240 deferred db2 create bufferpool cog04kbp immediate size 250 pagesize 4k db2 create bufferpool cog08kbp immediate size 250 pagesize 8k db2 create bufferpool cog16kbp immediate size 250 pagesize 16k db2 create regular tablespace c83 pagesize 16k managed by automatic storage extentsize 16 prefetchsize 16 overhead 10.5 transferrate 0.33 bufferpool cog16kbp db2 comment on tablespace c83 is 'Cognos Sample Data' db2 grant use of tablespace c83 to public db2 create schema gosl db2 comment on schema gosl is 'GO Sales' db2 create schema gosldw db2 comment on schema gosldw is 'GO Sales Data Warehouse' db2 create schema gohr db2 comment on schema gohr is 'GO Sales Human Resources' db2 create schema gort db2 comment on schema gort is 'GO Retailers' db2 create schema gomr db2 comment on schema gomr is 'GO Multilingual Retailers' db2 create schema godmt db2 comment on schema godmt is 'GO Data Manager Target' db2 grant dbadm on database to user cognos db2 update dbm cfg using intra_parallel NO db2 update dbm cfg using federated NO db2 update dbm cfg using fed_noauth NO db2 update db cfg for c83 using maxlocks 22 db2 update db cfg for c83 using locklist 50 db2 update db cfg for c83 using dft_degree 1 db2 update db cfg for c83 using avg_appls 1 db2 update db cfg for c83 using stmtheap 2048 db2 update db cfg for c83 using dft_queryopt 5 db2 catalog tcpip node dbnode remote dbhost server 50000 db2 catalog database c83 at node dbnode with 'Sample Data for Cognos 8.3'
一些需要修改的配置
DB2MOVE c83 IMPORT -u db2admin -p db2admin
导入sample 数据
Cognos安装目录\c8\webcontent\samples\datasources\db2下的gs_db_modify.bat(需要先更改gs_db_modify.sql第一行中的dbname, user, password为你自己的配置)
connect to c83 user db2admin using db2admin
@ GRANT INDEX,REFERENCES ON TABLE "GOSALESRT"."RETAILER" TO USER "GOSALES"
修改gs_db_modify.sql 运行gs_db_modify.bat
在DB2 Server端用以下命令查看DB2情况 DB2 LIST NODE DIRECTORY DB2 LIST DATABASE DIRECTORY 8> 用浏览器打开Cognos控制台,在Cognos Administration -> Configuration -> Data Source Connections中新建数据库连接,Name输入great_outdoors_sales,选择DB2类型,并输入用户名密码进行连接测试;再同样建立一个Name为great_outdoors_warehouse的数据库连接,并将其Open session commands的Value值设为以下XML: <commandBlock> <commands> <sqlCommand> <sql>SET CURRENT SCHEMA = GOSLDW</sql> </sqlCommand> </commands> </commandBlock> 9> 向Cognos中导入Sample packages and reports 在 Cognos安装目录\c8\webcontent\samples\content 下有一个Cognos_Samples.zip文件,将它拷贝到 Cognos安装目录\c8\deployment目录下; 在Cognos控制台中,在Cognos Administation -> Content Administration页面,点击New Import图标,选择刚刚添入的Cognos Samples然后下一步; 一路默认设置完后Run with options,回到控制台Home Page,即可看到公共文件夹(Public Folders)中有加入的Sample目录了,可以*操作它们来进行Cognos的进一步学习了。