How do I export a 'database' from Oracle 11g XE and import it to Oracle 10.2? - windows

Up to this point, I've never done anything serious with an Oracle database. I know that they are different than what I've handled, like MS SQL.
So, coming from an MS SQL perspective, I can backup a database, copy over the .bak file to another server, restore it, creating a complete copy of the database.
I'm not sure how to do the same for Oracle, much less different versions. I've seen it done mostly with command lines, so I tried this:
$exp owner/owner schemas=tkcsdb directory=dumpdir dumpfile=dBaseName logfile=dBaseLog
And then the SQL Plus returns:
Unknown Parameter Name 'Schemas'.
Failed to process parameters.
Export terminated unsuccessfully.
I've since replaced the 'schemas' with 'schema' (same error), and I wanted to try using 'tables', though I'm not sure how that would turn out. I'm not even 100% if 'tkcsdb' is the name of the database I'm looking for - I've been unable to list all the databases I have.
What I want to do (which I've done with MS SQL, MySQL, and even IBM DB2 of all things) is looking to be quite difficult to replicate in Oracle.
As with the title, how do I export a 'database' from Oracle 11g XE and import it to Oracle 10.2?
I'm using Windows 7, the target machine is a Linux Fedora of some sort.

EXP and IMP are ancient - do not use them unless you absolutely have to. They cannot handle some of the features of newer Oracle versions.
The tools of choice are EXPDP and IMPDP (short for EXP datapump and IMP datapump).
Unfortunately, using them is a little more complicated, because you can run them only on the database server (contrary to old-style EXP/IMP, which you could run from any client computer).
So, to get your schema from the 11g source DB to the 10g target DB, you'll have to:
open a terminal session on the 11g DB server
run expdp with version set to 10 (so you can import it on the 10g server)
copy the dump file fom the 11g server to the datapump directory of the 10g server (look for a directory called "dpump")
open a terminal session on the 10g DB server
run impdp with your dump file
Example:
expdp scott/tiger#db11g version=10.2 schemas=SCOTT dumpfile=SCOTT.dmp logfile=expdpSCOTT.log
impdp scott/tiger#db10g schemas=SCOTT dumpfile=SCOTT.dmp logfile=impdpSCOTT.log

Related

Oracle XE 18c impdp dump from 19c

I have a dump file that is created using expdp from Oracle 19c (exported with version parameter 18). Is it even possible to import the dumpfile to an Oracle 18c XE database?
The structure and everything else from the 19c database is unknown to me. I just got the 13gb dumpfile.
While using impdp it says:
Connected to: Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
ORA-39002: invalid operation
Thats it.
In /opt/oracle/diag/rdbms/xe/XE/trace/alert_XE.log it says:
XEPDB1(3):DW00 started with pid=62, OS id=23288, wid=1, job SYSTEM.SYS_IMPORT_FULL_01
2020-12-09T15:25:55.364764+00:00
XEPDB1(3):Resize operation completed for file# 9, old size 266240K, new size 276480K
Is there a another logfile I don't know about?
Anyways, my command looks like this:
impdp user/password#localhost/xepdb1 DIRECTORY=import_dir DUMPFILE=dump.expdp nologfile=y version=18 full=y
Yes, the user is privileged to do so.
Yes, the import_dir is set with CREATE DIRECTORY and the user is also privileged to use this directory.
I'm lost.
edit: I used stackoverflow for many years now and this is my very first question since I'm NEW to oracle in general and as I stated above: I'm lost.
2nd edit:
It's still the same error even after I try to partially import the dump with parameters like tables=
Perhaps your dump file is too big. Oracle XE has some limitations.
See the Oracle documentation:
https://www.oracle.com/database/technologies/appdev/xe.html
Resources:
Up to 12 GB of user data
Up to 2 GB of database RAM
Up to 2 CPU threads
Up to 3 Pluggable Databases

Oracle Database Backup in DBeaver

I am new to Oracle databases. I have installed DBeaver (never used this before too) to connect to the database.
I have created a connection (which I believe is called database) and now I am able to see the database tables and everything. How do I take the backup of the Oracle Database in DBeaver so I can use it locally for test purposes before making any change on live database?
I can't find any option to take the backup of connection/database.
To do a proper backup of your Oracle Database, you should use the oracle provided utility, Recovery Manager. It's a command line interface that's called from your DB server shell prompt via 'RMAN'
You can also use Data Pump to export all or part of a database that can be used to import to another database...not really used for recovery of an existing database.
I'm not aware of your tool having interfaces for either of these Oracle features.
You might not need a backup at all for your needs, take a look at Oracle Flashback Technology.
DBeaver does not support oracle database export import. See details here:
https://dbeaver.com/docs/wiki/Backup-Restore/
You need to run the sqlplus tool to create a folder where oracle is going to import/export database dumps. Login should happen as sys as sysdba and enter the password you previously entered during database server installation. Example:
sqlplus sys/[your password] as sysdba
After you successfully logged into sqlplus run the following command (don't forget to set to a different folder that you prefer to use):
create or replace directory DATA_PUMP_DIR as 'D:\Database Backups';
Once this is done exit from sqlplus and enter the following command into the command line (again no sqlplus should be used here)
expdp sys/[your password]#localhost:1521/[listener name] file=your-database-dump-file.dmp owner=[your schema]
Once this is done and finished you can zip your database dump if you would like to upload it somewhere else. (I had 9 GB dump and the zipped size was 1.6 GB)

invalid argument value and bad dump file specification when I try to impdp in Oracle 11g

I'm trying get the SQL DDL statements from a Data Pump dmp file. However I'm getting this when I run impdp:
Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31619: invalid dump file "D:\Oracle\dmp\mydmp.dmp"
I'm trying to run this command:
impdp myuser/password directory=mydir dumpfile=mydmp.dmp sqlfile=myddl.sql logfile=mylog.log;
My user got pretty much all privileges and read, write access to the directory.
I'm doing this to retrieve the tablespaces from this dmp file.
My end goal is to fully restore this database that was done from another machine. I was told that before importing this DB to a new machine that I need to get the tablespaces and re-create the same ones on the new machine. The old machine also had a different user.
Sorry if all this sounds basic. It's my first time playing with Oracle DB.
Any advise or guidance would be greatly appreciated.
Thank You

Oracle 12C: ORA-00406: COMPATIBLE parameter needs to be 12.2.0.0.0

We have a 2 current Oracle 10G(10.2.0.1) production databases, and we are planning to migrate to a new database server with Oracle 12C. Since data is for each database is only around 5GB, the best way to create a new instance and use data pump to transfer data. To achieve this, I created a database link from the Oracle 12C database to the 10G, and use that to expdp the data from the 12C database. However when I import the exported data I have around tables that have an error like this:
ORA-39083: Object type TABLE:"USER"."WH_SEARCH_ACT" failed to create with error:
ORA-00406: COMPATIBLE parameter needs to be 12.2.0.0.0 or greater
ORA-00722: Feature "Partition Read Only"
Is there any solution to this other than adding the COMPATIBLE parameter in the production database? This is production so I can't really just update/modify the current production database. Any other solutions here, because i don't like just create the tables before importing the data pump file.
Use the version parameter in the data pump utility. For example:
expdp hr/hr TABLES=hr.employees VERSION=10.2
DIRECTORY=data_pump_dir DUMPFILE=emp10g.dmp LOGFILE=emp.log
Just make sure the version of the export utility is 10g and import utility is 12G. Hope this helps.
In the production database . you can use exp program
exp username/password buffer=64000 file=/path/to/path.dmp full=y
copy exp dump file to oracle 12c and use
imp username/password buffer=64000 file=/path/to/path.dmp full=y

Oracle : Use two different versions of EXP on the same machine?

i have a server (HP-UX) installed with Oracle 10g and several databases on it.
I've been asked to make dumps from these tables for a Oracle 8i database. In order to do this, i need to use the 8i version of the EXP (export) tool of Oracle.
It is still installed on my server but when i want to use it, i get the following error :
EXP-00056: ORACLE error 12705 encountered
ORA-12705: Cannot access NLS data files or invalid environment specified
I presume some files are missing or maybe one of the folder is not in the PATH but i can't find and i really don't want to break the 10g installation.
Someone knows how to do ?
Thanks
Install a 10G client on another system, without modifying the 8I database server,
and connect from the client to the 8I database. Use the export utilities on
the client to generate the export file.

Resources