How do you move tables from one tablespace to another tablespace?

1 Answer

Answer :

There are several methods to do this;
1) export the table, drop the table, create the table definition in the new
tablespace, and then import the data (imp ignore=y).
2) Create a new table in the new tablespace with the CREATE TABLE statement AS SELECT all from source table command:
CREATE TABLE temp_name TABLESPACE new_tablespace AS SELECT * FROM source_table;
Then drop the original table and rename the temporary table as the original:
DROP TABLE real_table;
RENAME temp_name TO real_table;

Related questions

Description : Can one rename a tablespace? (for DBA)

Last Answer : No, this is listed as Enhancement Request 148742. Workaround: Export all of the objects from the tablespace Drop the tablespace including contents Recreate the tablespace Import the objects

Description : What view would you use to determine free space in a tablespae?

Last Answer : DBA_FREE_SPACE

Description : How do you add a data file to a tablespace

Last Answer : ALTER TABLESPACE ADD DATAFILE SIZE

Description : Name a tablespace automatically created when you create a database.

Last Answer : The SYSTEM tablespace.

Description : What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace?

Last Answer : A temporary tablespace is used for temporary objects such as sort structures while permanent tablespaces are used to store those objects meant to be used as the true objects of the database.

Description : What does coalescing a tablespace do?

Last Answer : Coalescing is only valid for dictionary-managed tablespaces and de- fragments space by combining neighboring free extents into large single extents.

Description : Which parameter specified in the DEFAULT STORAGE clause of CREATE TABLESPACE cannot be altered after creating the tablespace?

Last Answer : All the default storage parameters defined for the tablespace can be changed using the ALTER TABLESPACE command. When objects are created their INITIAL and MINEXTENS values cannot be changed.

Description : How do I find used/free space in a TEMPORARY tablespace? (for DBA

Last Answer : Unlike normal tablespaces, true temporary tablespace information is not listed in DBA_FREE_SPACE. Instead use the V$TEMP_SPACE_HEADER view: SELECT tablespace_name, SUM (bytes used), SUM (bytes free) FROM V$temp_space_header GROUP BY tablespace_name;

Description : What is Tablespace Quota ?

Last Answer : The collective amount of disk space available to the objects in a schema on a particular tablespace.

Description : What is default tablespace ?

Last Answer : The Tablespace to contain schema objects created without specifying a tablespace name.

Description : How does one prevent tablespace fragmentation? (for DBA)

Last Answer : Always set PCTINCREASE to 0 or 100. Bizarre values for PCTINCREASE will contribute to fragmentation. For example if you set PCTINCREASE to 1 you will see that your extents are going to have weird and ... /O may be required to fetch the additional blocks where extent maps of the segment are stored.

Description : What is a Tablespace?

Last Answer : A database is divided into Logical Storage Unit called tablespaces. A tablespace is used to grouped related logical structures together

Description : Explain the relationship among Database, Tablespace and Data file.?

Last Answer : Each databases logically divided into one or more tablespaces one or more data files are explicitly created for each tablespace

Description : Can a Tablespace hold objects from different Schemes ?

Last Answer : Yes.

Description : Can a tablespace hold objects from different schemes?

Last Answer : Yes.

Description : Explain the relationship among database, tablespace and data file.

Last Answer : Each databases logically divided into one or more tablespaces one or more data files are explicitly created for each tablespace.

Description : What is SYSTEM tablespace and when is it created?

Last Answer : Every Oracle database contains a tablespace named SYSTEM, which is automatically created when the database is created. The SYSTEM tablespace always contains the data dictionary tables for the entire database.

Description : What is a tablespace?

Last Answer : A database is divided into Logical Storage Unit called tablespaces. A tablespace is used to grouped related logical structures together.

Description : What is a Locally Managed Tablespace?

Last Answer : Locally Managed Tablespace is a tablespace that record extent allocation in the tablespace header. Each tablespace manages its own free and used space within a bitmap structure stored in one of the ... tracks adjacent free space) ▪ Changes to the extent bitmaps do not generate rollback information

Description : What is a Tablespace?

Last Answer : A tablespace is a logical storage unit within an Oracle database. Tablespace is not visible in the file system of the machine on which the database resides. A tablespace, in turn, ... three types of tablespaces in Oracle: ▪ Permanent tablespaces ▪ Undo tablespaces ▪ Temporary tablespaces

Description : What is the use of TABLES option in EXP command ?

Last Answer : List of tables should be exported.ze)

Description : A table is classified as a parent table and you want to drop and re-create it. How would you do this without affecting the children tables?

Last Answer : Disable the foreign key constraint to the parent, drop the table, re- create the table, enable the foreign key constraint.

Description : Give the two types of tables involved in producing a star schema and the type of data they hold.

Last Answer : Fact tables and dimension tables. A fact table contains measurements while dimension tables will contain data that will help describe the fact tables.

Description : What are mutating tables

Last Answer : When a table is in state of transition it is said to be mutating. eg :: If a row has been deleted then the table is said to be mutating and no operations can be done on the table except select.

