Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Migrate tables and indexes from the user's current tablespace to another tablespace

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

View the storage of objects for INV users

Select * from dba_segments ds where ds.owner='INV'

-- default tablespace users

Create tablespace INV

Create tablespace inv datafile'/ oradata/ocm/inv01.dbf 'size 200m autoextend on next 10m maxsize 2048m extent management local segment space management auto

Set the default tablespace to INV

Alter user inv default tablespace inv

Set linesize 200

Set pagesize 2000

Set term off verify off head off feedback off echo off

Spool mtiddl.sql

Select 'alter' | | ds.segment_type | |''| | ds.owner | |'. | | ds.segment_name | |''| |

Decode (segment_type, 'TABLE',' MOVE', 'INDEX',' REBUILD') | |

'tablespace INV;'

From dba_segments ds

Where ds.owner = 'INV'

AND (segment_type = 'INDEX' OR segment_type =' TABLE')

Spool off

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report