unload/load issue
CUBRID Official Forum » General Discussions » unload/load issue
|
author
|
message
|
|
|
Post subject: unload/load issue Post date: 2012.09.11 |
|
registered: 09/08/2012 IP: *.96.215.239 views: 3 |
After a successful unload/load operation I noticed something strange regarding the order of the records in a table: - from development server
- from the production server
The records come in the reverse order. Why is that? Thanks, |
| Quote | |
|
|
# Post subject:Re: unload/load issue Post date: 2012.11.09 |
|
registered: 03/29/2010 IP: *.181.249.254 |
Hi Dragos, CUBRID does not keep records in a specific order. It puts them according to how it finds space for the entries. That's why if no "ORDER BY" is specified, the records may appear in different order in different databases. Best regards, The CUBRID Team |
| Quote | |
|
|
# Post subject:Re: unload/load issue Post date: 2012.11.09 |
|
registered: 09/08/2012 IP: *.96.215.239 |
So, using unload/load I cannot preserver the records order, right? But if I want this, what are the steps to be followed? Thanks, Dragos |
| Quote | |
|
|
# Post subject:Re: unload/load issue Post date: 2012.11.09 |
|
registered: 11/08/2011 IP: *.181.249.254 |
Use order by in queries. This is the only way to ensure an order for select queries. Add indexes for the columns that you're using for ordering and everything should be ok. |
| Quote | |
|
|
# Post subject:Re: unload/load issue Post date: 2012.11.09 |
|
registered: 09/08/2012 IP: *.96.215.239 |
I understand, thanks. |
| Quote | |
|
|
# Post subject:Re: unload/load issue Post date: 2012.19.09 |
|
registered: 03/29/2010 IP: *.181.249.254 |
One way to keep the order of the records is to use this approach: 1. Export all tables from a database in SQL format for example (other formats are available also); 2. Delete the records from the tables in the database where you want to copy the records to 3. Import all SQL files (one will be created for each table) in the other database. Optionally, if no tables exist in the destination database, you must export the schema of the first database also and import it into the second database. |
| Quote | |
|
|
# Post subject:Re: unload/load issue Post date: 2012.20.09 |
|
registered: 09/08/2012 IP: *.96.215.239 |
I will try this. Thanks! |
| Quote | |
