Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating SQL Scripts

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How can I generate SQL scripts of my DB under Oracle 8i release 8.1.7?
And then how can I run them into a new database?

thank you
 
Since you don't give a lot of information here, I am going to GUESS that you are tring to write the scripts to recreate the instance objects. I have used DBA Studio, right click on the object, and then choose SHOW OBJECT DDL. This shows the code used to create that object. I cut and paste this into an SQL text file. The only pain is that you have to do this for each object in your DB.

Remember to get the tablespaces, rollback segments, users, tables, indexes, everything... Also remember, some objects (database links) could be under PUBLIC.

Hope that helps, if not, please provide more information. Terry
**************************
* General Disclaimor - Please read *
**************************
Please make sure your post is in the CORRECT forum, has a descriptive title, gives as much detail to the problem as possible, and has examples of expected results. This will enable me and others to help you faster...
 
yeah that's what I wanted thanks. But I was looking for a automatic way to get the code for ALL the objects. It will be a real pain to do this when I have a lot of tables.
I need to do this to transfer a DB to another enterprise and the admin there asked me for scripts, I think a better solution would be to connect myself into their system and export my database... I'm really a newbie on Oracle so I'm not sure on what would be the more adequated step to do.
So if you can give me some tips please...
 
I must have misunderstood what you asked. Well, yes, you can EXPORT the database and then take that dump file to the new machine and IMPORT it. Take a look at the EXPORT/IMPORT utilities in your Oracle manual. If you don't have one, I am sure the DBA who made the request will have one...

BTW, it doesn't really take that long to create all of these. On a large database we have, it took me less than an hour to generate them all. I still like to have a copy of these CREATE scripts on hand, just in case something fails and an export ends up corrupted. Terry
**************************
* General Disclaimor - Please read *
**************************
Please make sure your post is in the CORRECT forum, has a descriptive title, gives as much detail to the problem as possible, and has examples of expected results. This will enable me and others to help you faster...
 
Another way to do this as a 'batch' is to use a tool like TOAD - ( Disclaimer: I do not now nor have I ever worked for them ) ; Check it out at
 
ok, I used the Show Object DDL to get the scripts, but I can't seem to find where the foreign keys are stored. I got the DDLs for the tables and for the Indexes (but here I can only find the Primary keys for the tables), I don't know where are the foreign keys stored...
and also I can't seem to use the import/export functions since I need to login to the Oracle Management server and I don't know how to do it >:-<
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top