Archive for the 'DB2 tutorials' Category

IBM DB2 Express-C for Linux HOWTO

Author: DB2UDB Admin
July 11, 2008

This is a great IBM DB2 Express-C for Linux HOWTO by Ian Hakes.

This HOWTO is intended for anyone interested in installing and using the IBM DB2® Express-C 9 database on a Linux® operating system. The aim of this document is to provide additional support and specific distribution details to get you up and running with DB2 on your Linux distribution of choice.

Link

DB2UDB is not responsible for links to external sites.



November 16, 2007

Description:
Some vulnerabilities and a security issue have been reported in IBM DB2, some of which have unknown impacts, and the other can be exploited by malicious, local users to gain escalated privileges or perform certain actions with escalated privileges.

1) Unspecified errors exist in DB2WATCH, DB2FREEZE, and within several setuid binaries. No further information is available.

2) The DB2DART tool executes the “TPUT” command and allows a user to execute commands as the DB2 instance owner.

3) Other errors in the “OPERATING SYSTEM SERVICES” component (e.g. incorrect permissions on ACLs for DB2NODES.CFG) have also been reported. No further information is available.

Read the rest of this entry »



Learn how to use the new features of DB2® Express-C to store, query, and manipulate native XML documents using SQL/XML and XQuery. Previously, XML documents had to be “shredded,” or turned into a CLOB/BLOB/LOB (large object), to be stored in a relational database. This tutorial explains how to handle XML documents natively in the no-cost, open community DB2 Express-C and DB2 Developer Workbench. Learn how to create a new database, create a table with XML and relational columns, populate the table, and query XML data with XQuery.

Link to Tuitorial



May 18, 2007

to find tablespace status, type , usage run following SQL

select substr(tablespace_name,1,20) Tablespace_name, case t.TBSPACETYPE when ‘S’ then ‘System Managed’

                  when 'D' then 'Database managed'

end as TBSManaged, s.total_pages Total_pages, s.used_pages Used_pages, (s.total_pages-s.USABLE_PAGES ) Overhead_pgs, s.NUM_CONTAINERS No_of_containers s.free_pages Free_pages, case t.DATATYPE when ‘A’ then ‘ ALL typ perm ‘

               when 'L'  then ' Large '
               when 'T'  then ' System Temp'
               when 'U'  then ' User Temp '

end as TBStype, case s.TABLESPACE_STATE when 0 then ‘ Normal ‘ when 1 then ‘ Quiesced: SHARE ‘ when 2 then ‘ Quiesced: UPDATE ‘ when 4 then ‘ Quiesced: EXCLUSIVE ‘ when 8 then ‘ Load pending ‘ when 16 then ‘ Delete pending ‘ when 32 then ‘ Backup pending ‘ when 64 then ‘ Roll forward in progress ‘ when 128 then ‘ Roll forward pending ‘ when 256 then ‘ Restore pending ‘ when 512 then ‘ Disable pending ‘ when 1024 then ‘ Reorg in progress ‘ when 2048 then ‘ Backup in progress ‘ when 4096 then ‘ Storage must be defined ‘ when 8192 then ‘ Restore in progress ‘ when 16384 then ‘ Offline and not accessible ‘ when 32768 then ‘ Drop pending ‘ when 33554432 then ‘ Storage may be defined ‘ when 67108864 then ‘ Storage Definition is in (final) state ‘ when 134217728 then ‘ Storage Definition was changed prior to rollforward ‘ when 268435456 then ‘ DMS rebalancer is active ‘ when 536870912 then ‘ TBS deletion in progress ‘ when 1073741824 then ‘ TBS creation in progress ‘ end TABLESPACE_STATE from table(snapshot_tbs_cfg(’ ‘,-1)) as s, sysibm.systablespaces t where s.tablespace_name = t.tbspace ;

If any load issues.

also to find & fix sapce usage

select substr(tablespace_name,1,20) TBSPACE,total_pages,used_pages,free_pages, (used_pages/total_pages ) * 100 usedPCT from table(snapshot_tbs_cfg(’ ‘,-1)) as tbs order by 5 desc

For more details



I have installed the last version of DB2 for Microsoft Windows Vista, after I have installed the product, seems everything goes work, but somehting happend that I don’t understand:
1. The service gows work.(DAS,instance…etc);
2. neither message I get.
but everytime that I try to create some database, I get that:

not start database manager command was issued, SQLSTATE=57019.

but that happen when I’m using : CLP,Control Center, whatever…

Anybody can I help me ??

Nielsen



Read full story



copy DB2 database

Author: DB2UDB Admin
May 6, 2007

HEllo/
How I can copy database to another computer? Can I use copy-past or I must use special function for copying? I use DB2 ExpressC v8.2 on both computers.

Read full story



May 6, 2007

Hi, This is a tip to compile PyDB2 python module with DB2 9 Express-C on Linux.

1) install DB2 9 Express-C

2) download PyDB2-1.1.0-2.tar.gz
http://sourceforge.net/projects/pydb2/

3) tar zxvf PyDB2-1.1.0-2.tar.gz
4) cd PyDB2-1.1.0
5) vi setup.py
6) modify 2 lines

DB2_ROOT = “/opt/ibm/db2/V9.1/”
library_dirs=[db2_root_dir+'lib32'],

7) sudo python setup.py install

Read full story



DB2 Express-c v9 running on RHEL5

Author: DB2UDB Admin
May 4, 2007

Does DB2 express-c v9 run on Red Hat Enterprise Linux 5 (RHEL5)?

Installing express-c v9 on RHEL5:

The following library files could not be loaded by db2langdir in
/home/Owner/Desktop/exp/disk1/db2/Linux/install/.. /bin
–> libstdc++.so.5
–> libstdc++.so.5

My release of RHEL5 has the following file: libstdc++.so.6.0.8

DOES DB2 Express-c v9 run on RHEL5 or DO I have to install RHEL4?



Read full story



May 2, 2007

I have DB2 client installed on my computer. Start CLP and do db2 load to a DB2 server… and i received this error…

“SQL3025N A parameter specifying a filename or path is not valid.”

When I do it on the server considering the file is on the server, it works just fine.
When i do it from another machine while the file is on the client machine, the load utility somehow can’t locate the file.

Is there a way to load a file remotely using db2 load? Thx.

Read full story



Opening a report in new page

Author: DB2UDB Admin
May 2, 2007

Hi, I’ve got several problems triying to open a jsp with a inside.

I’m trying to do this to make a to see a drillThrough.

This is my code:

The parametters are ok. This is my error message:

05/07 10:03:15:995 CEST] 3bf210c1 WebGroup E SRVE0026E: [Error de servlet]-[]: null ( null )
at com.alphablox.server.tags.report.AbstractTag.throwException(Unknown Source)
at com.alphablox.server.tags.framework.BloxTagSupport.doStartTag(Unknown Source)
at org.apache.jsp._SomeReportBlox._jspService(_SomeReportBlox.java:202)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:351)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:705)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:803)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1171)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:203)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:300)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:246)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:652)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:458)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Caused by: java.lang.NullPointerException
at com.alphablox.server.tags.report.AbstractTag.putBloxInContext(Unknown Source)
at com.alphablox.server.tags.report.ReportTag.doStartTagInternal(Unknown Source)
… 27 more

Also, the project is working fine in portal mode. The jsp that I’m trying to open is not a portlet.

Can anyone help me, please?

Thank you!

Read full story