Home » RDBMS Server » Server Administration » create table script
create table script [message #55941] Tue, 25 February 2003 16:50 Go to next message
bechir
Messages: 23
Registered: November 2001
Junior Member
Does any one know from where I can retrieve create-table scripts?
Re: create table script [message #55943 is a reply to message #55941] Tue, 25 February 2003 23:41 Go to previous messageGo to next message
Ravi
Messages: 251
Registered: June 1998
Senior Member
If you are having oracle 9i you can use this
SET LONG 10000
SELECT DBMS_METADATA.GET_DDL('TABLE','EMP')
where EMP is the name of the table for which you want to generate the script.

If you have older versions you can use TOAD utility to get the same.

Regards,
Ravi
Re: create table script [message #55953 is a reply to message #55941] Wed, 26 February 2003 08:27 Go to previous messageGo to next message
bechir
Messages: 23
Registered: November 2001
Junior Member
Do I have to be logged on as the table owner to get the script?

You said 'If you have older versions you can use TOAD utility to get the same.' Does that mean TOAD cann't be used with oracle 9i?

Thanks
Bechir
Re: create table script [message #55962 is a reply to message #55941] Wed, 26 February 2003 15:31 Go to previous message
Trifon Anguelov
Messages: 514
Registered: June 2002
Senior Member
If you have Oracle version < 9i, then export this table with rows=n, open the dump file and get the DDL for it. Remove any " which might have and blank spaces.

If you want to do that for more than 1 table, get DataBee tool. It's free and can do that for you. See This link for more inofrmation.

If you have => 9i - use DBMS_METADATA package.

Hope that helps,

clio_usa
OCP - DBA

Visit our Web site

Previous Topic: Oracle database copy
Next Topic: Arch failed in alert log
Goto Forum:
  


Current Time: Sat Dec 28 21:00:43 CST 2024