cancel
Showing results for 
Search instead for 
Did you mean: 

Database Table Rename and Index Rename

Former Member
0 Kudos

Dear Experts,

I'm facing a problem about data storage & Database management.

I need to "drop" a table with huge data inside, avoiding the use of the SE14 or Database Utility, but using another table and rename one into another.

To let you understand better my point of view:

  • I've Table A with name TableA with over 1 Billion records (it has a varchar inside, too) with only primary index (TableA~0)
  • I've made a Table B equal to TableA with no records and primary index TableB~0.

I want to:

Rename TableA as TableC

Rename TableB as TableA

Rename TableC as TableB

Rename primary indexes from TableA~0 to TableC~0,

Rename primary indexes from TableB~0 to TableA~0,

Rename primary indexes from TableC~0 to TableB~0.


Is it possible to use FMs DB_RENAME_TABLE and DB_RENAME_INDEX? And - if so - how?


Thanks a lot,

Fabio

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ganesh,

I've never said that tableC exists .

I've only two tables and use TableC (not exists) as temporary name.

But my question was about the right use of FMs and the way to fill data inside them.

Fabio

Former Member
0 Kudos

Hi Fabio,

My understanding was wrong about TableC. Sorry for that.

Yes. It's possible to rename tables and index using mentioned function modules.

Once objects renamed, check objects existence in run time and database too.

Regards,

Ganesh

Former Member
0 Kudos

Hi Ganesh,

thanks for your reply, I'd like to know also the way to use FMs mentioned.

It's only needed to put Tables/Indexes name inside and run F8?

No preceeding steps?

After done, we need to run a DB Commit?

Thanks for your kindness,

Fabio

Former Member
0 Kudos

Yes Fabio.

It's only needed to put tables/Indexes and then F8. Once its executed verify the objects in Data dictionary.

Example:

Old table: ZTABLEB

New Table: ZTABLEZ

After the rename of the table, Login to system with DDIC user on client 000.

Goto t-code SE14 and enter new table name ZTABLEZ and edit option

from menu -> Table -> Reconstruct

then Goto t-code SE11 and activate your new table.

If you have any doubts, create one Z* table and rename to perform test to avoid conflict of doing changes on live table.

Hope this helps.

Regards,

Ganesh

Former Member
0 Kudos

Hi Fabio,

Renaming tables and indexes are possible with mentioned function modules. However, your approach is not possible as TableA can't be renamed when TableC exists.

Your approach should in two steps for each object.

1st step :

Rename TableA as TableC1

Rename TableB as TableA1

Rename TableC as TableB1

2nd Step:

Rename TableC1as TableC

Rename TableA1 as TableA

Rename TableB1 as TableB

Same approach for Indexes.

Make sure these tables are not in use.

Hope this helps.

Regards,

Ganesh