Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extract whole schema from oracle database to another (java) (automation)

I am trying to find a solution that I can hopefully implement a regression test from one oracle database against another oracle DB via data.

Example: Database A adds a table, I want to take the data from database A and import it into database schema B. This will ultimately fail and I will know there was a change of some kind and can correct it.

I would like to automate this in Jenkins is possible for a nightly test. I found several paid versions but at this point in the project that is not necessary.

I am using Liquibase but I was unable to find a plugin for Jenkins. I am aware Sql Developer can do this but I want this to be automated.

If anyone has any past experiences or know any tools I would great appreciate the advice.

like image 253
Mike3355 Avatar asked Jun 26 '18 07:06

Mike3355


People also ask

How do I export and import a schema in Oracle?

On the Database menu, point to Export & Import, and then click Schema Import. Select an export script file to import and a target schema. If an export script file contains the CREATE DATABASE statement, the data will be imported to the created schema, not to the selected one.

How do I transfer data from one database to another in Oracle?

When copying between Oracle databases, you should use SQL commands (CREATE TABLE AS and INSERT) or you should ensure that your columns have a precision specified. The USING clause specifies a query that names the source table and specifies the data that COPY copies to the destination table.


1 Answers

Have you considered Oracle Data Pump? With it you can export data and/or schema metadata from one database and import it into another. There is a command line interface and a PL/SQL API.

like image 167
eaolson Avatar answered Nov 15 '22 07:11

eaolson