Reputation: 4094
I need a reasonably quick way to setup a test database that mirrors production.
Upvotes: 2
Views: 101
Reputation: 51445
Cloning a schema and the associated tables and indexes are easy. Others have suggested mysqldump.
Selecting the most recent 100 rows of each of the tables is easy if and only if there are no foreign keys. If there are foreign keys, you'll have to develop a process to select the rows you want, and the associated rows, to maintain the referential integrity of the schema.
Upvotes: 0
Reputation: 8278
different vendors provide import\export APIs and tools that implement them (command-line and GUI). Usually export query looks something like
CREATE EXTERNAL TABLE :exportFileAbsolutePath
USING
(
DELIMITER '',''
Y2BASE 2000
REMOTESOURCE ''JDBC''
ESCAPECHAR ''\''
)
AS SELECT {1}
FROM SCHEMA.{0}
Which DB vendor you work with?
Sorry did not see mysql tag. see http://snippets.dzone.com/posts/show/360
Upvotes: 0
Reputation: 59660
Upvotes: 0