IronFritz
IronFritz

Reputation: 11

Move data file on oracle db like mssql

For a client application, I would like to manage different DBs, depending to data I would like to use in a particular moment. I can't change the code of application, and I've found a solution really pretty for MSSQL, but I need to replicate it also with Oracle DB. Please consider that the application has an "hardcoded" connection to DB (name and host).

With MSSQL, I've found this solution starting from collection different datafiles for the same DB (called XXDB), each datafile contains different data, so I can easily change data in this way:

In this way I'm able to change quickly the data used for application testing.

I would like to replicate this simple path on Oracle DB 10g, is that possible?

Do I need to evaluate other solution to switch data mantaining the same name and user to connect to DB?

Thank you!

Upvotes: 0

Views: 307

Answers (2)

Nick.Mc
Nick.Mc

Reputation: 19194

Can you clarify: your code already connects to and works against an Oracle database, you just need a solution to change around the source data in Oracle for testing?

The backend of Oracle is far more complicated than SQL and I suggest you forget about automating Oracle datafiles to get different datasets.

The normal way to change datasets for testing is to point your app a different instance/database/user, rather than hard coding a conection in the app. As it is, an Oracle connection string is totally different to a SQL connection string so you already need to change the connection details in your App to do this.

Upvotes: 0

Justin Cave
Justin Cave

Reputation: 231681

The closest analogue would be to use transportable tablespaces assuming that all the objects are in one (or more) self-contained tablespaces. Though the process is broadly similar to what you're doing in SQL Server, it's not going to be nearly as seamless in Oracle. Transportable tablespaces were designed to let you efficiently move very large quantities of data from one database to another, not for this sort of thing.

How much data are we talking about? Using DataPump to export and import the data as needed may well be an easier solution that doesn't sacrifice much performance.

Upvotes: 1

Related Questions