cancel
Showing results for 
Search instead for 
Did you mean: 

DB2 Tablespace reorg

Former Member
0 Kudos
400

Hi All,

I want to reorg DB2 Tablespace in Linux as we have ECC6.0 Installed.

Can anyone please tell me the detailed steps for this.I need help in urgent guys.

As I have to do this for my Production System.Kindly help me out ASAP.

Many Thanks

Ajitabh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Ajitabh,

Check the below thread link for details on DB2 Tablespace Re-org.

"there is no native tablespace reorganization command for DB2 LUW but there is a job available in the SAP DBA Planning calendar called 'REORG of Tables in Tablespaces(s)'. This job can be used to reorganize all tables which are stored within a specific tablespace. It simply gets the list of all tables of this tablespace out of the SYSCAT and then calls the REORG command table by table. The job is sometimes useful to reduce the high-water mark of tablespaces and reclaim space. Reduction of the high-water mark might not be perfect, as the REORG command does not necessarily move tables to free parts at the beginning."



Thread link : http://scn.sap.com/thread/1181284

Hope it helps.

Mudasir

Former Member
0 Kudos

Hello Mudasir,

I am completely new into DB2.So can please send me any document regarding the same.

My Email ID is:ajitabh.dubey@gmail.com

It will be a great help if you can send me any doc with screenshot as well.

Many Thanks

Ajitabh

Former Member
0 Kudos

Hello Ajitabh,

Can you try with  the below db2 commands to re-org all the tables in tablespace.

" db2 -x "select 'reorg table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,50),';' \

from syscat.tables where type = 'T' and tbspace='<tablespace_name>'" > reorg.out

db2 -tvf reorg.out"


Reference link : http://www.dbatodba.com/db2/how-to-do/how-to-run-reorg-reorgchk-and-runstat-on-all-tables-in-a-datab...

Execute and let us know the output.

Mudasir.

Former Member
0 Kudos

Hi Mudasir,

Thanks for your reply.I want to know regarding the command:

As "tbspace =<tablespace_name>"

As I have to reorg every tablespace,so I have to enter every Tablespace name in the script?

Can you please send me a sample script for reference,so that I can generate it accordingly.

Many Thanks

Ajitabh

Answers (1)

Answers (1)

hugo_amo
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Ajitabh,

You'd better use the options in transaction DBACOCKPIT inside your SAP ECC system. Under Jobs, you can select DBA Planning Calendar. In the left hand side, you will see the available jobs you can schedule or run inmediately. Check the screenshot I have attached here.

Regards,

Hugo

Former Member
0 Kudos

Hi Hugo,

Thanks for your reply.I want to know which option is good for reorg?Is it online or offline?

Which one will be faster?If offline then can you please let me know the process for this?

Many Thanks

Ajitabh

hugo_amo
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Ajitabh,

The offline is faster. As I said go the the DBA Planning Calendar and you will see the available options.

Regards,

Hugo

Former Member
0 Kudos

Hello,

Check the DB13 options carefully.

There is some limitation on size for online reorg/runstats and for offline - for e.g. tables less than 1 GB something can be reorg'd online regularly and for big tables you may want to use offline option. Go through dbacockpit options carefully.

Former Member
0 Kudos

Hi All,

I have successfully reorg the Tables with the below command as:

db2 reorg table <Table Name>

As we have specific Tables which has to be reorged,so I have followed this way.

Now I want to know is there any specific commands in DB2 through which I can get the list

of the Reorged Tables?As my server is in Linux.
Kindly help me out ASAP.

Many Thanks

Ajitabh

Former Member
0 Kudos

Hi All,

Can anyone please let me know how to Reorg specific Tables which can be triggered by a Script.

i.e. I want a DB2 Script through which I can Reorg the Tables with one go.It will be really helpful for me.

Kindly Suggest Guys!!!!!

Many Thanks

Ajitabh