75

I have exported database from Oracle SQL developer tool into .sql file. Now I want to run this file which is of size 500+ MB.

I read about running scripts here, but I didn't understand the way. Is there any command or query by which we can run this sql script by providing path?

2
  • How did you export, using EXPDP? Is it a dump file or just a .sql file? Commented Jul 22, 2015 at 10:28
  • Tool -> Export Database ... I didn't get any other way Commented Jul 22, 2015 at 10:31

3 Answers 3

150

You could execute the .sql file as a script in the SQL Developer worksheet. Either use the Run Script icon, or simply press F5.

enter image description here

For example,

@path\script.sql;

Remember, you need to put @ as shown above.

But, if you have exported the database using database export utility of SQL Developer, then you should use the Import utility. Follow the steps mentioned here Importing and Exporting using the Oracle SQL Developer 3.0

Sign up to request clarification or add additional context in comments.

9 Comments

where should I run this command? Because I can get query explorer screen after click on one of present db
@Rushikesh Open a SQL Worksheet and then do as I said above.
I gave a 12GB .sql file of my whole database and the Oracle SQL Developer just Crashed :(
Thanks for the tip ! Works like a charm (example on Windows : @D:\Scripts\import.sql)
If you have spaces in your path use "..." for example: @"c:\temp\big path with spaces\sqltool - oracle.sql"
|
2

You need to Open the SQL Developer first and then click on File option and browse to the location where your .sql is placed. Once you are at the location where file is placed double click on it, this will get the file open in SQL Developer. Now select all of the content of file (CTRL + A) and press F9 key. Just make sure there is a commit statement at the end of the .sql script so that the changes are persisted in the database

3 Comments

Unfortunately, when the file is 500+ MB as asked in the question, the SQL developer will fail to open it.
In my case, the file is 2.5MB, and SQL Developer fails to open it.
Lalit's answer is the correct one, just make sure you put sufficient commits in your script if it is a very long file. (Provided you are happy committing as you go!!!)
0

You can use Load function

Load TableName fullfilepath; 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.