I need to compare the 2 mysql database tables. there are around 50 tables in each DB.
my idea is
in DB1
extract result select * from table1; to alog file1
in DB2
extract result select * from table1; to alog file2
now compare log file 1 file 2
pls help me out ...
thanks in advance
thanks for ur responce
i first need to extract the table1 output(mysql) to a log file
ex: mysql> select * from table; >> /tmp/logfile
ctsgnb
October 24, 2010, 5:23am
4
Pls use the thanks button when a post helps
mysql> spool /tmp/logfile
mysql> select * from table;
mysql> spool off
??
by the way you might want to remove header before creating the spool ?
mysql> set head off
You also might want to sort your extraction so this would make further comparison easier
you could use the clause
... order by ... asc|desc
in your sql statement
hi
i think u can try this
sqlplus -s DATABASE << EOF > log_file_1
select * from table1
EOF
sqlplus -s DATABASE << EOF > log_file_2
select * from table2
EOF
diff log_file1 log_file2
Neo
October 24, 2010, 6:31am
6
aishsimplesweet:
hi
i think u can try this
sqlplus -s DATABASE << EOF > log_file_1
select * from table1
EOF
sqlplus -s DATABASE << EOF > log_file_2
select * from table2
EOF
diff log_file1 log_file2
Most people would not use a tool designed to work for an Oracle DB on MySQL.
SQLPlus is an interactive and batch query tool that is installed with every Oracle Database Server or Client installation. It has a command-line user interface, a Windows Graphical User Interface (GUI) and the iSQL Plus web-based user interface.
SQL*Plus has its own commands and environment, and it provides access to the Oracle Database.
For MySQL you should use MySQL tools.