Solved

DB2 Error

Posted on 2001-07-10
5
599 Views
Last Modified: 2012-06-22
when I execute a query using the right function in the order by clause as below, select * from table order by right(col1,10) I am getting the following error.

SQL1585N A system temporary table space with sufficient page size does not exist.

The database has a temporary tablespace with 4KB as the page size. In the DB2 manuals to fix this prob it says remove the columns from the temporary table. Could any one tell what is to be done exactly to fix this.

Thanks
0
Comment
Question by:muralis
  • 3
  • 2
5 Comments
 
LVL 2

Expert Comment

by:missionImpossible
Comment Utility
How many columns do you have in your table? Do you really need all columns in the select? Can't you specify only the se columns you need, for ex. "select col1, col2, col3 from table order by right(col1,10)"? If this is not an answer for you, increase the page size. This will increase the max count of columns and the max length of rows (see below - DB2-help)

this is what DB2 help says:

   1.The row length of the temporary table exceeded the limit that can be accomodated in the largest temporary table space in the database.

   2.The number of columns required in a temporary table exceeded the limit that can be accomodated in the largest temporary table space in
     the database.

The temporary table space limits depend on its page size. These values are:

Max          Max   Page size of
Record       Cols  temporary
Length             table space
-----------  ----  ------------
1957  bytes  244   2K
4005  bytes  500   4K
8101  bytes  1012  8K
16293 bytes  1012  16K
32677 bytes  1012  32K

User Response: Create a temporary table space of a larger page size supported, if one does not already exist. If such a table space already
exists, eliminate one or more columns from the temporary table. Create separate tables or views, as required, to hold additional information
beyond the limit.


hope this helps, good luck
0
 

Author Comment

by:muralis
Comment Utility
It is not working even if i specify one column in the select list. Well what I would like to know is how to increase the page size for a database. I have the database with the page size as 4KB. What is the ideal page size to be set. And how to change it from 4KB to 8KB or any other higher value.
0
 
LVL 2

Accepted Solution

by:
missionImpossible earned 200 total points
Comment Utility
you cannot increase the page size of an existing tablespace. You have to create a new tablespace (in your case a so called 'temporary tablespace' - used when 'order by' or 'like' is executed) with greater page size. Go on like this:

1. connect to your database (better local on server and not remote)
2. excecute: 'list tablespaces' and look for the 'temporary tablespace'(content = temporary data) and its ID.
3. excecute: 'list tablespace containers for YourID' YourID is normally = 1 (if it is a default tablespace)
4. CREATE TEMPORARY TABLESPACE temp2 PAGESIZE 8192 MANAGED BY SYSTEM USING ('/usr/lib/db2/db2inst1/db2inst1/NODE0000/SQL00019/SQLT0001.1') BUFFERPOOL yourBuffPool
//you have to change the container-path (/usr/...) to (new) file on your system (examples in db2-help ('create tablespace').

if you don't specify the BUFFERPOOL parameter (see 'create tablespace' in db2-help) the default BUFFERPOOL will be used (but this bufferpool has only 4K pages, so you have to create a new bufferpool, too (look for 'create bufferpool' in db2-help)

5. drop the first temporary tablespace: drop tablespace TEMPSPACE1  ('TEMPSPACE1' is the name of the tablespace, you get it by 'list tablespace'


ideal page size: If you specify a too short value, errors occur (such as you have/had), if you specify a too big value too much memory is used on the database-server. So you have to increase the page size by trial and error until the error does not occur any more.



0
 

Author Comment

by:muralis
Comment Utility
Good one, infact i did what you stated its working fine. Thanks.
0
 
LVL 2

Expert Comment

by:missionImpossible
Comment Utility
you're welcome
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now