?
Solved

DB2 Error

Posted on 2001-07-10
5
Medium Priority
?
617 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 2

Expert Comment

by:missionImpossible
ID: 6277059
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
ID: 6279663
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 800 total points
ID: 6279894
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
ID: 6280251
Good one, infact i did what you stated its working fine. Thanks.
0
 
LVL 2

Expert Comment

by:missionImpossible
ID: 6280422
you're welcome
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

764 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