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 first published in July 2006

Dig deeper on Oracle database backup and recovery

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close