How to run .sql file in Oracle SQL developer tool to import database?

SqlOracleOracle Sqldeveloper

Sql Problem Overview


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?

Sql Solutions


Solution 1 - Sql

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

Solution 2 - Sql

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

Solution 3 - Sql

As others recommend, you can use Oracle SQL Developer. You can point to the location of the script to run it, as described. A slightly simpler method, though, is to just use drag-and-drop:

  • Click and drag your .sql file over to Oracle SQL Developer
  • The contents will appear in a "SQL Worksheet"
  • Click "Run Script" button, or hit F5, to run

enter image description here

Solution 4 - Sql

You can use Load function

Load TableName fullfilepath; 

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMadhusudanView Question on Stackoverflow
Solution 1 - SqlLalit Kumar BView Answer on Stackoverflow
Solution 2 - SqlSandeepView Answer on Stackoverflow
Solution 3 - SqlWoodchuckView Answer on Stackoverflow
Solution 4 - SqlBipil RautView Answer on Stackoverflow