Q

Copying selected tables from one user to another

I want to copy only selected table structures from one user to another user in Oracle.

I want to copy only selected table structures from one user to another user in Oracle.
Sign on as SYSTEM and use the CREATE TABLE AS SELECT (CTAS) command similar to the following:
CREATE TABLE bob.tableX AS SELECT * FROM tom.tableX;
The above will create a table owned by BOB as a duplicate of the table that is currently owned by TOM. If you only want the structure and no rows of data, use the following:
CREATE TABLE bob.tableX AS SELECT * FROM tom.tableX WHERE 0=1;
This was last published in July 2006

Dig Deeper on Oracle database backup and recovery

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close