Description : What is the difference between deleting and truncating of tables

Last Answer : Deleting a table will not remove the rows from the table but entry is there in the database dictionary and it can be retrieved But truncating a table deletes it completely and it cannot be retrieved.

Description : What is in all those X$ tables? (for DBA

Last Answer : The following list attempts to describe some x$ tables. The list may not be complete or accurate, but represents an attempt to figure out what information they contain. One should generally not ... Fixed Table. It can predict the potential loss of decreasing the number of database buffers. The

Description : Can cursor variables be stored in PL/SQL tables.If yes how. If not why?

Last Answer : No, a cursor variable points a row which cannot be stored in a two- dimensional PL/SQL table.

Description : What are two virtual tables available during database trigger execution ?

Last Answer : The table columns are referred as OLD.column_name and NEW.column_name. For triggers related to INSERT only NEW.column_name values only available. For triggers related to UPDATE only OLD. ... values only available. For triggers related to DELETE only OLD.column_name values only available.

Description : Name the tables where characteristics of Package, procedure and functions are stored ?

Last Answer : User_objects, User_Source and User_error.

Description : How will you estimate the space required by a non- clustered tables?

Last Answer : Calculate the total header size Calculate the available dataspace per data block Calculate the combined column lengths of the average row Calculate the total average row size. Calculate the average number rows ... add 10 % additional space to calculate the initial extent size for a working table.

Description : What are the dictionary tables used to monitor a database space?

Last Answer : DBA_FREE_SPACE DBA_SEGMENTS DBA_DATA_FILES.

Description : What are the dictionary tables used to monitor a database spaces ?

Last Answer : DBA_FREE_SPACE DBA_SEGMENTS DBA_DATA_FILES.

Description : How does one get the view definition of fixed views/tables?

Last Answer : Query v$fixed_view_definition. Example: SELECT * FROM v$fixed_view_definition WHERE view_name='V$SESSION';

Description : Spurious tuples may occur due to i. Bad normalization ii. Theta joins iii. Updating tables from join a) i& ii b) ii & iii c) i& iii d) ii & iii

Last Answer : a) i& ii b) ii & iii

Description : Tables derived from the ERD

Last Answer : a) Are totally unnormalised b) Are always in 1NF c) Can be further denormalised d) May have multi-valued attributes (b) Are always in 1NF

Description : Can you make collection of Statistics for tables automatically?

Last Answer : YES. Oracle databse has default, scheduled job "gather_stats_job" that analyses stats on a daily basis during the maintenance window time. There are two scheduled activities related to ... GATHER_STATS_JOB'); Oracle collects optimizer statistics for SQL via the default of autostats_target = auto.

Description : Name the seven types of Oracle tables

Last Answer : Heap Organized Tables, Index Organized Tables, Index Clustered Tables, Hash Clustered Tables, Nested Tables, Global Temporary Tables, Object Tables.

Description : In SQL, the CREATE TABLESPACE isused A. to createa place in the databasefor storageof scheme objects, rollback segments, andnaming the data files to comprise the tablespace B. to createa database trigger C. to add/rename data files, to change storage D. All of theabove E. None of the above

Last Answer : to createa place in the databasefor storageof scheme objects, rollback segments, andnaming the data files to comprise the tablespace

Description : Can you increase the size of a tablespace ? How ?

Last Answer : Yes, by adding datafiles to it.

Description : What is a Tablespace?

Last Answer : A database is divided into Logical Storage Unit called tablespaces. A tabl

Description : Explain the relationship among Database, Tablespace and Data file.?

Last Answer : Each databases logically divided into one or more tablespaces one or more data files are explicitly created for each tablespace

Description : Can a Tablespace hold objects from different Schemes?

Last Answer : Yes.

Description : Which parameter specified in the DEFAULT STORAGE clause of CREATE TABLESPACE cannot be altered after creating the tablespace?

Last Answer : All the default storage parameters defined for the tablespace can be changed using the ALTER TABLESPACE command. When objects are created their INITIAL and MINEXTENS values cannot be changed.

Description : How can you increase the capacity of an Oracle tablespace? Note: there are 2 correct answers in this question A. Resize the existing data file B. Add a new data file to ... compression of backup data using Oracle advanced compression D. Increase the value of the database parameter DB_BLOCK_SIZE

Last Answer : B. Add a new data file to the existing tablespace

Description : What package procedure is used for calling another form ?

Last Answer : Call (E.g. Call(formname)

Description : How does one switch to another user in Oracle? (for DBA

Last Answer : Users normally use the "connect" statement to connect from one database user to another. However, DBAs can switch from one user to another without a password. Of course it is not advisable to ... tiger Connected. Note: Also see the su.sql script in the Useful Scripts and Sample Programs Page.

Description : What are various privileges that a user can grant to another user?

Last Answer : SELECT -CONNECT -RESOURCES

Description : An open form can not be execute the call_form procedure if you chain of called forms has been initiated by another open form?

Last Answer : True

Description : Can a view based on another view?

Last Answer : Yes.

Description : Can a View based on another View ?

Last Answer : Yes.