Import .sql file in Oracle? - oracle

I have .sql file. I need to import that to oracle 11g.
.sql file contains ddl queries for all tables.
How can i import .sql file to oracle 11g.
I have sqldeveloper tool.
Thanks in Advance.

From SQL Developer or Toad
Open --> File --> /locationofyourfile/yourfile.sql.
Once you have the file opened in SQL Developer or Toad,
execute by F5
From SQLPlus
#/locationofyourfile/yourfile.sql

# Physical path of sql file.
eg. If my file is on c: and file name is beckup.sql. Then command will be as follows(On console - sqlplus):
# c:\backup.sql

Related

Import Oracle DUMP file in oracle instance 19c

I have an oracle .dmp file and I do not know any other information about that, I want to import this dump file to my oracle 19c database.
When I use the imdb command like this:
impdp DIRECTORY=E:\Oracle19c\db_home\admin\sample\bdump DUMPFILE=tf20200325.dmp
I get these errors:
Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39087: directory name E:\ORACLE19C\DB_HOME\ADMIN\SAMPLE\BDUMP is invalid
When I use the imp command like this:
imp file=E:\Oracle19c\db_home\admin\sample\bdump\tf20200325.dmp full=y;
I get these errors:
IMP-00038: Could not convert to environment character set's handle
IMP-00000: Import terminated unsuccessfully
I tried after searching on the web, but not found any solution to help me.
notable: I am not creating any databases, I only create a user with all privileges.
The directory you specify is the name of a database directory object, not the actual directory. So, connect to your db as SYS, and do
create directory xyz as 'E:\Oracle19c\db_home\admin\sample\bdump\';
grant all on directory xyz to (put your user name);
and then you can use it like this:
impdp directory=xyz .....

Importing DMP file into oracle 10g xe

I exported backup file of user hr By using this command
exp hr/usman file=c:\backup\hr.dmp owner=hr
Now I am importing dmp file into oracle 10 express edition after importing dmp file tables are not showing in user or schema.
imp system/sys file=c:\backup\hr.dmp fromuser=hr touser=hr

How to restore database with impdp

I have Oracle 12c database and I execute expdp command to create dump file. Later I want to be able to restore database using this dump file, on the same location as where the dump was created from. I don't want to stop database, which is required to drop schema (or execute any 'shutdown immediate', which is required for doing the same with flashbacks).
If I execute impdp with remap_schema=myschema:myschema, I get many errors. When I try it with table_exists_action=replace, I also get errors (ORA numbers: 31684, 39111, 39083, 31085, 39325, 31061, 06512, 29329).
How can I restore database in the same location? Thanks!

Oracle: Import CSV file unix

i want to import csv file into oracle database using pl / sql developer, i inform you that the base is installed under linux, and pl / sql under windows, i ran the command:
SQL> #C:\app\session_name\product\11.2.0\client_3\BIN\sqlldr user/passwd#base_name control=/opt/FNDBSS/Control/FNControl.txt log=log.txt;
but the error has appeared: Error reading file
thank you for helping me
A the least add the LOG file to the command line or your control file. It tells you what loader is doing and perhaps why. Additionally check into the BAD and DISCARD files. See the SQL Loader concepts for your Oracle version.

Importing Oracle dmp file into AWS RDS

We're trying to import a dmp file that is on our local machine onto an external database on AWS RDS. We have tried using the Toad GUI tool and get the error:
IMP-00038: Could not convert to environment character set's handle
The dmp file is encoded with ANSI encoding which I'm assuming is what Toad should be expecting.
From what we have read we need to use imp rather than impdp (PL/SQL developer import dump) since we have the file locally.
There doesn't seem to be an option on Oracle SQL Develop to import from a dmp file.
We have tried using IMPDP with the command:
IMPDP usr/pass#connection directory='our_local_dir' dumpfile='file.dmp' logfile='log.txt'
We got the error:
UDI-00014: invalid value for parameter, 'directory'
I'm just looking for any advice on how to import this dmp file and which tools we need to use.

Resources