What is the best way to refresh test data with Production data Automatically ? I am using Oracle database.
export the production database using expdp
drop the contents of the test database
import the production dump using impdp
Related
how can I move data from one to another with command not with import/export?
How much data? You could set up a view in your local database to a table in the remote database using dblink. Then query the view.
I am a newbie to SQL DBA, I wanted to understand the following concepts
What is the difference between a Database migration & Database Refresh in SQL?
Suppose we want to migrate a database from one instance to other instance, can we follow the below method
Create a new DB in the destination instance with the same name as the source instance
Refresh destination DB with Source DB, & copy all the user access
Database migration:
Moving a database from one server to other usually will do for database upgrades.
Database Refresh in SQL:
Overwrite the existing data in the database with other database data using backup files. Usually will refresh production data to UAT or DEV for data/Issue analysis.
Suppose we want to migrate a database from one instance to other instance, can we follow the below method?
Yes you can follow.
If you are using sql server 2012 and above then you can go for contained database options.
Can SQL Server or db2 do entire database exports like oracle (using exp command)?
I've searched the internets and found bcp for SQL Server. But it seems I would have to iterate over all the tables to get what I want.
For db2 it looks to be roughly the same. Is there something I'm missing? Anyone have any suggestions and/or any opinions? Thanks ahead of time.
This is for SQL SERVER
Backup & Restore
To take an entire database with SQL Server, you can do a BACKUP and RESTORE
BACKUP: http://msdn.microsoft.com/en-us/library/ms186865.aspx
RESTORE: http://msdn.microsoft.com/en-us/library/ms186858.aspx
Export and Import
You can right click a database in SQL Server Management Studio, and under TASKS, click on EXPORT DATA. Follow the Wizard to choose the objects you want to export and put them into the appropriate location.
Custom SSIS for Raw format
Build a SSIS package that will read data from source table and put it into a RAW file on disk for later use. Raw files holds the structure of the table and the data.
DB2 for Linux, UNIX, and Windows has a utility called db2move, which generates the DDL to rebuild the database from scratch, and iterates through all the tables to dump their contents to flatfiles via the EXPORT command.
I have 2 copies of database, one on local PC other on production server (web site). I insert data into my local copy. How can I upload the newly inserted data (in local-copy) to production server?
I recommend you generate insert scripts and then run them on the prod server.
There are many tools to do this: a popular one is RedGate SQL Data Compare.
You can create an incremental backup and restore it on prod.
Or use Import/Export Wizard if you can gather the new data using several queries.
Add the other machine as a "Linked Server" under "Server Objects".
Then access it like:
SELECT * FROM ServerPotato.DB_AWE.dbo.potato_prices
which is:
<Linked Server>.<Database>.<Schema Owner>.<Table>
The schema dbo is probably necessary, where normally you may write: DB_AWE..potato_prices
I'd like to perform an oracle dump of my data and then load it back in after re-installing the software.
The problem is however that as I re-install the software, the schema of the data which I just exported may have changed slightly.
In mysql, I would hand-edit the SQL formatted dump file before importing it to match any schema changes.
But Oracle uses a proprietary dump/load format :(
Any tricks to preserving my data? Thanks!
BH
You can export the data and import the data into another schema (created by you) and copy the data from your schema to newly created application schema with some sql statements.