Re: insert or load ? best practices and performance
Rick, first off all tks for your help. Your tips worked fine for me. I created the following SQL file:
DROP TABLE IF EXISTS eodquotes_old; -- comes into effect after first day
CREATE TABLE eodquotes_new LIKE eodquotes; -- easy to create identical schema
RENAME TABLE eodquotes TO eodquotes_old, eodquotes_new TO eodquotes; -- zero downtime
LOAD DATA INFILE 'c:/teste/gerados/saida_load.txt' INTO TABLE eodquotes FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'; -- very fast
I use windoes installation, but I tried to call the sql file externally and it didnt work. tried mysql -h localhost - u root - p - e "source <batch file>" and I get an erro: ERROR at line 1: Failed to open file 'c:\teste\gerados\Carrega_IBOV.sql', error:
2
whats wrong ? can you help me ? another question: I need this bacth to run from DOS prompt every day, what do I need to do to conect directly without having to type a password ? whats the best practice for this ? tks again
Subject
Views
Written By
Posted
3923
September 16, 2010 01:19PM
1193
September 17, 2010 09:27AM
1092
September 21, 2010 11:16AM
1079
September 21, 2010 03:29PM
1128
September 17, 2010 06:37PM
1059
September 20, 2010 06:44AM
1011
September 20, 2010 10:43AM
Re: insert or load ? best practices and performance
1147
September 20, 2010 12:49PM
1211
September 20, 2010 06:28PM
1098
September 21, 2010 06:52AM
1036
September 21, 2010 11:07AM
1047
September 22, 2010 12:14PM
1139
September 22, 2010 07:20PM
1160
September 23, 2010 08:17AM
998
September 23, 2010 09:27PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.