Assuming that the newly created table structure should reside on the same
tablespace on which the first table is residing:
CREATE TABLE <<owner2.table2>> AS SELECT * FROM <<owner1.table1>> WHERE
ROWNUM < 1;
Assuming that that the newly created table structure should reside on a
different tablespace:
CREATE TABLE <<owner2.table2>> TABLESPACE <<new_tablespace_name>> AS SELECT
* FROM <<owner1.table1>> WHERE ROWNUM < 1;
PS: Please note that the above command will only copy the table structure
with out copying the indexes and constraints existing on the table. You will
have to re-create any indexes/constraints that are existing on the table.
Regards,
Sridhar Nimmagadda
-----Original Message-----
From: Dhanya
[mailto:oracledba-ezmlmshield-x3556427.[Email address protected]
Sent: Thursday, December 02, 2004 12:10 PM
To: LazyDBA Discussion
Subject: How will you copy the structure of a table without copying the
data?
How will you copy the structure of a table without copying the data?
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page