<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3747503186976344232</id><updated>2024-08-30T05:21:10.793-07:00</updated><title type='text'>Luis Roncancio Data Tech Docs</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mysqlnotesandtips.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://mysqlnotesandtips.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Luis F. Roncancio</name><uri>http://www.blogger.com/profile/00717206216885685280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpt1hPtAD5gbBdFOXDlNdtmX-NjX9y8jf48H8pFZbV7lHVGLxEJXkbpQoGqI2rl7DOCuGBlEN83AmyLP-a1RL6KJjmY9XoPnv8JnWdshJQybTnIFE58BigPAwylgdpzlQ/s220/foto.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3747503186976344232.post-6050443294636888250</id><published>2011-04-07T08:57:00.000-07:00</published><updated>2011-04-07T09:03:36.057-07:00</updated><title type='text'>Useful MySQL Functions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
--Validate Email address&lt;br /&gt;
&lt;br /&gt;
DELIMITER $$&lt;br /&gt;
DROP FUNCTION IF EXISTS is_valid_email $$&lt;br /&gt;
CREATE FUNCTION `is_valid_email`(p_email varchar(150)) RETURNS tinyint(1)&lt;br /&gt;
BEGIN&lt;br /&gt;
CASE&lt;br /&gt;
WHEN NOT (SELECT p_email REGEXP &#39;^[A-Z0-9._%-]+@[A-Z0-9-]+[\.]{1}[A-Z]{2,4}$&#39;)&lt;br /&gt;
THEN&lt;br /&gt;
RETURN FALSE;&lt;br /&gt;
ELSE&lt;br /&gt;
RETURN TRUE;&lt;br /&gt;
END CASE;&lt;br /&gt;
END $$&lt;br /&gt;
DELIMITER ;&lt;br /&gt;
&lt;br /&gt;
--Only Alphabetical characters&lt;br /&gt;
&lt;br /&gt;
DELIMITER $$&lt;br /&gt;
DROP FUNCTION IF EXISTS is_alphabetical_string $$&lt;br /&gt;
CREATE FUNCTION `is_alphabetical_string`(p_string varchar(150)) RETURNS tinyint(1)&lt;br /&gt;
BEGIN&lt;br /&gt;
CASE&lt;br /&gt;
WHEN NOT (SELECT p_string REGEXP &#39;^[A-Za-z]*$&#39;)&lt;br /&gt;
THEN&lt;br /&gt;
RETURN FALSE;&lt;br /&gt;
ELSE&lt;br /&gt;
RETURN TRUE;&lt;br /&gt;
END CASE;&lt;br /&gt;
END $$&lt;br /&gt;
DELIMITER ;&lt;br /&gt;
&lt;br /&gt;
--Only Digits&lt;br /&gt;
&lt;br /&gt;
DELIMITER $$&lt;br /&gt;
DROP FUNCTION IF EXISTS is_digit_string $$&lt;br /&gt;
CREATE FUNCTION `is_digit_string`(p_string varchar(150)) RETURNS tinyint(1)&lt;br /&gt;
BEGIN&lt;br /&gt;
CASE&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;WHEN NOT (SELECT p_string REGEXP &#39;^[0-9]*$&#39;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;THEN&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;RETURN FALSE;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ELSE&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;RETURN TRUE;&lt;br /&gt;
END CASE;&lt;br /&gt;
END $$&lt;br /&gt;
DELIMITER ;&lt;br /&gt;
&lt;br /&gt;
--Only Alphanumeric characters&lt;br /&gt;
&lt;br /&gt;
DELIMITER $$&lt;br /&gt;
DROP FUNCTION IF EXISTS strip_non_alpha $$&lt;br /&gt;
CREATE FUNCTION `strip_non_alpha`(_dirty_string varchar(110)) RETURNS varchar(110)&lt;br /&gt;
BEGIN&lt;br /&gt;
DECLARE _length int;&lt;br /&gt;
DECLARE _position int;&lt;br /&gt;
DECLARE _current_char varchar(1);&lt;br /&gt;
DECLARE _clean_string varchar(110);&lt;br /&gt;
SET _clean_string = &#39;&#39;;&lt;br /&gt;
SET _length = LENGTH(_dirty_string);&lt;br /&gt;
SET _position = 1;&lt;br /&gt;
WHILE _position &amp;lt;= _length DO&lt;br /&gt;
SET _current_char = SUBSTRING(_dirty_string, _position, 1);&lt;br /&gt;
IF _current_char REGEXP &#39;[A-Za-z0-9]&#39; THEN&lt;br /&gt;
SET _clean_string = CONCAT(_clean_string, _current_char);&lt;br /&gt;
END IF;&lt;br /&gt;
SET _position = _position + 1;&lt;br /&gt;
END WHILE;&lt;br /&gt;
RETURN CONCAT(&#39;&#39;, _clean_string);&lt;br /&gt;
END $$&lt;br /&gt;
DELIMITER ;&lt;br /&gt;
&lt;br /&gt;
--Get a sample from a data set&lt;br /&gt;
&lt;br /&gt;
DELIMITER $$&lt;br /&gt;
DROP PROCEDURE IF EXISTS staging.get_random_sample $$&lt;br /&gt;
CREATE PROCEDURE staging.get_random_sample (p_source_schema varchar(64),p_source_table varchar(64),p_target_schema varchar(64),p_target_table varchar(64),p_percentage int)&lt;br /&gt;
BEGIN&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;DECLARE v_source_num_rows int DEFAULT 0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;DECLARE v_target_num_rows int DEFAULT 0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;DECLARE v_row_num int DEFAULT 0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;DECLARE i int DEFAULT 0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;SET @select_stmt = concat(&#39;SELECT COUNT(*) INTO @v_source_num_rows&#39;,&#39; FROM &#39;,p_source_schema,&#39;.&#39;,p_source_table);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;prepare select_stmt from @select_stmt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;execute select_stmt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;SET @v_target_num_rows = ROUND(@v_source_num_rows*p_percentage/100);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;SET @create_stmt = concat(&#39;CREATE TABLE &#39;,p_target_schema,&#39;.&#39;,p_target_table,&#39; LIKE &#39;,p_source_schema,&#39;.&#39;,p_source_table);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;prepare create_stmt from @create_stmt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;execute create_stmt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;WHILE @v_target_num_rows &amp;gt; i DO&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SELECT FLOOR(1+RAND() * @v_source_num_rows) - 1 INTO v_row_num;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SET @insert_stmt = concat(&#39;INSERT INTO &#39;,p_target_schema,&#39;.&#39;,p_target_table,&#39; SELECT * FROM &#39;,p_source_schema,&#39;.&#39;,p_source_table,&#39; LIMIT &#39;,v_row_num,&#39;\,1&#39;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;prepare insert_stmt from @insert_stmt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;execute insert_stmt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SET i = i + 1;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;END WHILE;&lt;br /&gt;
END $$&lt;br /&gt;
DELIMITER ;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlnotesandtips.blogspot.com/feeds/6050443294636888250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2011/04/useful-mysql-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/6050443294636888250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/6050443294636888250'/><link rel='alternate' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2011/04/useful-mysql-functions.html' title='Useful MySQL Functions'/><author><name>Luis F. Roncancio</name><uri>http://www.blogger.com/profile/00717206216885685280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpt1hPtAD5gbBdFOXDlNdtmX-NjX9y8jf48H8pFZbV7lHVGLxEJXkbpQoGqI2rl7DOCuGBlEN83AmyLP-a1RL6KJjmY9XoPnv8JnWdshJQybTnIFE58BigPAwylgdpzlQ/s220/foto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3747503186976344232.post-7937280522461108870</id><published>2010-10-19T06:11:00.000-07:00</published><updated>2010-10-19T06:12:20.374-07:00</updated><title type='text'>mod_jk instalation on ubuntu 9.4</title><content type='html'>Assuming Tomcat and Apache are installed and running&lt;br /&gt;
&lt;br /&gt;
1. Install the mod_jk&lt;br /&gt;
sudo su -&lt;br /&gt;
apt-get install libapache2-mod-jk&lt;br /&gt;
&lt;br /&gt;
2. Enable md_jk loading&lt;br /&gt;
cd /etc/apache2/mods-enabled&lt;br /&gt;
ln -s jk.load ../mods-available/jk.load&lt;br /&gt;
&lt;br /&gt;
3. Create the mod_jk conf file&lt;br /&gt;
cd /etc/apache2/mods-available&lt;br /&gt;
vi jk.conf&lt;br /&gt;
# Where to find workers.properties&lt;br /&gt;
# Update this path to match your conf directory location&lt;br /&gt;
JkWorkersFile /etc/libapache2-mod-jk/workers.properties&lt;br /&gt;
&lt;br /&gt;
# Where to put jk logs&lt;br /&gt;
# Update this path to match your logs directory location&lt;br /&gt;
JkLogFile /var/log/apache2/mod_jk.log&lt;br /&gt;
&lt;br /&gt;
# Set the jk log level [debug/error/info]&lt;br /&gt;
JkLogLevel info&lt;br /&gt;
&lt;br /&gt;
# Select the log format&lt;br /&gt;
JkLogStampFormat &quot;[%a %b %d %H:%M:%S %Y]&quot;&lt;br /&gt;
&lt;br /&gt;
# JkOptions indicate to send SSL KEY SIZE,&lt;br /&gt;
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories&lt;br /&gt;
&lt;br /&gt;
# JkRequestLogFormat set the request format&lt;br /&gt;
JkRequestLogFormat &quot;%w %V %T&quot;&lt;br /&gt;
&lt;br /&gt;
# Shm log file&lt;br /&gt;
JkShmFile /var/log/apache2/jk-runtime-status&lt;br /&gt;
&lt;br /&gt;
4.Enable mod_jk configurations&lt;br /&gt;
cd ../mods-enabled&lt;br /&gt;
ln -s jk.conf ../mods-available/jk.conf&lt;br /&gt;
&lt;br /&gt;
5. Create a worker properties file&lt;br /&gt;
vi /etc/libapache2-mod-jk/workers.properties&lt;br /&gt;
workers.tomcat_home=/var/lib/tomcat6&lt;br /&gt;
workers.java_home=/usr/lib/jvm/java-6-sun&lt;br /&gt;
ps=/&lt;br /&gt;
worker.ajp13_worker.port=8009&lt;br /&gt;
worker.ajp13_worker.host=localhost&lt;br /&gt;
worker.ajp13_worker.type=ajp13&lt;br /&gt;
worker.ajp13_worker.lbfactor=1&lt;br /&gt;
&lt;br /&gt;
6.Configure url forwarding from Apache to Tomcat&lt;br /&gt;
cd /etc/apache2/sites-enabled&lt;br /&gt;
vi 000-default ##Which is a symbolic link to ../sites-available/default&lt;br /&gt;
&lt;VirtualHost *:80&gt;&lt;br /&gt;
...&lt;br /&gt;
    JkMount /examples/ ajp13_worker&lt;br /&gt;
    JkMount /examples/* ajp13_worker&lt;br /&gt;
    JkMount /docs/ ajp13_worker&lt;br /&gt;
    JkMount /docs/* ajp13_worker&lt;br /&gt;
...&lt;br /&gt;
&lt;/VirtualHost&gt;&lt;br /&gt;
##This will forward any request to /examples/ and /docs/ to Tomcat&lt;br /&gt;
&lt;br /&gt;
7. Configure AJP in Tomcat Server. &lt;br /&gt;
vi /etc/tomcat6/server.xml&lt;br /&gt;
##Uncomment the following line &lt;br /&gt;
&lt;Connector port=&quot;8009&quot; protocol=&quot;AJP/1.3&quot; redirectPort=&quot;8443&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
8. Restart Apache and Tomcat&lt;br /&gt;
/etc/init.d/tomcat6 restart&lt;br /&gt;
/etc/init.d/apache2 restart&lt;br /&gt;
&lt;br /&gt;
9. Test it&lt;br /&gt;
Open a browser&lt;br /&gt;
http://localhost:8080/examples&lt;br /&gt;
Then remove the port&lt;br /&gt;
http://localhost:/examples&lt;br /&gt;
&lt;br /&gt;
You must see the same content, so Apache is forwawrding the request to Tomcat to show /examples content</content><link rel='replies' type='application/atom+xml' href='http://mysqlnotesandtips.blogspot.com/feeds/7937280522461108870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2010/10/how-to-set-up-jdbcconnection-pool-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/7937280522461108870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/7937280522461108870'/><link rel='alternate' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2010/10/how-to-set-up-jdbcconnection-pool-for.html' title='mod_jk instalation on ubuntu 9.4'/><author><name>Luis F. Roncancio</name><uri>http://www.blogger.com/profile/00717206216885685280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpt1hPtAD5gbBdFOXDlNdtmX-NjX9y8jf48H8pFZbV7lHVGLxEJXkbpQoGqI2rl7DOCuGBlEN83AmyLP-a1RL6KJjmY9XoPnv8JnWdshJQybTnIFE58BigPAwylgdpzlQ/s220/foto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3747503186976344232.post-4753676271696405619</id><published>2010-10-08T14:16:00.000-07:00</published><updated>2010-10-08T14:17:51.258-07:00</updated><title type='text'>Postgres Stream replication set up</title><content type='html'>Master&lt;br /&gt;
-IP: 192.168.1.1 &lt;br /&gt;
-TCP Port: 5432&lt;br /&gt;
-Data directory: /var/lib/pgsql/9.0/data&lt;br /&gt;
-WAL directory: /var/lib/pgsql/9.0/data/wals&lt;br /&gt;
&lt;br /&gt;
Slave&lt;br /&gt;
-IP: 192.168.1.2 &lt;br /&gt;
-TCP Port: 5432&lt;br /&gt;
-Data directory: /var/lib/pgsql/9.0/data&lt;br /&gt;
-WAL directory: /var/lib/pgsql/9.0/data/wals&lt;br /&gt;
&lt;br /&gt;
Master configuration: ($ /var/lib/pgsql/9.0/data/postgresql.conf)&lt;br /&gt;
-listen_addresses = &#39;*&#39; &lt;br /&gt;
-port = 5432&lt;br /&gt;
-archive_mode = on&lt;br /&gt;
-archive_command = &#39;cp &quot;%p&quot; /var/lib/pgsql/9.0/data/wals/&quot;%f&quot; &lt; /dev/null&#39;&lt;br /&gt;
-max_wal_senders = 1&lt;br /&gt;
-wal_level = hot_standby&lt;br /&gt;
-hot_standby = on&lt;br /&gt;
&lt;br /&gt;
Authentication Configuration: ($ /var/lib/pgsql/9.0/data/pg_hba.conf)&lt;br /&gt;
-host    replication     all             10.16.35.213/23         trust&lt;br /&gt;
&lt;br /&gt;
Start Up the Master&lt;br /&gt;
/usr/pgsql-9.0/bin/postgres -D /var/lib/pgsql/9.0/data &amp;&lt;br /&gt;
&lt;br /&gt;
Make a Base Backup for stand by from the master (Snapshot)&lt;br /&gt;
$ psql -c &quot;SELECT pg_start_backup(&#39;base_backup&#39;)&quot;&lt;br /&gt;
$ cd 9.0/data&lt;br /&gt;
$ scp -rp x postgres@10.16.35.213:/var/lib/pgsql/9.0/data&lt;br /&gt;
$ psql -c &quot;SELECT pg_stop_backup()&quot;&lt;br /&gt;
&lt;br /&gt;
Slave Configuration ($ /var/lib/pgsql/9.0/data/postgresql.conf)&lt;br /&gt;
&lt;br /&gt;
-listen_addresses = &#39;*&#39; &lt;br /&gt;
-port = 5432&lt;br /&gt;
-archive_mode = on&lt;br /&gt;
-archive_command = &#39;cp &quot;%p&quot; /var/lib/pgsql/9.0/data/wals/&quot;%f&quot; &lt; /dev/null&#39;&lt;br /&gt;
-max_wal_senders = 1&lt;br /&gt;
-wal_level = hot_standby&lt;br /&gt;
-hot_standby = on&lt;br /&gt;
&lt;br /&gt;
$ rm -fr /var/lib/pgsql/9.0/data/postmaster.pid&lt;br /&gt;
$ rm -fr /var/lib/pgsql/9.0/data/pg_xlog/000*&lt;br /&gt;
$ rm -fr /var/lib/pgsql/9.0/data/pg_xlog/archive_status/*&lt;br /&gt;
$ rm -fr /var/lib/pgsql/9.0/data/wals/*&lt;br /&gt;
&lt;br /&gt;
Recovery configuration on the slave: (/var/lib/pgsql/9.0/data/recovery.conf)&lt;br /&gt;
standby_mode = &#39;on&#39;&lt;br /&gt;
primary_conninfo = &#39;host=192.168.1.1 port=5432 user=postgres password=postgres&#39;&lt;br /&gt;
restore_command = &#39;cp -i /var/lib/pgsql/9.0/data/wals/%f %p &lt; /dev/null&#39;&lt;br /&gt;
&lt;br /&gt;
Start up the slave&lt;br /&gt;
/usr/pgsql-9.0/bin/postgres -D /var/lib/pgsql/9.0/data &amp;&lt;br /&gt;
&lt;br /&gt;
Check the process&lt;br /&gt;
$ ps -fea | grep postgres&lt;br /&gt;
root     12121 11960  0 19:43 pts/1    00:00:00 su - postgres&lt;br /&gt;
postgres 12122 12121  0 19:43 pts/1    00:00:00 -bash&lt;br /&gt;
postgres 12823 12122  0 20:23 pts/1    00:00:00 /usr/pgsql-9.0/bin/postgres -D /var/lib/pgsql/9.0/data&lt;br /&gt;
postgres 12824 12823  0 20:23 ?        00:00:00 postgres: logger process                              &lt;br /&gt;
postgres 12825 12823  0 20:23 ?        00:00:00 postgres: startup process   recovering 00000001000000000000000C&lt;br /&gt;
postgres 12828 12823  0 20:23 ?        00:00:00 postgres: wal receiver process   streaming 0/C024038  &lt;br /&gt;
postgres 12829 12823  0 20:23 ?        00:00:00 postgres: writer process                              &lt;br /&gt;
postgres 12830 12823  0 20:23 ?        00:00:00 postgres: stats collector process                     &lt;br /&gt;
postgres 12901 12122  0 20:59 pts/1    00:00:00 ps -fea&lt;br /&gt;
postgres 12902 12122  0 20:59 pts/1    00:00:00 grep postgres&lt;br /&gt;
&lt;br /&gt;
Test it&lt;br /&gt;
&lt;br /&gt;
Insert some data in the master:&lt;br /&gt;
&lt;br /&gt;
$ psql&lt;br /&gt;
postgres=# create table t (i int);&lt;br /&gt;
postgres=# insert into t values(1);&lt;br /&gt;
postgres=# insert into t values(2);&lt;br /&gt;
postgres=# select * from t;&lt;br /&gt;
i &lt;br /&gt;
---&lt;br /&gt;
1&lt;br /&gt;
2&lt;br /&gt;
(2 rows)&lt;br /&gt;
&lt;br /&gt;
Check in the Slave&lt;br /&gt;
$ psql&lt;br /&gt;
postgres=# select * from t;&lt;br /&gt;
i &lt;br /&gt;
---&lt;br /&gt;
1&lt;br /&gt;
2&lt;br /&gt;
(2 rows)</content><link rel='replies' type='application/atom+xml' href='http://mysqlnotesandtips.blogspot.com/feeds/4753676271696405619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2010/10/postgres-stream-replication-set-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/4753676271696405619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/4753676271696405619'/><link rel='alternate' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2010/10/postgres-stream-replication-set-up.html' title='Postgres Stream replication set up'/><author><name>Luis F. Roncancio</name><uri>http://www.blogger.com/profile/00717206216885685280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpt1hPtAD5gbBdFOXDlNdtmX-NjX9y8jf48H8pFZbV7lHVGLxEJXkbpQoGqI2rl7DOCuGBlEN83AmyLP-a1RL6KJjmY9XoPnv8JnWdshJQybTnIFE58BigPAwylgdpzlQ/s220/foto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3747503186976344232.post-9147679883184930949</id><published>2010-08-27T13:13:00.000-07:00</published><updated>2010-08-27T13:13:29.736-07:00</updated><title type='text'>Transpose rows into column. Example</title><content type='html'>mysql&gt; select * from site_parts;&lt;br /&gt;
+---------+-----------+------+&lt;br /&gt;
| site    | part      | qty  |&lt;br /&gt;
+---------+-----------+------+&lt;br /&gt;
| Sunrise | HD500     |   50 | &lt;br /&gt;
| Sunrise | NIC1000   |   10 | &lt;br /&gt;
| Miami   | HD500     |   20 | &lt;br /&gt;
| Miami   | Monitor20 |   10 | &lt;br /&gt;
| Miami   | HD500     |    5 | &lt;br /&gt;
| NY      | Mouse     |   40 | &lt;br /&gt;
+---------+-----------+------+&lt;br /&gt;
6 rows in set (0.00 sec)&lt;br /&gt;
&lt;br /&gt;
mysql&gt; select &lt;br /&gt;
site, &lt;br /&gt;
sum(if(part=&#39;HD500&#39;,qty,0)) as HD500, &lt;br /&gt;
sum(if(part=&#39;NIC1000&#39;,qty,0)) as NIC1000, &lt;br /&gt;
sum(if(part=&#39;Monitor20&#39;,qty,0)) as Monitor20, &lt;br /&gt;
sum(if(part=&#39;Mouse&#39;,qty,0)) as Mouse &lt;br /&gt;
from &lt;br /&gt;
site_parts group by site;&lt;br /&gt;
&lt;br /&gt;
+---------+-------+---------+-----------+-------+&lt;br /&gt;
| site    | HD500 | NIC1000 | Monitor20 | Mouse |&lt;br /&gt;
+---------+-------+---------+-----------+-------+&lt;br /&gt;
| Miami   |    25 |       0 |        10 |     0 | &lt;br /&gt;
| NY      |     0 |       0 |         0 |    40 | &lt;br /&gt;
| Sunrise |    50 |      10 |         0 |     0 | &lt;br /&gt;
+---------+-------+---------+-----------+-------+&lt;br /&gt;
3 rows in set (0.00 sec)</content><link rel='replies' type='application/atom+xml' href='http://mysqlnotesandtips.blogspot.com/feeds/9147679883184930949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2010/08/transpose-rows-into-column-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/9147679883184930949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/9147679883184930949'/><link rel='alternate' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2010/08/transpose-rows-into-column-example.html' title='Transpose rows into column. Example'/><author><name>Luis F. Roncancio</name><uri>http://www.blogger.com/profile/00717206216885685280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpt1hPtAD5gbBdFOXDlNdtmX-NjX9y8jf48H8pFZbV7lHVGLxEJXkbpQoGqI2rl7DOCuGBlEN83AmyLP-a1RL6KJjmY9XoPnv8JnWdshJQybTnIFE58BigPAwylgdpzlQ/s220/foto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3747503186976344232.post-2724685427013569758</id><published>2010-08-02T14:27:00.001-07:00</published><updated>2010-08-02T14:28:49.195-07:00</updated><title type='text'>Merge table management using MySQL event scheduler and Stored Procedures</title><content type='html'>Normally we use cronjobs to execute scheduled tasks, but some times because of security policies we don&#39;t have access to cronjobs, this is even worse in safe environments, in those cases, it is quite possible we do not have access to the file system and the only possible access is though MySQL.&lt;br /&gt;
&lt;br /&gt;
So what can we do when we need to run scheduled tasks in MySQL?.&lt;br /&gt;
&lt;br /&gt;
Fortunately, there is an event scheduler in MySQL; using this feature we can execute basically any MySQL scehduled job.&lt;br /&gt;
&lt;br /&gt;
In this case it is required to create merge table based on pre-define schedule that can be minutes, hours, days, months or years. Yes!, I know that now would bemuch better to use partitions but in this case this is the requirement.&lt;br /&gt;
&lt;br /&gt;
To reach the gaol the following stored procedures were implemented:&lt;br /&gt;
&lt;br /&gt;
1.table_management_create_new_merge: Create the merge table based on the create table statement and a template&lt;br /&gt;
2.table_management_drop_merge: Deletes the merge table and all Underlying MyISAM tables&lt;br /&gt;
3.table_management_alter_merge: Changes the table and all merge MyISAM tables Underlying&lt;br /&gt;
4.table_management_add_new_table_to_merge: Adds a new table to merge&lt;br /&gt;
5.table_management_drop_table_from_merge: Take out a MyISAM table from the merge&lt;br /&gt;
&lt;br /&gt;
This is a very basic merge table management system, what is more important in this case is to add and exclude the merge tables on cheduled basis, however, I decided to implement all the necessary procedures to make easier the administration of these Merge tables.&lt;br /&gt;
&lt;br /&gt;
I want o emphasize two things that made this a little more complex than initially thought:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. MySQL does not store any part of its metadata (information_schema) the relationship between merge MyISAM tables and tables that are part of this. Stores it in a file. MRG which I have no access!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. I was not able by a cursor or variable assign the result of &quot;SHOW CREATE TABLE&quot; which was the second place where it could achieve the relationship between the merge table and MyISAM tables Underlying!. If someone knows please let me know.&lt;br /&gt;
&lt;br /&gt;
Ok, there was no other choice but to implement a basic data structure what I will use record the relationship between the Merge table and its Underlying MyISAM tables.&lt;br /&gt;
&lt;br /&gt;
Lets go back to goal: add / exclude table of a merge table on scheduled basis.&lt;br /&gt;
&lt;br /&gt;
Here is the procedure:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Create the data structure that stores the relationship between the merge table and the underlying mysam tables:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create database table_management;&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `dbschemas` (&lt;br /&gt;
`schema_id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
`schema_name` varchar(64) CHARACTER SET utf8 DEFAULT NULL,&lt;br /&gt;
PRIMARY KEY (`schema_id`),&lt;br /&gt;
UNIQUE KEY `schema_name_UNIQUE` (`schema_name`)&lt;br /&gt;
) ENGINE=InnoDB;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE `dbtables` (&lt;br /&gt;
`table_id` int(11) NOT NULL AUTO_INCREMENT,&lt;br /&gt;
`schema_id` int(11) NOT NULL,&lt;br /&gt;
`table_name` varchar(64) DEFAULT NULL,&lt;br /&gt;
`parent_table_id` int(11) DEFAULT NULL,&lt;br /&gt;
PRIMARY KEY (`table_id`,`schema_id`),&lt;br /&gt;
UNIQUE KEY `schema_id_table_name_UNIQUE` (`schema_id`,`table_name`),&lt;br /&gt;
KEY `fk_table_schema1` (`schema_id`),&lt;br /&gt;
KEY `fk_table_table1` (`parent_table_id`),&lt;br /&gt;
CONSTRAINT `fk_table_schema1` FOREIGN KEY (`schema_id`) REFERENCES `dbschemas` (`schema_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,&lt;br /&gt;
CONSTRAINT `fk_table_table1` FOREIGN KEY (`parent_table_id`) REFERENCES `dbtables` (`table_id`) ON DELETE NO ACTION ON UPDATE NO ACTION&lt;br /&gt;
) ENGINE=InnoDB;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Create the required stored procedures:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
##################Create new merge table and its template MyISAM TABLE#################&lt;br /&gt;
&lt;br /&gt;
drop procedure table_management_create_new_merge;&lt;br /&gt;
delimiter //&lt;br /&gt;
#The parameter create_stmt is a regular table create statement, it does not include the union neither the engine.&lt;br /&gt;
create procedure table_management_create_new_merge (target_schema varchar(64),create_stmt varchar(10000))&lt;br /&gt;
begin&lt;br /&gt;
declare merge_table_name varchar(64);&lt;br /&gt;
declare column_def varchar(10000);&lt;br /&gt;
declare v_merge_table_id int;&lt;br /&gt;
declare v_schema_id int;&lt;br /&gt;
&lt;br /&gt;
select trim(substring(trim(substring(create_stmt,locate(&#39;table&#39;,create_stmt)+5)),1,locate(&#39;(&#39;,trim(substring(create_stmt,locate(&#39;table&#39;,create_stmt)+5)))-1)) into @merge_table_name;&lt;br /&gt;
select substring(trim(substring(create_stmt,locate(&#39;table&#39;,create_stmt)+5)),locate(&#39;(&#39;,trim(substring(create_stmt,locate(&#39;table&#39;,create_stmt)+5)))) into @column_def;&lt;br /&gt;
&lt;br /&gt;
set @create_myisam_template_table_stmt=concat(&#39;create table &#39;,target_schema,&#39;.&#39;,@merge_table_name,&#39;_tmpt &#39;,@column_def,&#39; ENGINE=MyISAM&#39;);&lt;br /&gt;
prepare create_myisam_template_table_stmt from @create_myisam_template_table_stmt;              &lt;br /&gt;
execute create_myisam_template_table_stmt;  &lt;br /&gt;
&lt;br /&gt;
set @create_merge_table_stmt=concat(&#39;create table &#39;,target_schema,&#39;.&#39;,@merge_table_name,&#39; &#39;,@column_def,&#39; ENGINE=MRG_MyISAM UNION=(&#39;,target_schema,&#39;.&#39;,@merge_table_name,&#39;_tmpt)&#39;);&lt;br /&gt;
prepare create_merge_table_stmt from @create_merge_table_stmt;&lt;br /&gt;
execute create_merge_table_stmt;&lt;br /&gt;
&lt;br /&gt;
start transaction;  &lt;br /&gt;
&lt;br /&gt;
insert ignore into table_management.dbschemas set schema_name=target_schema;&lt;br /&gt;
select schema_id into v_schema_id from table_management.dbschemas where schema_name=target_schema;&lt;br /&gt;
insert into table_management.dbtables set schema_id=v_schema_id,table_name=@merge_table_name;&lt;br /&gt;
select table_id into v_merge_table_id from table_management.dbtables where schema_id=v_schema_id and table_name=@merge_table_name;&lt;br /&gt;
insert into table_management.dbtables set schema_id=v_schema_id,table_name=concat(@merge_table_name,&#39;_tmpt&#39;),parent_table_id=v_merge_table_id;&lt;br /&gt;
&lt;br /&gt;
commit;&lt;br /&gt;
deallocate prepare create_myisam_template_table_stmt;&lt;br /&gt;
deallocate prepare create_merge_table_stmt;&lt;br /&gt;
end//&lt;br /&gt;
delimiter ;&lt;br /&gt;
&lt;br /&gt;
#################Drop a Merge table and all its underlying MyISAM tables #########################&lt;br /&gt;
drop procedure table_management_drop_merge;&lt;br /&gt;
delimiter //&lt;br /&gt;
create procedure table_management_drop_merge (target_schema varchar(64),target_merge_table varchar(64))&lt;br /&gt;
begin&lt;br /&gt;
declare done varchar(5) default &#39;START&#39;;  &lt;br /&gt;
declare table_name varchar(64);&lt;br /&gt;
declare v_table_id int;  &lt;br /&gt;
declare v_schema_id int;&lt;br /&gt;
declare table_list cursor for&lt;br /&gt;
select c.table_name&lt;br /&gt;
from table_management.dbschemas a join table_management.dbtables b on a.schema_id=b.schema_id join table_management.dbtables c on b.table_id=c.parent_table_id&lt;br /&gt;
where a.schema_name=target_schema and b.table_name=target_merge_table;&lt;br /&gt;
declare continue handler for not found set done = &#39;END&#39;;&lt;br /&gt;
open table_list;&lt;br /&gt;
while done&amp;lt;&amp;gt;&#39;END&#39; do&lt;br /&gt;
fetch table_list into table_name;&lt;br /&gt;
if done&amp;lt;&amp;gt;&#39;END&#39; then&lt;br /&gt;
set @drop_table_stmt=concat(&#39;drop table &#39;,target_schema,&#39;.&#39;,table_name);&lt;br /&gt;
prepare drop_table_stmt from @drop_table_stmt;&lt;br /&gt;
execute drop_table_stmt;&lt;br /&gt;
end if;&lt;br /&gt;
end while;&lt;br /&gt;
close table_list;&lt;br /&gt;
set @drop_merge_table_stmt=concat(&#39;drop table &#39;,target_schema,&#39;.&#39;,target_merge_table);&lt;br /&gt;
prepare drop_merge_table_stmt from @drop_merge_table_stmt;&lt;br /&gt;
execute drop_merge_table_stmt;&lt;br /&gt;
start transaction;&lt;br /&gt;
select c.table_id,c.schema_id&lt;br /&gt;
into v_table_id,v_schema_id&lt;br /&gt;
from table_management.dbschemas a join table_management.dbtables b on a.schema_id=b.schema_id join table_management.dbtables c on b.table_id=c.parent_table_id&lt;br /&gt;
where a.schema_name=target_schema and b.table_name=target_merge_table;&lt;br /&gt;
delete from table_management.dbtables where table_id=v_table_id and schema_id=v_schema_id;&lt;br /&gt;
select a.table_id,a.schema_id&lt;br /&gt;
into v_table_id,v_schema_id&lt;br /&gt;
from table_management.dbtables a join table_management.dbschemas b on a.schema_id=b.schema_id&lt;br /&gt;
where b.schema_name=target_schema and a.table_name=target_merge_table;          &lt;br /&gt;
delete from table_management.dbtables where table_id=v_table_id and schema_id=v_schema_id;&lt;br /&gt;
commit;&lt;br /&gt;
deallocate prepare drop_merge_table_stmt;&lt;br /&gt;
deallocate prepare drop_table_stmt;&lt;br /&gt;
end//&lt;br /&gt;
delimiter ;&lt;br /&gt;
&lt;br /&gt;
#################Alter a Merge table and all its underlying MyISAM tables #########################&lt;br /&gt;
drop procedure table_management_alter_merge;&lt;br /&gt;
delimiter //&lt;br /&gt;
create procedure table_management_alter_merge (target_schema varchar(64),alter_stmt varchar(10000))&lt;br /&gt;
begin&lt;br /&gt;
&lt;br /&gt;
declare done varchar(5) default &#39;START&#39;;  &lt;br /&gt;
declare table_name varchar(64);&lt;br /&gt;
declare merge_table_name varchar(64);&lt;br /&gt;
declare column_def varchar(10000);&lt;br /&gt;
declare table_list cursor for&lt;br /&gt;
select b.table_name&lt;br /&gt;
from table_management.dbschemas a join table_management.dbtables b on a.schema_id=b.schema_id join table_management.dbtables c on b.table_id=c.parent_table_id&lt;br /&gt;
where a.schema_name=target_schema and b.table_name=@merge_table_name&lt;br /&gt;
union&lt;br /&gt;
select c.table_name&lt;br /&gt;
from table_management.dbschemas a join table_management.dbtables b on a.schema_id=b.schema_id join table_management.dbtables c on b.table_id=c.parent_table_id&lt;br /&gt;
where a.schema_name=target_schema and b.table_name=@merge_table_name;&lt;br /&gt;
declare continue handler for not found set done = &#39;END&#39;;&lt;br /&gt;
&lt;br /&gt;
select trim(substring(trim(substring(alter_stmt,locate(&#39;table&#39;,alter_stmt)+5)),1,locate(&#39; &#39;,trim(substring(alter_stmt,locate(&#39;table&#39;,alter_stmt)+5)))-1)) into @merge_table_name;&lt;br /&gt;
&lt;br /&gt;
select substring(trim(substring(alter_stmt,locate(&#39;table&#39;,alter_stmt)+5)),locate(&#39; &#39;,trim(substring(alter_stmt,locate(&#39;table&#39;,alter_stmt)+5)))) into @column_def;&lt;br /&gt;
&lt;br /&gt;
open table_list;&lt;br /&gt;
while done&amp;lt;&amp;gt;&#39;END&#39; do&lt;br /&gt;
fetch table_list into table_name;&lt;br /&gt;
if done&amp;lt;&amp;gt;&#39;END&#39; then&lt;br /&gt;
set @alter_table_stmt=concat(&#39;alter table &#39;,target_schema,&#39;.&#39;,table_name,&#39; &#39;,@column_def);&lt;br /&gt;
prepare alter_table_stmt from @alter_table_stmt;&lt;br /&gt;
execute alter_table_stmt;&lt;br /&gt;
end if;&lt;br /&gt;
end while;&lt;br /&gt;
close table_list;&lt;br /&gt;
deallocate prepare alter_table_stmt;&lt;br /&gt;
end//&lt;br /&gt;
delimiter ;&lt;br /&gt;
&lt;br /&gt;
#################Create a new MyISAM table and add it to the a Merge table #########################&lt;br /&gt;
&lt;br /&gt;
drop procedure table_management_add_new_table_to_merge;&lt;br /&gt;
delimiter //&lt;br /&gt;
create procedure table_management_add_new_table_to_merge (target_schema varchar(64),target_merge_table varchar(64),new_table varchar(64))&lt;br /&gt;
begin&lt;br /&gt;
declare i int default 0;  &lt;br /&gt;
declare done varchar(5) default &#39;START&#39;;  &lt;br /&gt;
declare table_name varchar(64);&lt;br /&gt;
declare table_union varchar(10000) default &#39;&#39;;&lt;br /&gt;
declare table_list cursor for&lt;br /&gt;
select c.table_name&lt;br /&gt;
from table_management.dbschemas a join table_management.dbtables b on a.schema_id=b.schema_id join table_management.dbtables c on b.table_id=c.parent_table_id&lt;br /&gt;
where a.schema_name=target_schema and b.table_name=target_merge_table;&lt;br /&gt;
declare continue handler for not found set done = &#39;END&#39;;&lt;br /&gt;
open table_list;&lt;br /&gt;
while done&amp;lt;&amp;gt;&#39;END&#39; do&lt;br /&gt;
fetch table_list into table_name;&lt;br /&gt;
if done&amp;lt;&amp;gt;&#39;END&#39; then&lt;br /&gt;
if i=0 then&lt;br /&gt;
set table_union=concat(target_schema,&#39;.&#39;,table_name);&lt;br /&gt;
else&lt;br /&gt;
set table_union=concat(table_union,&#39;,&#39;,target_schema,&#39;.&#39;,table_name);&lt;br /&gt;
end if;&lt;br /&gt;
set i=i+1;&lt;br /&gt;
end if;&lt;br /&gt;
end while;&lt;br /&gt;
close table_list;&lt;br /&gt;
set @create_table_stmt=concat(&#39;create table &#39;,target_schema,&#39;.&#39;,new_table,&#39; like &#39;,target_schema,&#39;.&#39;,target_merge_table,&#39;_tmpt&#39;);&lt;br /&gt;
prepare create_table_stmt from @create_table_stmt;&lt;br /&gt;
execute create_table_stmt;  &lt;br /&gt;
set @alter_table_stmt=concat(&#39;alter table &#39;,target_schema,&#39;.&#39;,target_merge_table,&#39; UNION=(&#39;,table_union,&#39;,&#39;,target_schema,&#39;.&#39;,new_table,&#39;)&#39;);&lt;br /&gt;
prepare alter_table_stmt from @alter_table_stmt;&lt;br /&gt;
execute alter_table_stmt;&lt;br /&gt;
set @insert_into_dbtables_stmt=concat(&#39;insert into table_management.dbtables (schema_id,table_name,parent_table_id) select a.schema_id,\&#39;&#39;,new_table,&#39;\&#39;,b.table_id from table_management.dbschemas a join table_management.dbtables b on a.schema_id=b.schema_id where a.schema_name=\&#39;&#39;,target_schema,&#39;\&#39; and table_name=\&#39;&#39;,target_merge_table,&#39;\&#39;&#39;);&lt;br /&gt;
prepare insert_into_dbtables_stmt from @insert_into_dbtables_stmt;&lt;br /&gt;
execute insert_into_dbtables_stmt;&lt;br /&gt;
deallocate prepare create_table_stmt;&lt;br /&gt;
deallocate prepare alter_table_stmt;&lt;br /&gt;
deallocate prepare insert_into_dbtables_stmt;&lt;br /&gt;
end//&lt;br /&gt;
delimiter ;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#################Take a MyISAM table out of ther Merge and alter the merge accordingly #########################&lt;br /&gt;
drop procedure table_management_drop_table_from_merge;&lt;br /&gt;
delimiter //&lt;br /&gt;
create procedure table_management_drop_table_from_merge (target_schema varchar(64),target_merge_table varchar(64),table_to_drop varchar(64))&lt;br /&gt;
begin&lt;br /&gt;
declare i int default 0;&lt;br /&gt;
declare v_schema_id int;&lt;br /&gt;
declare v_table_id int;  &lt;br /&gt;
declare done varchar(5) default &#39;START&#39;;  &lt;br /&gt;
declare table_name varchar(64);&lt;br /&gt;
declare table_union varchar(10000) default &#39;&#39;;&lt;br /&gt;
declare table_list cursor for&lt;br /&gt;
select c.table_name&lt;br /&gt;
from table_management.dbschemas a join table_management.dbtables b on a.schema_id=b.schema_id join table_management.dbtables c on b.table_id=c.parent_table_id&lt;br /&gt;
where a.schema_name=target_schema and b.table_name=target_merge_table;&lt;br /&gt;
declare continue handler for not found set done = &#39;END&#39;;&lt;br /&gt;
open table_list;&lt;br /&gt;
while done&amp;lt;&amp;gt;&#39;END&#39; do&lt;br /&gt;
fetch table_list into table_name;&lt;br /&gt;
if done&amp;lt;&amp;gt;&#39;END&#39; then&lt;br /&gt;
if table_name&amp;lt;&amp;gt;table_to_drop then          &lt;br /&gt;
if i=0 then&lt;br /&gt;
set table_union=concat(target_schema,&#39;.&#39;,table_name);&lt;br /&gt;
else&lt;br /&gt;
set table_union=concat(table_union,&#39;,&#39;,target_schema,&#39;.&#39;,table_name);&lt;br /&gt;
end if;&lt;br /&gt;
set i=i+1;&lt;br /&gt;
end if;&lt;br /&gt;
end if;&lt;br /&gt;
end while;&lt;br /&gt;
close table_list;&lt;br /&gt;
set @alter_table_stmt=concat(&#39;alter table &#39;,target_schema,&#39;.&#39;,target_merge_table,&#39; UNION=(&#39;,table_union,&#39;)&#39;);&lt;br /&gt;
prepare alter_table_stmt from @alter_table_stmt;&lt;br /&gt;
execute alter_table_stmt;&lt;br /&gt;
start transaction;&lt;br /&gt;
delete table_management.dbtables&lt;br /&gt;
from&lt;br /&gt;
table_management.dbschemas  join&lt;br /&gt;
table_management.dbtables  on table_management.dbschemas.schema_id=table_management.dbtables.schema_id&lt;br /&gt;
where table_management.dbschemas.schema_name=target_schema and table_management.dbtables.table_name=table_to_drop;&lt;br /&gt;
commit;&lt;br /&gt;
deallocate prepare alter_table_stmt;&lt;br /&gt;
end//&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Create the initial merge and template tables:&lt;br /&gt;
&lt;br /&gt;
create database secure3;&lt;br /&gt;
table_management_create_new_merge call (&#39;secure3&#39;, &#39;create table myminutetable (id int, timestamp datetime, primary key (id ))&#39;); &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Create a test event. For this, the event scheduler must be enable. This is disabled by default.&lt;br /&gt;
&lt;br /&gt;
To enable it, do:&lt;br /&gt;
SET GLOBAL event_scheduler = ON;&lt;br /&gt;
To make the change permanent, Add the following to the my.cnf mysqld section inside the&lt;br /&gt;
event_scheduler = ON&lt;br /&gt;
&lt;br /&gt;
To check this do a &quot;show running processlist\G&quot; and you should see something like this:&lt;br /&gt;
&lt;br /&gt;
Id: 1&lt;br /&gt;
User: event_scheduler&lt;br /&gt;
Host: localhost&lt;br /&gt;
db: NULL&lt;br /&gt;
Command: Daemon&lt;br /&gt;
Time: 5&lt;br /&gt;
State: Waiting for next activation&lt;br /&gt;
Info: NULL&lt;br /&gt;
&lt;br /&gt;
Now you can create the test event, in this case I am creating an event that runs every minute and adds a new table to merge.&lt;br /&gt;
&lt;br /&gt;
drop event myminutetable;&lt;br /&gt;
delimiter //&lt;br /&gt;
&lt;br /&gt;
create event myminutetable&lt;br /&gt;
on schedule every 1 minute&lt;br /&gt;
do&lt;br /&gt;
begin&lt;br /&gt;
declare datetime varchar(14) default &#39;&#39;;&lt;br /&gt;
declare table_name varchar(64) default &#39;&#39;;&lt;br /&gt;
select date_format(now(),&#39;%Y%m%d%k%i&#39;) into datetime;&lt;br /&gt;
set @table_name=concat(&#39;myminutetable_&#39;,datetime);&lt;br /&gt;
call table_management_add_new_table_to_merge (&#39;secure3&#39;,&#39;myminutetable&#39;,@table_name);&lt;br /&gt;
end//&lt;br /&gt;
delimiter ;&lt;br /&gt;
&lt;br /&gt;
Verify that it is creating tables every minute:&lt;br /&gt;
&lt;br /&gt;
use secure3;&lt;br /&gt;
show tables;&lt;br /&gt;
&lt;br /&gt;
Verify that table_management is being updated&lt;br /&gt;
&lt;br /&gt;
use table_management;&lt;br /&gt;
select * from dbtables;&lt;br /&gt;
&lt;br /&gt;
Future improvements:&lt;br /&gt;
&lt;br /&gt;
1. Exception and error handling&lt;br /&gt;
2. Parameter validation</content><link rel='replies' type='application/atom+xml' href='http://mysqlnotesandtips.blogspot.com/feeds/2724685427013569758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2010/08/normally-we-use-cronjobs-to-execute.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/2724685427013569758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/2724685427013569758'/><link rel='alternate' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2010/08/normally-we-use-cronjobs-to-execute.html' title='Merge table management using MySQL event scheduler and Stored Procedures'/><author><name>Luis F. Roncancio</name><uri>http://www.blogger.com/profile/00717206216885685280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpt1hPtAD5gbBdFOXDlNdtmX-NjX9y8jf48H8pFZbV7lHVGLxEJXkbpQoGqI2rl7DOCuGBlEN83AmyLP-a1RL6KJjmY9XoPnv8JnWdshJQybTnIFE58BigPAwylgdpzlQ/s220/foto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3747503186976344232.post-8581548171618009717</id><published>2009-10-27T13:33:00.000-07:00</published><updated>2009-10-27T13:33:54.078-07:00</updated><title type='text'>Simple Hadoop Hive Derby Installation and configuration</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This article shows how to install Hadoop and get hive working with centralized metadata&amp;nbsp;repository&amp;nbsp;based on Derby database:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;For this case we are going to have 7 datanodes and 1 namenode&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;hadoopNN01: 192.168.1.171&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;hadoopDN01: 192.168.1.172&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;hadoopDN02: 192.168.1.173&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;hadoopDN03: 192.168.1.174&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;hadoopDN04: 192.168.1.175&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;hadoopDN05: 192.168.1.176&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;hadoopDN06: 192.168.1.177&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;hadoopDN07: 192.168.1.178&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;-Hadoop 0.19.2 (There is a new version, but I will install this one for&amp;nbsp;compatibility&amp;nbsp;with other tools I am planning to install (i.e. hive, pig, etc)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;-Install Java JDK on each server&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;-Create a hadoop account on each server&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;-Configure SSH&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Server 1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;ssh-keygen -t dsa&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Server 2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;mkdir .ssh (Under the home directory)&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Server 1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;scp .ssh/id_dsa.hadoopnn01:/home/hadoop/.ssh/authorized_keys2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Server 2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$chmod 700 .ssh&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$chmod 600 .ssh/authorized_keys2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Do the same for all servers in order to guarantee can be sshed between them without password&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;a href=&quot;http://www.poolsaboveground.com/apache/hadoop/core/hadoop-0.19.2/&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Download hadoop&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Unpacked it under /user/local on each node&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Set the following variables, on each node:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;export HADOOP_HOME=/usr/local/hadoop-0.19.2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;export JAVA_HOME=/usr/local/src/jdk1.6.0_12&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;export PATH=$PATH:$HADOOP_HOME/bin:$JAVA_HOME/bin&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Edit&amp;nbsp;conf/hadoop-site.xml (This file must be in all nodes)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;!-- Put site-specific property overrides in this file.
--&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;configuration&gt;&lt;/configuration&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;name&gt;fs.default.name&lt;/name&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;value&gt;hdfs://&lt;/value&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;192.168.1.171&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;name&gt;dfs.data.dir&lt;/name&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;value&gt;/usr/local/hadoop-0.19.2/hdfs/data&lt;/value&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;final&gt;true&lt;/final&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;name&gt;dfs.name.dir&lt;/name&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;value&gt;/usr/local/hadoop-0.19.2/hdfs/name&lt;/value&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;final&gt;true&lt;/final&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;name&gt;hadoop.tmp.dir&lt;/name&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;value&gt;/usr/local/hadoop-0.19.2/tmp&lt;/value&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;final&gt;true&lt;/final&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;name&gt;mapred.system.dir&lt;/name&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;value&gt;/usr/local/hadoop-0.19.2/mapred/system&lt;/value&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;final&gt;true&lt;/final&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;name&gt;dfs.replication&lt;/name&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;value&gt;3&lt;/value&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;name&gt;mapred.job.tracker&lt;/name&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;value&gt;&lt;/value&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;192.168.1.171&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;:8021&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Copy this files to all nodes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Create the directory /usr/local/hadoop-0.19.2/hdfs/data directory on each data node&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Create the directory /usr/local/hadoop-0.19.2/hdfs/name directory in the name node&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;edit conf/slaves and add all the data nodes&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;192.168.1.172&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;192.168.1.173&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;192.168.1.174&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;192.168.1.175&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;192.168.1.176&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;192.168.1.177&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;192.168.1.178&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;On the Name node: start the cluster and mapreduce&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 17px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$bin/start-dfs.sh&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$b&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;in/start-mapred.sh&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Hive comes with this distribution,,,, but we need to install derby to have a centralized metadata&amp;nbsp;repository&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;a href=&quot;http://db.apache.org/derby/releases/release-10.5.1.1.html&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Download derby&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Untar the file in&amp;nbsp;/usr/local/hadoop-0.19.2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Set the&amp;nbsp;environment&amp;nbsp;variables:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$export DERBY_INSTALL=/usr/local/hadoop-0.19.2/db-derby-10.5.1.1-bin&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$export DERBY_HOME=/usr/local/hadoop-0.19.2/db-derby-10.5.1.1-bin&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$export HADOOP=/usr/local/hadoop-0.19.2/bin/hadoop&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$cd /usr/local/hadoop-0.19.2/db-derby-10.5.1.1-bin/data&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Start derby&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$nohup /usr/local/db-derby-10.5.1.1-bin/bin/startNetworkServer -h 0.0.0.0 &amp;amp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;CP derbyclient.jar and derbytools.jar to the lib&#39;s hive directory&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: small;&quot;&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$cp /usr/local/db-derby-10.5.1.3-bin/lib/derbyclient.jar /usr/local/hadoop-0.19.2/contrib/hive/lib&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$cp /usr/local/db-derby-10.5.1.3-bin/lib/derbytools.jar /usr/local/hadoop-0.19.2/contrib/hive/lib&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Edit the files /usr/local/hadoop-0.19.2/contrib/hive/conf/hive-default.xml and /usr/local/hadoop-0.19.2/contrib/hive/conf/jpox.properties&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: normal;&quot;&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;hive-default.xml:&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;configuration&gt;

&lt;!-- Hive Configuration can either be stored in this file or in the hadoop configuration files  --&gt;
&lt;!-- that are implied by Hadoop setup variables.                                                --&gt;
&lt;!-- Aside from Hadoop setup variables - this file is provided as a convenience so that Hive    --&gt;
&lt;!-- users do not have to edit hadoop configuration files (that may be managed as a centralized --&gt;
&lt;!-- resource).                                                                                 --&gt;

&lt;!-- Hadoop Setup --&gt;
&lt;property&gt;
  &lt;name&gt;hadoop.bin.path&lt;/name&gt;
  &lt;value&gt;${user.dir}/../../../bin/hadoop&lt;/value&gt;
  &lt;!-- note that the hive shell script also uses this property name --&gt;
  &lt;description&gt;Path to hadoop binary. Assumes that by default we are executing from hive&lt;/description&gt;
&lt;/property&gt;

&lt;property&gt;
  &lt;name&gt;hadoop.config.dir&lt;/name&gt;
  &lt;value&gt;${user.dir}/../../../conf&lt;/value&gt;
  &lt;!-- note that the hive shell script also uses this property name --&gt;
  &lt;description&gt;Path to hadoop configuration. Again assumes that by default we are executing from hive/&lt;/description&gt;
&lt;/property&gt;

&lt;!-- Hive Execution Parameters --&gt;
&lt;property&gt;
  &lt;name&gt;hive.exec.scratchdir&lt;/name&gt;
  &lt;value&gt;/tmp/hive-${user.name}&lt;/value&gt;
  &lt;description&gt;Scratch space for Hive jobs&lt;/description&gt;
&lt;/property&gt;

&lt;property&gt;
  &lt;name&gt;hive.metastore.local&lt;/name&gt;
  &lt;value&gt;true&lt;/value&gt;
  &lt;description&gt;controls whether to connect to remove metastore server or open a new metastore server in Hive Client JVM&lt;/description&gt;
&lt;/property&gt;

&lt;property&gt;
  &lt;name&gt;javax.jdo.option.ConnectionURL&lt;/name&gt;
  &lt;value&gt;jdbc:derby://localhost:1527/metastore_db;create=true&lt;/value&gt;
  &lt;description&gt;JDBC connect string for a JDBC metastore&lt;/description&gt;
&lt;/property&gt;

&lt;property&gt;
  &lt;name&gt;javax.jdo.option.ConnectionDriverName&lt;/name&gt;
  &lt;value&gt;org.apache.derby.jdbc.ClientDriver&lt;/value&gt;
  &lt;description&gt;Driver class name for a JDBC metastore&lt;/description&gt;
&lt;/property&gt;

&lt;property&gt;
  &lt;name&gt;hive.metastore.uris&lt;/name&gt;
  &lt;value&gt;thift://&lt;/value&gt;
  &lt;description&gt;Comma separated list of URIs of metastore servers. The first server that can be connected to will be used.&lt;/description&gt;
&lt;/property&gt;

&lt;property&gt;
  &lt;name&gt;hive.metastore.metadb.dir&lt;/name&gt;
  &lt;value&gt;file:///var/metastore/metadb/&lt;/value&gt;
  &lt;description&gt;The location of filestore metadata base dir&lt;/description&gt;
&lt;/property&gt;&lt;/configuration&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;name&gt;hive.metastore.uris&lt;/name&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;value&gt;file:///var/metastore/metadb/&lt;/value&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;description&gt;&lt;/description&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;name&gt;hive.metastore.warehouse.dir&lt;/name&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;value&gt;/user/hive/warehouse&lt;/value&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;description&gt;location of default database for the warehouse&lt;/description&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;name&gt;hive.metastore.connect.retries&lt;/name&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;value&gt;5&lt;/value&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;description&gt;Number of retries while opening a connection to metastore&lt;/description&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;property&gt;&lt;/property&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;name&gt;hive.metastore.rawstore.impl&lt;/name&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;value&gt;org.apache.hadoop.hive.metastore.ObjectStore&lt;/value&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;description&gt;Name of the class that implements org.apache.hadoop.hive.metastore.rawstore interface. This class is used to store and retrieval of raw metadata objects such as table, database&lt;/description&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: normal;&quot;&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;/usr/local/hadoop-0.19.2/contrib/hive/conf/jpox.properties:&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFactoryImpl
org.jpox.autoCreateSchema=false
org.jpox.validateTables=false
org.jpox.validateColumns=false
org.jpox.validateConstraints=false
org.jpox.storeManagerType=rdbms
org.jpox.autoCreateSchema=true
org.jpox.autoStartMechanismMode=checked
org.jpox.transactionIsolation=read_committed
javax.jdo.option.DetachAllOnCommit=true
javax.jdo.option.NontransactionalRead=true
javax.jdo.option.ConnectionDriverName=org.apache.derby.jdbc.ClientDriver
javax.jdo.option.ConnectionURL=jdbc:derby://localhost:1527/metastore_db;create=true
javax.jdo.option.ConnectionUserName=APP
javax.jdo.option.ConnectionPassword=mine
org.jpox.cache.level2=true
org.jpox.cache.level2.type=SOFT
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Run hive&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;/usr/local/hadoop-0.19.2/contrib/hive/bin/hive&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Doing this all the metadata definitions are going to be stored in a centralized repository based on Derby database.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlnotesandtips.blogspot.com/feeds/8581548171618009717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2009/10/simple-hadoop-hive-derby-installation.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/8581548171618009717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/8581548171618009717'/><link rel='alternate' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2009/10/simple-hadoop-hive-derby-installation.html' title='Simple Hadoop Hive Derby Installation and configuration'/><author><name>Luis F. Roncancio</name><uri>http://www.blogger.com/profile/00717206216885685280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpt1hPtAD5gbBdFOXDlNdtmX-NjX9y8jf48H8pFZbV7lHVGLxEJXkbpQoGqI2rl7DOCuGBlEN83AmyLP-a1RL6KJjmY9XoPnv8JnWdshJQybTnIFE58BigPAwylgdpzlQ/s220/foto.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3747503186976344232.post-4291068345962894192</id><published>2009-10-09T07:44:00.000-07:00</published><updated>2009-10-09T07:56:20.267-07:00</updated><title type='text'>How to connect to mysql using C/C++</title><content type='html'>&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Pre-requisites&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;-gcc must be installed&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;-mysql-dev must be installed&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Procedure&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;-Create a user with access to the database/table you need to access&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;grant all privileges on test.* to test identified by &#39;mypassword&#39;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;-Create a table and populate it:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;CREATE TABLE `mytable` (&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;`id` int(11) NOT NULL DEFAULT &#39;0&#39;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;`name` varchar(30) DEFAULT NULL,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;PRIMARY KEY (`id`)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;insert into mytable values (1,&#39;Luis&#39;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;insert into mytable values (2,&#39;Scott&#39;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;insert into mytable values (3,&#39;Rob&#39;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;-Write the C program:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;#include &amp;lt;mysql.h&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;#include &amp;lt;time.h&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;main() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; MYSQL *conn;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; MYSQL_RES *res;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; MYSQL_ROW row;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;char *server = &quot;127.0.0.1&quot;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; char *user = &quot;test&quot;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; char *password = &quot;mypassword&quot;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; char *database = &quot;test&quot;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; char query[] = &quot;select * from mytable&quot;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; conn = mysql_init(NULL);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; /* Connect to database */&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; if (!mysql_real_connect(conn, server,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;user, password, database, 0, NULL, 0)) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;fprintf(stderr, &quot;%s\n&quot;, mysql_error(conn));&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;exit(0);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; /* Execute the query */&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; if (mysql_query(conn, query)) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; fprintf(stderr, &quot;%s\n&quot;, mysql_error(conn));&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; exit(0);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; /* send SQL query */&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; res = mysql_use_result(conn);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; /* output fields 1 and 2 of each row */&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; while ((row = mysql_fetch_row(res)) != NULL)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;printf(&quot;%s %s \n&quot;, row[0],row[1]);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; /* Release memory used to store results and close connection */&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; mysql_free_result(res);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; mysql_close(conn);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;-Compile it&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$ gcc -c `mysql_config --cflags` mysql_connection.c&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$ gcc -o mysql_connection &amp;nbsp;mysql_connection.o `mysql_config --libs`&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;-Run it&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$ ./mysql_connection&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;1 Luis&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;2 Scott&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;3 Rob&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlnotesandtips.blogspot.com/feeds/4291068345962894192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2009/10/how-to-connect-to-mysql-using-cc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/4291068345962894192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/4291068345962894192'/><link rel='alternate' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2009/10/how-to-connect-to-mysql-using-cc.html' title='How to connect to mysql using C/C++'/><author><name>Luis F. Roncancio</name><uri>http://www.blogger.com/profile/00717206216885685280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpt1hPtAD5gbBdFOXDlNdtmX-NjX9y8jf48H8pFZbV7lHVGLxEJXkbpQoGqI2rl7DOCuGBlEN83AmyLP-a1RL6KJjmY9XoPnv8JnWdshJQybTnIFE58BigPAwylgdpzlQ/s220/foto.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3747503186976344232.post-6178569944962271420</id><published>2009-10-08T12:56:00.000-07:00</published><updated>2009-10-08T12:58:04.197-07:00</updated><title type='text'>Changing InnoDB Log File Size</title><content type='html'>&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;If MySQL error log is showing this error:&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;InnoDB: ERROR: the age of the last checkpoint is 9433957,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial; font-size: small;&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;InnoDB: which exceeds the log group capacity 9433498.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;InnoDB: If you are using big BLOB or TEXT rows, you must set the&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;InnoDB: combined size of log files at least 10 times bigger than the&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;&lt;code&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;InnoDB: largest such row.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This means that the innodblog is smaller than some of the executed queries and it is unable to log them.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;That is not critical if you are not using transactions, but it is if so. &amp;nbsp;Here is the procedure to change the InnoDB log file size.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;1. Stop MySQL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;/etc/init.d/mysql stop&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;2. Check that MySQL is not running&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ps -fea | grep myql&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;3. Go to the data directory&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;cd data&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;4. Check the files&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ls -la&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;5. Move the InnoDB log files to a safe location (If MySQL does not start we will need to copy then back)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;mv ib_logfile0 /tmp/ib_logfile0.old&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;mv ib_logfile1 /tmp/ib_logfile1.old&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;4. Verify that the ib_logfiles are not in the /mysql/data directory&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ls -la&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;5. Edit /etc/my.cnf&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;vi /etc/my.cnf&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;6. Add the line&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;innodb_log_file_size=50M (Set the File Size, in this case 50M)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;7. Start MySQL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;/etc/init.d/mysql start&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Starting MySQL.....&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&amp;nbsp; OK&amp;nbsp; ]&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;8. Verify that MySQL is runing&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ps -fea | grep mysql&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;9. Verify that the InnoDB log files were created and their sizes&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;ls -la /mysql/data&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;10. Verify that you can login to MySQL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;mysql -u&lt;user&gt; -p -A&amp;nbsp;&lt;/user&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;11 Delete the old InnoDB log files&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;rm /tmp/ib_logfile*&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://mysqlnotesandtips.blogspot.com/feeds/6178569944962271420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2009/10/changing-innodb-log-file-size.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/6178569944962271420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3747503186976344232/posts/default/6178569944962271420'/><link rel='alternate' type='text/html' href='http://mysqlnotesandtips.blogspot.com/2009/10/changing-innodb-log-file-size.html' title='Changing InnoDB Log File Size'/><author><name>Luis F. Roncancio</name><uri>http://www.blogger.com/profile/00717206216885685280</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='20' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpt1hPtAD5gbBdFOXDlNdtmX-NjX9y8jf48H8pFZbV7lHVGLxEJXkbpQoGqI2rl7DOCuGBlEN83AmyLP-a1RL6KJjmY9XoPnv8JnWdshJQybTnIFE58BigPAwylgdpzlQ/s220/foto.JPG'/></author><thr:total>0</thr:total></entry></feed>