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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

generating sqlplus script from oracle

Status
Not open for further replies.

tiggerpooh

Technical User
Jan 12, 2001
1
0
0
US
Hi,

I want to dump the current contents of my oracle database into an sqlplus script file. I'm especially looking for a file consisting of a bunch of INSERT statements. What command will allow me to do this?

In Microsoft SQL, one can do this. Can this be done in Oracle too?
 
you can (SQL might get a little ugly) but why do you need to wrap insert/values around rows? why not just do select * w/redirect to flat file and use SQL*Loader (or equivilant) on the other side? If you need the DDL for tables you can extract it using the export utility.

more info on exactly what you are trying to do might be helpful
 
In order to do this, first set up several statements
SET ECHO OFF
SET FEEDBACK OFF
SET PAGESIZE 0
SPOOL xxxx.sql
put sql statements here such as
select 'DROP TABLE '||object_name ||';' from user_objects where object_type = 'TABLE'
SPOOL OFF
SET ECHO ON

This is found in the Student Guide for the ORACLE Advanced SQL and SQL PLUS class
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top