I have inherited an oracle database, and have no Oracle experience. I have been tasked with building a 'clone' of the database on a new server. I am searching around, but not finding the things I am looking for, and perhaps my terminology is wrong.
Is there a way, in an oracle database, to run a command, and end up with a large SQL file that can be run on a new server, in order to create all the tables, functions, stored procedures, etc. I don't want any actual data, just the structure of the database. This will be used for a new customer, and we definitely don't want to share the previous customers data.
This DB has been in use for several years, and has hundreds of tables, stored procedures, etc, with no kind of centralized control, so i need to pull it from the running DB. (and archive it away in source control!)
Unless your oracle version is 9 or below you really want to avoid exp or imp, they're less flexible and less powerful than the replacements expdp and impdp.
I'm assuming you want to export just a schema. If you want to export a whole database instance (not advisable), i.e. with all the sys/system/etc. schemas and tablespaces, use full=y and no schema statament.
To accomplish what you ask with expdp do something like:
To get a text file with sql statements you would do the following using the above created dumpfile:
The command you want will look something like:
exp username/password file=emp.dmp log=emp.log rows=no
Here's a FAQ on exp/imp: http://www.orafaq.com/wiki/Import_Export_FAQ as well as http://www.orafaq.com/wiki/Export and http://www.orafaq.com/wiki/Import
Note that
exp
generates a binary file, not a text file with SQL statements like, say, mysqldump.Also, there's a http://dba.stackexchange.com site which may help you better.