473,729 Members | 2,235 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

REORG TABLESPACE

Must admit, I am new to DB2:

Seems I can not issue command REORG TABLESPACE:

Commands Entered:
REORG TABLESPACE SBO_DB.TS_SBO_S AFE;

SQL0104N An unexpected token "TABLESPACE " was found following "REORG".

Expected tokens may include: "TABLE". SQLSTATE=42601

What am I doing wrong? According to helpfile it should work...

Mikael

Jul 5 '06 #1
9 17754
Mikael wrote:
Must admit, I am new to DB2:

Seems I can not issue command REORG TABLESPACE:

Commands Entered:
REORG TABLESPACE SBO_DB.TS_SBO_S AFE;

SQL0104N An unexpected token "TABLESPACE " was found following "REORG".

Expected tokens may include: "TABLE". SQLSTATE=42601

What am I doing wrong? According to helpfile it should work...

Mikael
Only REORG format I can find in the doc is:

REORG TABLE
REORG INDEXES

Larry Edelstein
Jul 5 '06 #2
Tks for your quick feedback

this link
http://publib.boulder.ibm.com/infoce...bjnbmstr28.htm

shows. Perhaps only under z/OS? We use DB2 V8.2.3 under Windows 2000
server.

Mikael Arhelger
Larry wrote:
Mikael wrote:
Must admit, I am new to DB2:

Seems I can not issue command REORG TABLESPACE:

Commands Entered:
REORG TABLESPACE SBO_DB.TS_SBO_S AFE;

SQL0104N An unexpected token "TABLESPACE " was found following "REORG".

Expected tokens may include: "TABLE". SQLSTATE=42601

What am I doing wrong? According to helpfile it should work...

Mikael
Only REORG format I can find in the doc is:

REORG TABLE
REORG INDEXES

Larry Edelstein
Jul 5 '06 #3
In article <11************ **********@m73g 2000cwd.googleg roups.com>,
mi************@ gmail.com says...
Tks for your quick feedback

this link
http://publib.boulder.ibm.com/infoce...bjnbmstr28.htm

shows. Perhaps only under z/OS? We use DB2 V8.2.3 under Windows 2000
server.
That's right. The DB2 for Windows (and linux/unix) docs can be found at
http://publib.boulder.ibm.com/infoce...help/index.jsp
Jul 5 '06 #4
ok. So, can not REORG TABLESPACE then.

How can I then REORG all my TABLES and INDEX easily without much
hassle. I do not want to be faced with the daunting task to go through
one by one.

This would be needed from time to time obviously.

Any utility (or whatever) out there that does the job? Perhaps
Highlight all the TABLES and INDEX and off you go?

Mikael Arhelger

Gert van der Kooij wrote:
In article <11************ **********@m73g 2000cwd.googleg roups.com>,
mi************@ gmail.com says...
Tks for your quick feedback

this link
http://publib.boulder.ibm.com/infoce...bjnbmstr28.htm

shows. Perhaps only under z/OS? We use DB2 V8.2.3 under Windows 2000
server.

That's right. The DB2 for Windows (and linux/unix) docs can be found at
http://publib.boulder.ibm.com/infoce...help/index.jsp
Jul 5 '06 #5

"Mikael" <mi************ @gmail.comschre ef in bericht
news:11******** **************@ 75g2000cwc.goog legroups.com...
ok. So, can not REORG TABLESPACE then.

How can I then REORG all my TABLES and INDEX easily without much
hassle. I do not want to be faced with the daunting task to go through
one by one.

This would be needed from time to time obviously.

Any utility (or whatever) out there that does the job? Perhaps
Highlight all the TABLES and INDEX and off you go?

Mikael Arhelger
Why not write a script that queries the DB2 Catalog Tables to generate REORG
TABLE / REORG INDEX statements for all your tables/indexes?

--
Jeroen
Jul 5 '06 #6
tks. but as I said, I am quite new to DB2 and it seems not so easy for
me. Any sample codes out there or somebdy can show me?

Mikael

Jeroen van den Broek wrote:
"Mikael" <mi************ @gmail.comschre ef in bericht
news:11******** **************@ 75g2000cwc.goog legroups.com...
ok. So, can not REORG TABLESPACE then.

How can I then REORG all my TABLES and INDEX easily without much
hassle. I do not want to be faced with the daunting task to go through
one by one.

This would be needed from time to time obviously.

Any utility (or whatever) out there that does the job? Perhaps
Highlight all the TABLES and INDEX and off you go?

Mikael Arhelger

Why not write a script that queries the DB2 Catalog Tables to generate REORG
TABLE / REORG INDEX statements for all your tables/indexes?

--
Jeroen
Jul 5 '06 #7
Mikael wrote:
tks. but as I said, I am quite new to DB2 and it seems not so easy for
me. Any sample codes out there or somebdy can show me?

Mikael

Jeroen van den Broek wrote:
>"Mikael" <mi************ @gmail.comschre ef in bericht
news:11******* *************** @75g2000cwc.goo glegroups.com.. .
ok. So, can not REORG TABLESPACE then.

How can I then REORG all my TABLES and INDEX easily without much
hassle. I do not want to be faced with the daunting task to go through
one by one.

This would be needed from time to time obviously.

Any utility (or whatever) out there that does the job? Perhaps
Highlight all the TABLES and INDEX and off you go?

Mikael Arhelger

Why not write a script that queries the DB2 Catalog Tables to generate
REORG TABLE / REORG INDEX statements for all your tables/indexes?

