Step One: Create New tablespace
SQL>Create tablespace datafile ‘\osama.dbf’ size 1G;
Step Two : Check User On which Tablespace
SQL> select owner, tablespace_name from dba_tables where owner=”
Step three:Create Script
sqlplus / as sysdba
spool osama.log
SQL> select ‘alter table ‘ || table_name || ‘ move tablespace mytab ;’ from dba_tables where owner=” ;
Spool off ;
Step Four : Move Index
SQL> select ‘Alter index ‘ || index_name || ‘ rebuild tablespace mytab ;’ from dba_indexes where owner=” ;
Step Five : Check Again
SQL> select owner, tablespace_name from dba_tables where owner=”;
Thank you
Osama mustafa
Like this:
Like Loading...
Related
Published by Osama Mustafa
Osama considered as one of the leaders in Cloud technology, DevOps and database in the Middle-East. I have more than ten years of experience within the industry. moreover, certfied 4x AWS , 4x Azure and 6x OCI, have also obtained database certifications for multiple providers.
In addition to having experience with Oracle database and Oracle products, such as middle-ware, OID, OAM and OIM, I have gained substantial knowledge with different databases.
Currently, I am architecting and implementing Cloud and DevOps. On top of that, I'm providing solutions for companies that allow them to implement the solutions and to follow the best practices.
View all posts by Osama Mustafa
I tried many scripts but didn't worked for all objects. You can't move clustered objects from one tablespace to another, for that you will have to use expdp. So I will suggest expdp is the best option to move all objects to different tablesapce.Below is the command.nohup expdp \”/ as sysdba\” DIRECTORY=test_dir DUMPFILE=users.dmp LOGFILE=users.log TABLESPACES=USERS &
LikeLike