Copy Oracle database from Amazon RDS to a local Oracle developer edition database - oracle

I have an Oracle SE database that we run in Amazon's RDS service as our production database. I am looking for techniques and/or tools to duplicate the database to a developer edition database that the development team can run on their local systems.

You can generate dump file and transfer it to your local/standalone unix system where oracle is installed. and then import dump file data.

You do not have direct access to the RDS instance file system.
There are several data migration solutions.
The first solution using S3 Bucket.
Use DBMS_DATAPUMP to export to DUMP File on the RDS Instance.
Copy Dump File from the RDS instance to Amazon S3 Bucket.
Download the dump file from the S3 cloud to the developer edition database.
Import data from the dump file using expdp on the developer edition database.
The second solution using Database Link between the RDS Instance and the developer edition database.
Create a Database Link on the RDS Instance to the developer edition database.
Use DBMS_DATAPUMP to export to DUMP File on the RDS Instance.
Use DBMS_FILE_TRANSFER to Copy the Dump File from the RDS Instance to the developer edition database.
Import data from the dump file using expdp on the developer edition database.
The third solution using Oracle XE, if you cannot make a db link between the developer edition database and RDS instance.
Use DBMS_DATAPUMP to export to DUMP File on the RDS Instance.
Create a free instance of EC2(1 CPU core, 1G RAM, 30GD HDD ) or a
paid instance with a large disk and CPU.
Install a free database version of the Oracle XE version on EC2
instance.
Create a Database Link on the RDS Instance to the Oracle XE.
Use DBMS_FILE_TRANSFER to Copy the Dump File from the RDS Instance to the Oracle XE.
Copy files from the Oracle XE on EC2 instance via the sftp protocol on your PC.
Copy files from your PC to the developer edition database.
Import data from the dump file using expdp on the developer edition
database.
And other solutions without using DATA PUMP:
Export/Import Using Oracle SQL Developer.
Oracle Original Export/Import Original Utilities

Related

Migration from Oracle Database 11g to AWS RDS Oracle 19c Failures

When Migrating from Oracle Database 11g to AWS RDS Oracle Database 19c using the Oracle Datapump tool for export and the RDS Datapump API for Import resulted in some nasty errors.
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-39143: dump file "/rdsdbdata/datapump/test.dmp" may be an original export dump file
What I have tried
Changing the ownership of the dmp file
Using the full schema option
Adding the credentials
Migrating from oracle database 11g to Oracle Database 12c using traditional datapump functionality to resolve the compatibility issues resulted in the same issue mentioned above.
I resolve this issue by doing the following:
Granting permission to the schema to access the directory I was interested in storing the exported DMP file on the server.
Exporting the DMP using expdp (Data Pump)

Load .DMP oracle file from local machine to RDS Oracle

I am wandering around and didn't get an answer to this question.
is there any way to import Oracle .dmp file stored on a local machine to RDS Oracle?
If Yes how to do it?
Else why it's not possible to do so as other databases gave the flexibility to do these kinds of imports through more than one way.
You can't do that. When you import data with Oracle Data Pump, you must transfer the dump file that contains the data from the source database to the target database**. You can transfer the dump file using an Amazon S3 bucket or by using a database link between the two databases.
If your local machine contains a database and you have a network connection between your on-premises database and your Oracle RDS , then you can use NETWORK_LINK, although I don't recommend it. It is much better to tranfer the file using S3 bucket.
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Oracle.Procedural.Importing.html

Copy Oracle Database 11g XE to FreeNAS storage

I have a storage partition created by FreeNAS. In server 2012 machine, I map this storage to use for Oracle database 11g Express Edition.
But when I create new database in Oracle Database 11g Express Edition, I don't know how to specify location for it to store new database file in FreeNAS's storage.

How to export using DATA_PUMP to S3 bucket?

We have RDS (Oracle) instance, I need to export specific Schema into dumpfile. Export works and copies dump file into DATA_PUMP_DIR. Issue is that RDS do not have file directory access.
I need exported DMP file either on S3 or copy to another EC2 instance.
The article: LINK talks about copying data dump file between two RDS instances but not to S3 or EC2.
Third option. I am using it.
Take a look at alexandria-plsql-utils project, and especially look at: amazon_aws_auth_pkg, amazon_aws_s3_pkg and ftp_util_pkg packages.
Install required packages and dependencies.
Do your dump, then with such example code below you can copy file from Amazon RDS Oracle into S3 bucket.
declare
b_blob blob;
begin
b_blob := file_util_pkg.get_blob_from_file ('DATA_PUMP_DIR', 'my_dump.dmp');
amazon_aws_auth_pkg.init ('aws_key_id','aws_secret', p_gmt_offset => 0);
amazon_aws_s3_pkg.new_object('my-bucket-name', 'my_dump.dmp', b_blob, 'application/octet-stream');
end;
`
There are several ways to solve this problem.
First option.
Install a free database version of the Oracle XE version on EC2
instance(It is very easy and fast)
Export a schema from the RDS instance to DATA_PUMP_DIR
directory. Use DBMS_DATAPUMP package or run expdp user/pass#rds on EC2 to create a dump file.
Create database link on RDS instance between RDS DB and Oracle XE
DB.
If you are creating a database link between two DB instances inside
the same VPC or peered VPCs the two DB instances should have a valid
route between them.
Adjusting Database Links for Use with DB Instances in a VPC
Copy the dump files from RDS instance to Oracle XE DB on EC2 uses
the DBMS_FILE_TRANSFER.PUT_FILE via database link
Copy files from the DATA_PUMP_DIR directory Oracle XE on EC2 instance to the S3.
Second option.
Use the obsolete utility exp to export. It has restrictions on the export of certain types of data and is slower.
Run exp user/password#rds on EC2 instance.
Copy files from the directory Oracle XE on EC2 instance to the S3
Original export is desupported for general use as of Oracle Database
11g. The only supported use of Original Export in 11g is backward
migration of XMLType data to a database version 10g release 2 (10.2)
or earlier. Therefore, Oracle recommends that you use the new Data
Pump Export and Import utilities, except in the following situations
which require Original Export and Import:
Original Export and Import
It's now possible to directly access a S3 bucket from a Oracle database. Please have a look at the following documentation: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-s3-integration.html
And here the official news that this is supported: https://aws.amazon.com/about-aws/whats-new/2019/02/Amazon-RDS-for-Oracle-Now-Supports-Amazon-S3-Integration/?nc1=h_ls
It seems that the first post was a little bit to early to get this news. But anyway this post lists further good solutions like the database link.

How to migrate the existing database to oracle RDS

I need to migrate an existing application's database into oracle RDS database in Amazon Web services.
I have the dump file which is residing on an EC2 instance. The dump has not been taken by me.Also I would like to know how can I take the dump so that it can be imported successfully. The EC2 instance has an oracle regular client.
I have set up the oracle RDS instance in AWS and I am able to connect to the server.
I would like to know how can I import the database dump on RDS.
I am using this command :
imp rdsuser#oracledb FILE=fulldb.dmp TOUSER=rdsuser FROMUSER=SYSTEM log=test.log buffer=100000
Any lead is appreciated.
Also I would like to know what is the best method to import an existing database:
1. to take dump.
2. Or to take the clone of all files of database ( that will require the downtime in the server).
Best strategy is to take dump then import it into RDS . If your DB size is too big then contact AWS guys for help .

Resources