--
Jeroen
SELECT TABNAME FROM SYSCAT.TABLES WHERE TABSCHEMA = 'YOUR_SCHEMA'
SELECT INDNAME FROM SYSCAT.INDEXES WHERE INDSCHEMA = 'YOUR_SCHEMA'

Now you get table and index names in schema YOUR_SCHEMA.
Then you can write a sript that does the reorg:
SELECT 'REORG TABLE '|| RTRIM(LTRIM(TAB SCHEMA)) || '.' ||
RTRIM(LTRIM(TAB NAME)) FROM SYSCAT.TABLES WHERE TABSCHEMA = 'EMGSYS'
SELECT 'REORG INDEXES ALL FOR TABLE '|| RTRIM(LTRIM(TAB SCHEMA)) || '.' ||
RTRIM(LTRIM(TAB NAME)) FROM SYSCAT.TABLES WHERE TABSCHEMA = 'EMGSYS'

Now just copy the result (each column into one file) and run it:
DB2 CONNECT TO DB_NAME USER USER USING PASSWORD
DB2 -F your_table_file .sql
DB2 -F your_indexes_fi le.sql

Best regards,
Kovi

--
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
| Gregor Kovac | Gr**********@mi kropis.si |
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Jul 6 '06 #8
Ian
Mikael wrote:
ok. So, can not REORG TABLESPACE then.

How can I then REORG all my TABLES and INDEX easily without much
hassle. I do not want to be faced with the daunting task to go through
one by one.

This would be needed from time to time obviously.

Any utility (or whatever) out there that does the job? Perhaps
Highlight all the TABLES and INDEX and off you go?
Use the autonomic features. Read the docs on automatic maintenance,
specifically for Automatic Reorganization (AUTO_REORG).
Jul 6 '06 #9
Tks everybody! Pointed me in the right direction. Now I know where to
look.

By the way, it (REORG) does not flush out Orphans, correct? Got some
in the System Tables it seem after doing db2ckmig to preapre for
upgrade to V9.

Mikael

Ian wrote:
Mikael wrote:
ok. So, can not REORG TABLESPACE then.

How can I then REORG all my TABLES and INDEX easily without much
hassle. I do not want to be faced with the daunting task to go through
one by one.

This would be needed from time to time obviously.

Any utility (or whatever) out there that does the job? Perhaps
Highlight all the TABLES and INDEX and off you go?

Use the autonomic features. Read the docs on automatic maintenance,
specifically for Automatic Reorganization (AUTO_REORG).
Jul 6 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
7538
by: Raquel | last post by:
This question if for UDB on LUW. Suppose I take regular database backups of my database Monday: database backup <ts1> Tuesday: Tablespace reorged and imagecopied <ts2> Friday: database restored and roll-forwarded to a timestamp <ts3> on Wednesday. Now my question is: because the entire database is being roll-forwarded, I suppose the database roll forward operation will
1
2259
by: Dale Franklin | last post by:
This should be a rather ROUTINE procedure for you DBAs. I keep hearing at technical conferences and user groups the phrase "then rebind all your plans and packages" (after reorg, load, & runstats, etc). Obviously those plans and packages that need rebinding are only those packages & plans relevant to the tablespace just processed. How do I find out? (I'm on DB2 v7, MVS) I've read five (5) 6-pound books on DB2 (cover-to-cover)...
1
4713
by: Bruce Pullen | last post by:
db27.2 (fp13) on AIX 5.2. The following error is generated when attempting a reorg or, more precisely, when the file associated with the reorg tablespace reaches 1Gb. SQL2216N SQL error "-968" occurred while reorganizing a database table. I can happily export to a file > 1Gb as the same userid (who created
9
7139
by: mike_dba | last post by:
I am using DMS raw. I have a tablespace which is defined with 5 containers each allocated at 1.5 GB for a total of about 7.5 GB. I did a major deletion followed by a reorg and a runstats. I am not regaining as much space as anticipated. Additionally, the syscat.tables and syscat.indexes show my usage to be small. How do I determine who is using all the space ? The list tablespaces shows - Usable pages = 7.4 GB Used pages = 6.2 GB
6
3863
by: Konstantin Andreev | last post by:
Hello, all. Let the tablespace SY810T4K is almost full: --------------- db2 =list tablespaces show detail ... Name = SY810T4K Type = Database managed space Contents = Any data Total pages = 332800
2
3841
by: sethwai | last post by:
Hi, I have a nightly script that executes inplace reorgs allow write access for several tables after a previous script does a large number of delete operations. It usually has been executing fine. The other night 3 of them failed due to the log file system filling up. I resumed them individually and they all completed successfully. To eliminate the log space problem I changed the script to wait for one to complete before startng...
0
1537
by: jpautot | last post by:
Hi, I use REORG TABLESPACE with DISCARD option to delete selected records from a table and to write them in a file. But the process create a file SYSREC with the entire table records. For a table with a sizeable volume, the cost is important. Then I want to optimize the process in not writting those records. I tried NOSYSREC option, but it didn't work. I tried to code DDname with DUMMY but it didn't work better. The SYSIN of the...
0
2248
by: bwmiller16 | last post by:
Hi All - OSName: AIX NodeName: dr_aixdb01 Version: 5 Release: 3 dr_aixdb01$db2level DB21085I Instance "db2inst1" uses "64" bits and DB2 code release "SQL08027"
3
3695
by: jane | last post by:
Hi, Just wondering, is there any way to do the online reorg to use temporary tablespace instead of tablespace table existed. since that is really a waste to have some space allocated aside only for the online reorg ..
0
8913
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8761
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9280
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9142
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6016
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.