tag:blogger.com,1999:blog-64284052982055730742024-02-07T15:09:50.018+05:30Learn MySQLThis blog zone is for all those aspiring people who have eagerness to learn MySQL from beginning.Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.comBlogger55125tag:blogger.com,1999:blog-6428405298205573074.post-30604513920461119252016-01-31T22:37:00.001+05:302016-01-31T22:38:55.344+05:30Cassandra - Cannot proceed on repair because a neighbor is dead: session failed/Endpoint Died<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
Overview</h2>
<div>
Many of you would have faced these error during nodetool repair -</div>
<div>
<br /></div>
<div>
<span style="color: red; font-family: "courier new" , "courier" , monospace;">Repair session 2a703be0-7722-11e5-ac24-c5a3c7c6e3cf for range (5995916511884239066,6033116056473427945] failed with error java.io.IOException: Cannot proceed on repair because a neighbor (/<node IP>) is dead: session failed.</span></div>
<div>
<span style="color: red; font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<span style="color: red; font-family: "courier new" , "courier" , monospace;">Repair session 28c63560-7722-11e5-ac24-c5a3c7c6e3cf for range (-135025182178679597,-28481663575762586] failed with error java.io.IOException: Endpoint /<IP of node> died</span></div>
<div>
<span style="color: red; font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<span style="font-family: inherit;">and By looking at this error we get scared and immediately execute </span><i style="font-family: inherit;">"nodetool status"</i><span style="font-family: inherit;"> command to verify the health of cluster. And everything seems good there still we goto that node to verify node is </span>actually<span style="font-family: inherit;"> not dead :)</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">Well i did faced this issue and did ran here and there to verify my nodes are healthy and they were.. then why did i receive this error ONLY during repair.</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<h3 style="text-align: left;">
<span style="font-family: inherit;">After digging deeper i identified few facts:</span></h3>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">1. We had very large partitions (30 - 50GB)</span><span style="font-family: "courier new" , "courier" , monospace;"> (nodetool cfstats <keyspace>.<CF>)</span></div>
<div>
<span style="font-family: inherit;">2.In compare to that we use default Heap configuration i.e. 8GB HEAP which </span>doesn't<span style="font-family: inherit;"> seems to be enough for this big partitions.</span></div>
<div>
3. Noticed whenever CPU goes high it was the JVM which was eating up the CPU (used JCONSOLE,jmc.exe to verify the same)</div>
<div>
4. Noticed we had very high read latency - <span style="font-family: "courier new" , "courier" , monospace;">(nodetool cfstats <keyspace>.<CF>)</span></div>
<div>
<span style="font-family: inherit;">5. I have noticed whenever repair executes (mostly when it executes at same time on multiple nodes) It initiate COMPACTION on such a large partitions which actually needed more HEAP than what we have allocated resulting </span><span style="font-family: "courier new" , "courier" , monospace;">FailureDetector.instance.isAlive(endpoint)</span> return a failure.</div>
<div>
<br /></div>
<div>
<b>Reference:</b></div>
<div>
<br /></div>
<div>
<a href="https://github.com/apache/cassandra/blob/cassandra-2.1/src/java/org/apache/cassandra/repair/RepairSession.java">https://github.com/apache/cassandra/blob/cassandra-2.1/src/java/org/apache/cassandra/repair/RepairSession.java</a></div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> // Checking all nodes are live</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> for (InetAddress endpoint : endpoints)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> {</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> if (!FailureDetector.instance.isAlive(endpoint))</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> {</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> String message = String.format("Cannot proceed on repair because a neighbor (%s) is dead: session failed", endpoint);</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> differencingDone.signalAll();</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> logger.error("[repair #{}] {}", getId(), message);</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> throw new IOException(message);</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> }</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> }</span></div>
</div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<div>
<span style="font-family: inherit;">6. We noticed for read/write heavy loads cluster chances are the default tenuring threshold flag in GC setting is very low (in our case it was set to default i.e. 1 [JVM_OPTS="$JVM_OPTS -XX:<span style="background-color: yellow;">MaxTenuringThreshold=1</span>"]) causing premature promotions. This could be very likely a symptom of our problem. We decided to try increasing the tenuringthreshold to a large value to prevent premature promotions so that ParNew collects most garbage in young generation (</span>jstat<span style="font-family: inherit;">).</span></div>
<div>
<br /></div>
<div>
The tenuring threshold can also be noted in gc.log file.</div>
</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">~ $ cat /var/log/cassandra/gc.log.9 | grep age | tail -10</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">- age 1: 129160 bytes, 129160 total</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">- age 1: 127672 bytes, 127672 total</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">- age 1: 128600 bytes, 128600 total</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">- age 1: 128784 bytes, 128784 total</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">- age 1: 1984 bytes, 1984 total</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">- age 1: 137176 bytes, 137176 total</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">- age 1: 128592 bytes, 128592 total</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">- age 1: 128504 bytes, 128504 total</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">- age 1: 127744 bytes, 127744 total</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">- age 1: 128256 bytes, 128256 total</span></div>
</div>
<div>
<br /></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
7. We also noticed the GC was being initiated very frequently causing very frequent application pause.</div>
<div>
<br /></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">~ $ cat /var/log/cassandra/gc.log.9 | grep application</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<h3 style="text-align: left;">
<span style="font-family: inherit;">Conclusion:</span></h3>
<div>
<span style="font-family: inherit;">We understood that its is being caused by overloaded heap and made some </span>change<span style="font-family: inherit;"> as mentioned below in order to resolve this issue:</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<span style="font-family: inherit;">Increased MAX_HEAP_SIZE from 8GB to <b>16GB</b> and accordingly increased HEAP_NEWSIZE to 4GB (<b>MAX_HEAP_SIZE/4</b>), we also did increased the MaxTenuringThreshold from 1 to <b>5</b> (though to increase it upto 20 on performance observation)</span></div>
<div>
<span style="font-family: inherit;"><br /></span></div>
<div>
<blockquote class="tr_bq">
<span style="font-family: "courier new" , "courier" , monospace;">MAX_HEAP_SIZE="16G"</span></blockquote>
<br />
<blockquote class="tr_bq">
<span style="font-family: "courier new" , "courier" , monospace;">HEAP_NEWSIZE="4G” </span></blockquote>
<br />
<blockquote class="tr_bq">
<span style="font-family: "courier new" , "courier" , monospace;">JVM_OPTS="$JVM_OPTS -XX:MaxTenuringThreshold=5"</span></blockquote>
<br />
<span style="font-family: inherit;"><b><u> The above changes will have following benefits:</u></b></span><span style="font-family: inherit;"> </span><br />
<br />
<ul style="text-align: left;">
<li><span style="font-family: inherit;">This will increase the amount of work ParNew has to do, but it prevents objects from getting promoted quickly.</span></li>
<li><span style="font-family: inherit;">Increased size of ParEDEN will also reduce Minor GC frequency.</span></li>
<li><span style="font-family: inherit;">ParNew will collects most garbage in young generation resulting less Major GC.</span></li>
<li><span style="font-family: inherit;">This will also increase the Survivor size (HEAP_NEWSIZE/8) resulting more reusable objects.</span></li>
</ul>
</div>
<div>
<br /></div>
<h3 style="text-align: left;">
Result:</h3>
<div>
<b><i>We did noticed tremendous improvements:</i></b><br />
<br />
<ul style="text-align: left;">
<li>Application pause has been decreased from 80times in a minute to 6times in a minute.</li>
<li>Noticed the objects are living longer will result in <b>less major GC:</b> </li>
</ul>
<div>
<blockquote class="tr_bq">
<span style="font-family: "courier new";">-
age 1: 356112
bytes, 356112 total</span><span style="font-family: "courier new";">-
age 2: 225128
bytes, 581240 total</span><span style="font-family: "courier new";">-
age 3: 59760
bytes, 641000 total</span><span style="font-family: "courier new";">-
age 4: 61544
bytes, 702544 total</span><span style="font-family: "courier new";">-
age 5: 71984
bytes, 774528 total</span> </blockquote>
</div>
<br />
<ul style="text-align: left;">
<li>CMS activity after changes dropped on floor.</li>
<li>Non Heap memory usage dropped drastically.</li>
<li>Heap utilization stabilized and started begin under 50% consistently.</li>
</ul>
<div>
<b><span style="color: #6aa84f; font-size: large;">Above all our repair started completing successfully without any heap/cpu spike... Huff what a relief... :)</span></b></div>
<div>
<b><span style="font-size: large;"><br /></span></b></div>
<div>
<b>Hope this help!!</b></div>
<div>
<b><br /></b></div>
<div>
<b>Cheers!!!</b></div>
</div>
<div>
<br /></div>
</div>
Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-36676885709598400532016-01-18T03:18:00.001+05:302016-01-23T19:52:20.507+05:30Cassandra Cluster Migration to a New Cluster V2.2.4<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
Overview</h2>
This page describe how to migrate from an existing cluster to a new cluster. Several times we have a situations where we want to move the entire cluster to a new cluster (reason could be anything; better hardware, moving away from existing data center etc.) without taking any downtime and ensuring all data gets migrated to new cluster, we had the same requirement and we decided to go with below mentioned strategy which worked like a charm.<br />
<i><br /></i>
<i>This whole process is online and without impacting client, Old DC can be decommissioned anytime but as a best practice we should be taking a snapshot on each node of old dc before decommissioning.</i><br />
<br />
This involve 2 major steps:<br />
<br />
<ol style="text-align: left;">
<li>Build a new Datacenter - Build a parallel new Data center with number of nodes you want.</li>
<li>Decommission old Data center (old cluster nodes).</li>
</ol>
<br />
<h3 style="text-align: left;">
1. Build a new Datacenter </h3>
<h4 style="text-align: left;">
This further involve following steps:</h4>
1. Ensure that we are using <b><a href="http://docs.datastax.com/en/cassandra_win/2.2/cassandra/architecture/archDataDistributeReplication.html#archDataDistributeReplication__rep-strategy-ul">NetworkTopologyStrategy</a></b> for all of our keyspaces (excluding few system keyspaces)<br />
<br />
2. Make necessary modification in each new nodes config files same as per the nodes of old data center (<b>Fastest way is to copy config files from existing node to new node and make node specific changes in config.</b>)<br />
<h4 style="text-align: left;">
Important configs are:</h4>
<br />
<ul style="text-align: left;">
<li><b>Cluster name should be same as existing cluster name.</b></li>
<li>Specify the seed nodes, don’t forget to add new DC's node as seed node.</li>
<li>Specify/verify necessary values for node IP address same as existing nodes - listen_address, rpc_address, broadcast_rpc_address</li>
<li>Set <b><a href="http://docs.datastax.com/en/cassandra_win/2.2/cassandra/configuration/configCassandra_yaml.html#configCassandra_yaml__auto_bootstrap">auto_bootstrap: false</a></b> in cassandra.yaml file. This can be specified anywhere in cassandra.yaml file. This prevents the new nodes from attempting to get all the data from the other nodes in the data center.</li>
<li>Set endpoint_snitch same as existing node and make entry into respective topology file, in our case we use propertyFileSnitch hence new Datacenter and node entry need to be made in <b>conf/cassandra-topology.properties</b> across all nodes old/new DC.</li>
<li>Make sure to configure similar number of num_token.</li>
<li>Make sure to enable authentication if it is enabled on existing nodes.</li>
<li>Specify data and commitlog directory.</li>
<li>3. Make sure to clean data directory and commitlog directory on new nodes, This will ensure a clean bootstrap.</li>
</ul>
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="font-family: "courier new" , "courier" , monospace;">rm -rf /cassandra/data/*</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> rm -rf /cassandra/log/*</span><br />
<div>
<br /></div>
4. Start Cassandra on each new nodes one by one, during bootstrap it will fetch all the keyspace and tables schemas but not the data.<br />
<br />
5. Verify keyspaces are fetched by looking at data directory or by execute "desc keyspaces" command on new nodes, check "system.log" for any error.<br />
<br />
6. Execute <b><i>"nodetool status"</i></b> to check new datacenter & nodes are showing up with healthy state but LOAD should be very less since data has not been streamed yet (make a note of it we will compare it after streaming.)<br />
<br />
<i><span style="font-size: x-small;"><b>Please see below new datacenter "DC2" having all node up but LOAD across all new node is very less in compare to nodes in existing DataCenter "datacenter1".</b></span></i><br />
<blockquote class="tr_bq">
<br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Datacenter: <span style="background-color: yellow;">DC2</span><br /><span class="Apple-tab-span" style="white-space: pre;"> </span>===============<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>Status=Up/Down<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>|/ State=Normal/Leaving/Joining/Moving<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>-- Address Load Tokens Owns Host ID Rack<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>UN <span style="background-color: black;">1**.27.7*.***</span> <span style="background-color: yellow;">78.56 KB</span> 12 ? 7b9ca516-19aa-432b-ac82-8d8fef44beef RAC1<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>UN <span style="background-color: black;">172.27.74.135</span> <span style="background-color: yellow;">168.65 KB</span> 12 ? 9b47f3eb-b871-4f6b-a04f-894c50dffb5f RAC1<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>Datacenter: datacenter1<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>=======================<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>Status=Up/Down<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>|/ State=Normal/Leaving/Joining/Moving<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>-- Address Load Tokens Owns Host ID Rack<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>UN <span style="background-color: black;">172.27.74.116</span> 228.66 KB 12 ? d4797291-68e5-428a-9e87-94d5ab1125d7 rack1<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>UN <span style="background-color: black;">172.27.74.55</span> 234.22 KB 12 ? 55b08035-7517-4cea-8908-5825ef097389 rack1</span></blockquote>
<div>
<br /></div>
<div>
<br /></div>
7. Alter All Keyspaces and modify replication factor to replicate to new data center too. This is applicable for system_auth keyspace too.<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="font-size: x-small;">ALTER KEYSPACE tutorialspoint WITH replication = {'class': 'NetworkTopologyStrategy','datacenter1': 2,'DC2':1};</span></span><br />
<div>
<br /></div>
<div>
<br /></div>
8. Execute <b>"nodetool rebuild <source-dc-name>"</b> on each new node to stream data that nodes owns/copy of data that node supposed to own as per RF. This can be verified in datadirectory. Nodetool rebuild only streams data from a single source replica per range.<br />
<br />
<ul style="text-align: left;">
<li>This command need to be executed on each NEW node.</li>
<li>This can be executed in parallel on multiple NEW nodes depending on IO.</li>
</ul>
<br />
9. On rebuild against each new node, Verify LOAD owned by each new node by executing "nodetool status".<br />
<br />
Please see below new datacenter "DC2" having all node up and LOAD across all new node is similar to the nodes of DataCenter "datacenter1".<br />
<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;">Datacenter: DC2</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>===============</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Status=Up/Down</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>|/ State=Normal/Leaving/Joining/Moving</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>-- Address Load Tokens Owns Host ID Rack</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>UN <span style="background-color: black;">172.27.74.124</span> <span style="background-color: yellow;">201.81 KB</span> 12 ? 7b9ca516-19aa-432b-ac82-8d8fef44beef RAC1</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>UN <span style="background-color: black;">172.27.74.135</span> <span style="background-color: yellow;">232.75 KB</span> 12 ? 9b47f3eb-b871-4f6b-a04f-894c50dffb5f RAC1</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Datacenter: datacenter1</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>=======================</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>Status=Up/Down</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>|/ State=Normal/Leaving/Joining/Moving</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>-- Address Load Tokens Owns Host ID Rack</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>UN <span style="background-color: black;">172.27.74.116</span> <span style="background-color: yellow;">253.91 KB</span> 12 ? d4797291-68e5-428a-9e87-94d5ab1125d7 rack1</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>UN <span style="background-color: black;">172.27.74.55</span> <span style="background-color: yellow;">227.61 KB</span> 12 ? 55b08035-7517-4cea-8908-5825ef097389 rack1</span><br />
<div>
<br /></div>
<br />
10. Remove <b>"auto_bootstrap: false"</b> in the cassandra.yaml file from all new node. Returns this parameter to its normal setting so the nodes can get all the data from the other nodes in the data center if restarted.<br />
<br />
<b><u>Important:</u></b><br />
<blockquote class="tr_bq">
<ul>
<li><i>Setting up replication factor to replicate to new DC followed by nodetool rebuild ensures all the data has been copied over to new DC nodes and new DC is ready to work independently hence old DC can be decommissioned safely without worrying for data loss.</i></li>
<li><i>This whole process is online and without impacting client, Old DC can be decommissioned anytime but as a best practice we should be taking a snapshot on each node of old dc before decommissioning.</i></li>
</ul>
</blockquote>
<h3 style="text-align: left;">
2. Decommission old Data center (old cluster nodes). </h3>
<h4 style="text-align: left;">
This further involve following steps:</h4>
<br />
<ol style="text-align: left;">
<li>Make sure to take snapshot on each node of old DC to be on safer side (Optional).</li>
<li>Make sure no clients are still writing to any nodes in the data center (Application tier load balancing through driver.)</li>
<li>Run a full repair on new nodes (DC2 nodes), This ensures that all data is propagated from the data center being decommissioned. This is not required if decommission is being done immediately after adding new DC.</li>
<li>Alter keyspace to remove old datacenter from replication strategy, so they no longer reference the data center being removed.</li>
<li>Run <b>"<a href="http://docs.datastax.com/en/cassandra_win/2.2/cassandra/tools/toolsDecommission.html">nodetool decommission</a>" </b>(Causes a live node to decommission itself, streaming its data to the next node on the ring.) on every node in the data center being removed one by one.</li>
<li>Shutdown cassandra service.</li>
<li>Remove old node entry from snitch file (conf/cassandra-topology.properties).</li>
<li>Remove node entry from seed node list in "cassaandra.yaml" file of each new node.</li>
<li>Do a rolling restart to ensure everything come up nicely.</li>
</ol>
<br />
<br /></div>
Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-34326424413642311502016-01-11T02:55:00.000+05:302016-01-11T02:55:13.119+05:30Role Based Access Control (RBAC) Cassandra 2.2.4 Explained with Example<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: left;">
Overview</h3>
<hr />
<br />
Cassandra has recently launced most awaiting feature "Role based access control (RBAC)" but there are very limited information available on web and people actually stuck at practicle scenarios viz.<br />
<br />
<b>1. How to migrate from legacy authentication to RBAC.</b><br />
<b>2. Is there any changes need to be made in cassandra.yaml file.</b><br />
<b>3. What table structure changes been made to system_auth keyspaces.</b><br />
<b>4. What about legacy table.</b><br />
<b>5. We have legacy table as well as new table also and creating a new user doesnt work.</b><br />
<b>6. What are the new commands for RBAC.</b><br />
<br />
Here today i am trying to combined various web resources along with my test cases which might be helpful for you guys while implementing RBAC.<br />
<br />
<u><b>Few Web references:</b></u><br />
<ul style="text-align: left;">
<li><a class="external-link" href="https://issues.apache.org/jira/browse/CASSANDRA-10904" rel="nofollow">https://issues.apache.org/jira/browse/CASSANDRA-10904</a></li>
<li><a class="external-link" href="http://www.datastax.com/dev/blog/role-based-access-control-in-cassandra" rel="nofollow">http://www.datastax.com/dev/blog/role-based-access-control-in-cassandra</a></li>
<li><a class="external-link" href="http://docs.datastax.com/en/latest-cql/cql/cql_reference/list_permissions_r.html" rel="nofollow">http://docs.datastax.com/en/latest-cql/cql/cql_reference/list_permissions_r.html</a></li>
</ul>
<br class="atl-forced-newline" />
<b><ins>IMPORTANT FACTS:</ins></b><br />
<div class="panelMacro">
<table class="noteMacro"><tbody>
<tr><td valign="top"><br /></td><td><br /></td></tr>
</tbody></table>
</div>
<ol>
<li>Legacy tables: <b>users, credentials, permissions</b></li>
<li>New tables: <b>roles, role_members, role_permissions, resource_role_permissons_index</b></li>
<li><b>Ensure following parameter is enabled in cassandra.yaml -</b><span style="color: blue;"><b> </b></span><span style="color: blue;"><b>“role_manager: CassandraRoleManager” </b></span></li>
<li>During upgrade from an earlier version the upgrade of users to role
based system happens automatically. The same can be verified in
system.log Explained below in detail.</li>
<li>The migration doesn’t impact existing users and their login as legacy tables are functioning till superuser doesn’t drop them.</li>
<li><b>If we do not drop legacy tables system will have login
discrepancy, old users will be working fine but if you create a new role
it wont since system is still pointing to legacy tables</b>.</li>
<li><b>It is vital to drop legacy tables after verification of
user/permission migration, this can be done in system.log as well as
data of legacy and new table can be compared.</b></li>
<li><b>As soon as legacy tables gets dropped Cassandra switch itself to
new role bases system and any role being created going forward should
be functioning (<span style="background-color: orange;">a node bounce is not required.</span>)</b></li>
<li>In order for database users to identify as a particular role at
login, that role must have its LOGIN attribute set to true, this
prevents users inadvertently logging in under the identity of a group.</li>
<li>Another interesting aspect to this is that the creator of a role
(the role the database user who issues the CREATE ROLE statement is
logged in as), is automatically granted permissions on it. This enables
users with role-creation privileges to also manage the roles they
create, allowing them to ALTER, DROP, GRANT and REVOKE them. This
automatic granting of ‘ownership’ permissions isn’t limited to roles
either, it also applies to database objects such as keyspaces, tables
(and soon to user defined functions). This largely removes the
requirement to have any active superuser roles, which reduces the risk
of privilege escalation. See <a class="external-link" href="https://issues.apache.org/jira/browse/CASSANDRA-7216" rel="nofollow">CASSANDRA-7216</a> and <a class="external-link" href="https://issues.apache.org/jira/browse/CASSANDRA-8650" rel="nofollow">CASSANDRA-8650</a> for full details.
<br class="atl-forced-newline" />
</li>
</ol>
<h4>
<a href="https://www.blogger.com/null" name="RoleBasedAccessControl(RBAC)Cassandra2.2.4-{}HOWTO:\\"></a><b><ins>HOW TO:</ins></b></h4>
The authentication & authorization subsystems have been
redesigned to support role based access control (RBAC), resulting in a
change to the schema of the system_auth keyspace. See below for more
detail. For systems already using the internal auth implementations, the
process for converting existing data during a rolling upgrade is
straightforward. <b>As each node is restarted, it will attempt to convert any data in the legacy tables into the new schema.</b>
Until enough nodes to satisfy the replication strategy for the
system_auth keyspace are upgraded and so have the new schema, this
conversion will fail with the failure being reported in the system log.<br />
<b><ins>System Log:</ins></b>
<br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">INFO [OptionalTasks:1] CassandraRoleManager.java:410 - Converting legacy users
INFO [OptionalTasks:1] CassandraRoleManager.java:420 - Completed conversion of legacy users
INFO [OptionalTasks:1] CassandraRoleManager.java:425 - Migrating legacy credentials data to <span class="code-keyword">new</span> system table
INFO [OptionalTasks:1] CassandraRoleManager.java:438 - Completed conversion of legacy credentials
INFO [OptionalTasks:1] CassandraAuthorizer.java:396 - Converting legacy permissions data
INFO [OptionalTasks:1] CassandraAuthorizer.java:435 - Completed conversion of legacy permissions
</pre>
</div>
</div>
<b>During the upgrade, Cassandra's internal auth classes will
continue to use the legacy tables, so clients experience no disruption.</b> Issuing DCL<br />
statements during an upgrade is not supported. <b>Once all nodes are
upgraded, an operator with superuser privileges should drop the legacy
tables, system_auth.users, system_auth.credentials and
system_auth.permissions. Doing so will prompt Cassandra to switch over
to the new tables without requiring any further intervention.</b> While
the legacy tables are present a restarted node will re-run the data
conversion and report the outcome so that operators can verify that it
is safe to drop them.
<br />
<br />
<ul>
<li>Authentication & Authorization APIs have been updated to
introduce roles. Roles and Permissions granted to them are inherited,
supporting role based access control. The role concept supercedes that
of users and CQL constructs such as CREATE USER are deprecated but
retained for compatibility. The requirement to explicitly create Roles
in Cassandra even when auth is handled by an external system has been
removed, so authentication & authorization can be delegated to such
systems in their entirety.
</li>
<li>In addition to the above, Roles are also first class resources and
can be the subject of permissions. Users (roles) can now be granted
permissions on other roles, including CREATE, ALTER, DROP &
AUTHORIZE, which removesthe need for superuser privileges in order to
perform user/role management operations.
</li>
<li>Creators of database resources (Keyspaces, Tables, Roles) are now
automatically granted all permissions on them (if the IAuthorizer
implementation supports this).</li>
</ul>
<br />
<h3 style="text-align: left;">
<b> Various permission in RBAC:</b></h3>
<h3 style="text-align: left;">
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--></h3>
<h3 style="text-align: left;">
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="false"
DefSemiHidden="false" DefQFormat="false" DefPriority="99"
LatentStyleCount="371">
<w:LsdException Locked="false" Priority="0" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 6"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 7"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 8"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index 9"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" Name="toc 9"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Normal Indent"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="footnote text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="annotation text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="header"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="footer"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="index heading"/>
<w:LsdException Locked="false" Priority="35" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="table of figures"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="envelope address"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="envelope return"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="footnote reference"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="annotation reference"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="line number"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="page number"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="endnote reference"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="endnote text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="table of authorities"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="macro"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="toa heading"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Bullet 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Number 5"/>
<w:LsdException Locked="false" Priority="10" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Closing"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Signature"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="true"
UnhideWhenUsed="true" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text Indent"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="List Continue 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Message Header"/>
<w:LsdException Locked="false" Priority="11" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Salutation"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Date"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text First Indent"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text First Indent 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Note Heading"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text Indent 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Body Text Indent 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Block Text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Hyperlink"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="FollowedHyperlink"/>
<w:LsdException Locked="false" Priority="22" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Document Map"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Plain Text"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="E-mail Signature"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Top of Form"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Bottom of Form"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Normal (Web)"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Acronym"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Address"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Cite"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Code"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Definition"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Keyboard"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Preformatted"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Sample"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Typewriter"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="HTML Variable"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Normal Table"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="annotation subject"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="No List"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Outline List 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Outline List 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Outline List 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Simple 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Simple 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Simple 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Classic 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Colorful 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Colorful 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Colorful 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Columns 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 6"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 7"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Grid 8"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 4"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 5"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 6"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 7"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table List 8"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table 3D effects 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table 3D effects 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table 3D effects 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Contemporary"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Elegant"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Professional"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Subtle 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Subtle 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Web 1"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Web 2"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Web 3"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Balloon Text"/>
<w:LsdException Locked="false" Priority="39" Name="Table Grid"/>
<w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
Name="Table Theme"/>
<w:LsdException Locked="false" SemiHidden="true" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" SemiHidden="true" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" QFormat="true"
Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" QFormat="true"
Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" QFormat="true"
Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" QFormat="true"
Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" QFormat="true"
Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" QFormat="true"
Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" SemiHidden="true"
UnhideWhenUsed="true" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" SemiHidden="true"
UnhideWhenUsed="true" QFormat="true" Name="TOC Heading"/>
<w:LsdException Locked="false" Priority="41" Name="Plain Table 1"/>
<w:LsdException Locked="false" Priority="42" Name="Plain Table 2"/>
<w:LsdException Locked="false" Priority="43" Name="Plain Table 3"/>
<w:LsdException Locked="false" Priority="44" Name="Plain Table 4"/>
<w:LsdException Locked="false" Priority="45" Name="Plain Table 5"/>
<w:LsdException Locked="false" Priority="40" Name="Grid Table Light"/>
<w:LsdException Locked="false" Priority="46" Name="Grid Table 1 Light"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark"/>
<w:LsdException Locked="false" Priority="51" Name="Grid Table 6 Colorful"/>
<w:LsdException Locked="false" Priority="52" Name="Grid Table 7 Colorful"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 1"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 1"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 1"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 1"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 1"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 2"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 2"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 2"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 2"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 2"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 3"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 3"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 3"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 3"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 3"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 4"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 4"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 4"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 4"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 4"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 5"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 5"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 5"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 5"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 5"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="46"
Name="Grid Table 1 Light Accent 6"/>
<w:LsdException Locked="false" Priority="47" Name="Grid Table 2 Accent 6"/>
<w:LsdException Locked="false" Priority="48" Name="Grid Table 3 Accent 6"/>
<w:LsdException Locked="false" Priority="49" Name="Grid Table 4 Accent 6"/>
<w:LsdException Locked="false" Priority="50" Name="Grid Table 5 Dark Accent 6"/>
<w:LsdException Locked="false" Priority="51"
Name="Grid Table 6 Colorful Accent 6"/>
<w:LsdException Locked="false" Priority="52"
Name="Grid Table 7 Colorful Accent 6"/>
<w:LsdException Locked="false" Priority="46" Name="List Table 1 Light"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark"/>
<w:LsdException Locked="false" Priority="51" Name="List Table 6 Colorful"/>
<w:LsdException Locked="false" Priority="52" Name="List Table 7 Colorful"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 1"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 1"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 1"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 1"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 1"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 1"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 2"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 2"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 2"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 2"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 2"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 2"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 3"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 3"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 3"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 3"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 3"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 3"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 4"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 4"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 4"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 4"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 4"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 4"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 5"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 5"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 5"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 5"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 5"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 5"/>
<w:LsdException Locked="false" Priority="46"
Name="List Table 1 Light Accent 6"/>
<w:LsdException Locked="false" Priority="47" Name="List Table 2 Accent 6"/>
<w:LsdException Locked="false" Priority="48" Name="List Table 3 Accent 6"/>
<w:LsdException Locked="false" Priority="49" Name="List Table 4 Accent 6"/>
<w:LsdException Locked="false" Priority="50" Name="List Table 5 Dark Accent 6"/>
<w:LsdException Locked="false" Priority="51"
Name="List Table 6 Colorful Accent 6"/>
<w:LsdException Locked="false" Priority="52"
Name="List Table 7 Colorful Accent 6"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman",serif;}
</style>
<![endif]--><table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; mso-padding-alt: 0in 0in 0in 0in; mso-yfti-tbllook: 1184;"><tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0;"><td style="background: #7F7F7F; border: solid #A3A3A3 1.0pt; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 266.7pt;" valign="top" width="356"><div style="margin-bottom: .0001pt; margin: 0in;">
<b><span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">GRANT</span></b><span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;"></span></div>
</td>
<td style="background: #7F7F7F; border-left: none; border: solid #A3A3A3 1.0pt; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 181.95pt;" valign="top" width="243"><div style="margin-bottom: .0001pt; margin: 0in;">
<b><span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">Object</span></b><span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;"></span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 1;">
<td style="border-top: none; border: solid #A3A3A3 1.0pt; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 266.7pt;" valign="top" width="356"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">CREATE</span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 181.95pt;" valign="top" width="243"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">keyspace, table, function, role, index</span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 2;">
<td style="border-top: none; border: solid #A3A3A3 1.0pt; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 266.7pt;" valign="top" width="356"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">ALTER</span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 181.95pt;" valign="top" width="243"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">keyspace, table, function, role</span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 3;">
<td style="border-top: none; border: solid #A3A3A3 1.0pt; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 266.7pt;" valign="top" width="356"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">DROP</span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 181.95pt;" valign="top" width="243"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">keyspace, table, function, role, index</span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 4;">
<td style="border-top: none; border: solid #A3A3A3 1.0pt; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 266.7pt;" valign="top" width="356"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">SELECT</span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 181.95pt;" valign="top" width="243"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">keyspace, table</span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 5;">
<td style="border-top: none; border: solid #A3A3A3 1.0pt; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 266.7pt;" valign="top" width="356"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">MODIFY (INSERT, UPDATE, DELETE, TRUNCATE)</span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 181.95pt;" valign="top" width="243"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">keyspace, table</span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 6;">
<td style="border-top: none; border: solid #A3A3A3 1.0pt; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 266.7pt;" valign="top" width="356"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">AUTHORIZE (GRANT PERMISSION, REVOKE
PERMISSION)</span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 181.95pt;" valign="top" width="243"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">keyspace, table, function, role</span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 7;">
<td style="border-top: none; border: solid #A3A3A3 1.0pt; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 266.7pt;" valign="top" width="356"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">DESCRIBE</span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 181.95pt;" valign="top" width="243"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">LIST ROLES</span></div>
</td>
</tr>
<tr style="mso-yfti-irow: 8; mso-yfti-lastrow: yes;">
<td style="border-top: none; border: solid #A3A3A3 1.0pt; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 266.7pt;" valign="top" width="356"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">EXECUTE (SELECT, INSERT, UPDATE)</span></div>
</td>
<td style="border-bottom: solid #A3A3A3 1.0pt; border-left: none; border-right: solid #A3A3A3 1.0pt; border-top: none; padding: 2.0pt 3.0pt 2.0pt 3.0pt; width: 181.95pt;" valign="top" width="243"><div style="margin-bottom: .0001pt; margin: 0in;">
<span style="font-family: "Calibri",sans-serif; font-size: 11.0pt;">functions</span></div>
</td>
</tr>
</tbody></table>
<div style="margin-bottom: .0001pt; margin: 0in;">
<br />
<h3 style="text-align: left;">
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="color: black; font-family: "Calibri",sans-serif; font-size: 11.0pt;"> </span><span style="color: black; font-family: "Calibri",sans-serif; font-size: 11.0pt;">New commands can be found @ <a href="http://docs.datastax.com/en/latest-cql/cql/cql_reference/list_permissions_r.html">http://docs.datastax.com/en/latest-cql/cql/cql_reference/list_permissions_r.html</a></span><br />
</div>
</h3>
</div>
</h3>
<h3 style="text-align: left;">
<a href="https://www.blogger.com/null" name="RoleBasedAccessControl(RBAC)Cassandra2.2.4-RBACImplementation&Testing."></a>RBAC Implementation & Testing.</h3>
<hr />
<b>#Check existing roles.</b>
<br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">admin@cqlsh:system_auth> LIST ROLES;
role | <span class="code-keyword">super</span> | login | options
--------------------+--------
admin | True | True | {}
cassandra | True | True | {}
(2 rows)
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#List all roles of user(role) admin.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">admin@cqlsh:system_auth> LIST ROLES of admin;
role | <span class="code-keyword">super</span> | login | options
----------------+--------
admin | True | True | {}
(1 rows)
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#Create a login enabled super user role.. Ideally creating a user.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">admin@cqlsh:system_auth> CREATE role nnishant WITH PASSWORD = 'abcd@123' AND LOGIN = <span class="code-keyword">true</span> and SUPERUSER = <span class="code-keyword">true</span> ;
</pre>
</div>
</div>
<b>#List all roles of user(role) nnishant. Notice the error, it says role nnishant doesn’t exists, however we have just created it.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">admin@cqlsh:system_auth> LIST ROLES of nnishant;
InvalidRequest: code=2200 [Invalid query] message=<span class="code-quote">"<role nnishant> doesn't exist"</span>
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#Lets list out all the roles..so we can see nnishant here but wait.. Why it is showing super and login FALSE??</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">admin@cqlsh:system_auth> list roles;
role | <span class="code-keyword">super</span> | login | options
--------------------+--------
admin | True | True | {}
cassandra | True | True | {}
nnishant | False | False | {}
(3 rows)
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#Let's check in system table system_auth.roles, here it is showing
it correctly? So where is the problem? Let me tell you if you try to
login using “nnishant” through cqlsh it fails since till now cassandra
has not started using new system tables.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">admin@cqlsh:system_auth> SELECT * from roles;
role | can_login | is_superuser | member_of | salted_hash
-----------------------------------------------------------------------------------------------------
nnishant | True | True | <span class="code-keyword">null</span> | $2a$10$ZgXpLYZ3.9QE5XwtHw6yQe5pB2AGpezSS9hayzPevBjprZ.JuDOnW
admin | True | True | <span class="code-keyword">null</span> | $2a$10$Fg4zH7yFm/IN8kg0dqPR3ODQkY83Oj8SFGy7R5hnSOzqanl9LZ8iC
cassandra | True | True | <span class="code-keyword">null</span> | $2a$10$EAPR.YFjULRORyc/amQXAuS2J2atefzrzT7JZPJ8uy25n7Q6nS9bm
(3 rows)
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#lets create another user test1 with login enabled and having superuser privileges.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">admin@cqlsh:system_auth> create role test1 WITH PASSWORD = 'abcd@123' AND LOGIN = <span class="code-keyword">true</span> AND SUPERUSER = <span class="code-keyword">true</span>;
</pre>
</div>
</div>
<b>#lets list out the roles of user “test1” and again we get the same error.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">admin@cqlsh:system_auth> LIST ROLES of test1;
InvalidRequest: code=2200 [Invalid query] message=<span class="code-quote">"<role test1> doesn't exist"</span>
</pre>
</div>
</div>
<h3 style="text-align: left;">
<a href="https://www.blogger.com/null" name="RoleBasedAccessControl(RBAC)Cassandra2.2.4-{}Sowhereistheproblem??\\"></a><b><ins>So where is the problem??</ins></b></h3>
<b>#lets verify the tables in system_auth, tables highlighted in red are legacy tables and green ones are new tables.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">admin@cqlsh> USE system_auth;
admin@cqlsh:system_auth> desc tables;
role_members roles resource_role_permissons_index permissions
users role_permissions credentials
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#Lets drop the legacy tables; Please note; no need to bounce nodes
after this operation, cassandra automatically and immediately switches
to new tables.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">admin@cqlsh:system_auth> DROP TABLE credentials;
admin@cqlsh:system_auth> DROP TABLE permissions;
admin@cqlsh:system_auth> DROP TABLE users;
admin@cqlsh:system_auth> desc tables;
role_members roles role_permissions resource_role_permissons_index
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#now execute LIST ROLES one again.. BINGO we see correct data now.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">admin@cqlsh:system_auth> LIST ROLES;
role | <span class="code-keyword">super</span> | login | options
--------------------+--------
admin | True | True | {}
cassandra | True | True | {}
nnishant | True | True | {}
test1 | True | True | {}
(4 rows)
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#This also shows correct data.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">admin@cqlsh:system_auth> LIST ROLES of test1;
role | <span class="code-keyword">super</span> | login | options
----------------+--------
test1 | True | True | {}
(1 rows)
admin@cqlsh:system_auth> exit
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#Let's try to connect using user test1 which we had created. And we are in..</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">10:47 AM(cass@ubuntu:)/cassandra/data/system_auth: cqlsh -u test1
Password:
Connected to NAV at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 2.2.4 | CQL spec 3.3.1 | Native protocol v4]
Use HELP <span class="code-keyword">for</span> help.
</pre>
</div>
</div>
<h4>
<a href="https://www.blogger.com/null" name="RoleBasedAccessControl(RBAC)Cassandra2.2.4-{}Exampleonsettingpermissionanduser/rolemapping.\\"></a><b><ins>Example on setting permission and user/role mapping.</ins></b></h4>
<b>#Create a password less role dedicated for DEV team.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">test1@cqlsh> create ROLE ROLE_DEV;
</pre>
</div>
</div>
<b>#Verify if role created as desired.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">test1@cqlsh> LIST ROLES;
role | <span class="code-keyword">super</span> | login | options
--------------------+--------
admin | True | True | {}
cassandra | True | True | {}
nnishant | True | True | {}
role_dev | False | False | {}
test1 | True | True | {}
(5 rows)
test1@cqlsh> LIST ROLES of role_dev;
role | <span class="code-keyword">super</span> | login | options
-------------------+--------
role_dev | False | False | {}
(1 rows)
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#Grant select permission to ROLE_DEV against all keyspaces;</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">test1@cqlsh> GRANT SELECT ON ALL KEYSPACES TO role_dev;
test1@cqlsh> LIST ROLES of role_dev;
role | <span class="code-keyword">super</span> | login | options
-------------------+--------
role_dev | False | False | {}
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#Verify GRANT we have assigned to this role.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">test1@cqlsh> LIST ALL PERMISSIONS OF role_dev;
role | username | resource | permission
--------------------------------+-----------
role_dev | role_dev | <all keyspaces> | SELECT
(1 rows)
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#lets create user for DEV team with login enabled but no superuser.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">test1@cqlsh> CREATE ROLE alex WITH PASSWORD = 'abcd@123' AND LOGIN = <span class="code-keyword">true</span> ;
</pre>
</div>
</div>
<b>#Verify the same.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">test1@cqlsh> LIST ROLES OF alex;
role | <span class="code-keyword">super</span> | login | options
---------------+--------
alex | False | True | {}
(1 rows)
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#Check if alex has any permission on database, note we havent assigned any till now and that’s what we get in result.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">test1@cqlsh> LIST ALL PERMISSIONS OF alex;
role | resource | permissions
-------------------------
(0 rows)
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#Now add DEV team user to its group (role_dev)</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">test1@cqlsh> GRANT role_dev to alex;
</pre>
</div>
</div>
<b>#Now let's again verify the permission, and here we go.. We can see alex has got SELECT permission on all keyspaces.</b><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">test1@cqlsh> LIST ALL PERMISSIONS OF alex;
role | username | resource | permission
--------------------------------+-----------
role_dev | role_dev | <all keyspaces> | SELECT
(1 rows)
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>Similarly we can add multiple team members to their respective
groups. At the same time we can change the permission of entire group by
executing a single command rather that executing it against each user.</b>
<br />
<b>For example:</b>
<br />
<b>We have 50 user mapped to dev group (role_dev). At this point all
those 50 users has SELECT permission against ALL KEYSPACES but now there
is a requirement to give MODIFY permission to all those 50 users on a
specific keyspace "test", this can be simply achieved by executing below
mentioned single command.</b> <span style="color: #339966;"><b>So instead of
executing grant against 50 users we achieved it by executing it against
group. Another beauty of role based access control :)</b></span><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">admin@cqlsh> GRANT MODIFY ON Keyspace test to role_dev;
admin@cqlsh> LIST ALL PERMISSIONS OF role_dev;
role | username | resource | permission
--------------------------------+-----------
role_dev | role_dev | <all keyspaces> | SELECT
role_dev | role_dev | <keyspace test> | MODIFY
(2 rows)
admin@cqlsh> LIST ALL PERMISSIONS OF alex;
role | username | resource | permission
--------------------------------+-----------
role_dev | role_dev | <all keyspaces> | SELECT
role_dev | role_dev | <keyspace test> | MODIFY
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<br />
<b>#Now let's login through dev user alex</b>
<br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">test1@cqlsh> exit
10:58 AM(cass@ubuntu:)/cassandra/data/system_auth: cqlsh -u alex
Password:
Connected to NAV at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 2.2.4 | CQL spec 3.3.1 | Native protocol v4]
Use HELP <span class="code-keyword">for</span> help.
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>#let's check if roles are visible to alex? Yes he has access to
view roles on which he has access but not all. Another level of
security.</b>
<br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">alex@cqlsh> LIST ROLES ;
role | <span class="code-keyword">super</span> | login | options
-------------------+--------
alex | False | True | {}
role_dev | False | False | {}
(2 rows)
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<b>But wait if alex query to system table directly he can see everything..</b> <span style="color: red;"><b>Bingo we have a security breach.. And a bug obviously :)</b></span><br />
<b>So "ALL KEYSPACE" include system Keyspace too,</b> <span style="color: blue;"><b>until it doesn’t get fixed in coming version we should avoid using "ALL KEPSPACE" for any app users.</b></span><br />
<div class="code panel" style="border-width: 1px;">
<div class="codeContent panelContent">
<pre class="code-java">alex@cqlsh> select * from system_auth.roles;
role | can_login | is_superuser | member_of | salted_hash
--------------------------------------------------------------------------------------------------------
nnishant | True | True | <span class="code-keyword">null</span> | $2a$10$ZgXpLYZ3.9QE5XwtHw6yQe5pB2AGpezSS9hayzPevBjprZ.JuDOnW
admin | True | True | <span class="code-keyword">null</span> | $2a$10$Fg4zH7yFm/IN8kg0dqPR3ODQkY83Oj8SFGy7R5hnSOzqanl9LZ8iC
role_dev | False | False | <span class="code-keyword">null</span> | <span class="code-keyword">null</span>
test1 | True | True | <span class="code-keyword">null</span> | $2a$10$i3LeXdJ2y/8iMylHc8Ob6ebMWJOE9Rn3NWbxeokjreKRf4664dpT.
cassandra | True | True | <span class="code-keyword">null</span> | $2a$10$EAPR.YFjULRORyc/amQXAuS2J2atefzrzT7JZPJ8uy25n7Q6nS9bm
alex | True | False |
{'role_dev'}
| $2a$10$Afre.n.by.Bg0Llf5txiS.9sswymcaZ9BsgbmLvi5IWbGsVJ8Msqi
(6 rows)
</pre>
</div>
</div>
<br class="atl-forced-newline" />
<br />
<br class="atl-forced-newline" />
Stay tuned guys....</div>
Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-56129132699017855722014-08-18T06:09:00.002+05:302014-08-18T06:10:33.935+05:30SQL Server Bulk Session kill script<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
Ask for SQL server instance, login and hostname for which the sessions need to be killed and replace the value of <b>@login</b> and <b>@host</b> in below script and execute it on the servers where the session need to be killed.</div>
<br />
<span style="font-family: "Courier New",Courier,monospace;">declare @login varchar (200)</span><br />
<span style="font-family: "Courier New",Courier,monospace;">declare @host varchar (200)</span><br />
<span style="font-family: "Courier New",Courier,monospace;">declare @id int</span><br />
<span style="font-family: "Courier New",Courier,monospace;">declare @host_desc varchar(200)</span><br />
<span style="font-family: "Courier New",Courier,monospace;">declare @login_desc varchar (200)</span><br />
<span style="font-family: "Courier New",Courier,monospace;">declare @str nvarchar(200)</span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="color: #339966;">/* Replace login and hostname value*/</span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><span style="color: #e69138;">SET @login = '<login-need-to-be-killed>'<br />
SET @host = '<b><i><login-from-which-host></i></b>'</span></span><br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">DECLARE cur_kill CURSOR</span><br />
<span style="font-family: "Courier New",Courier,monospace;">STATIC FOR</span><br />
<span style="font-family: "Courier New",Courier,monospace;">SELECT spid SPID,</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> convert(sysname,rtrim(loginame)) Login, </span><br />
<span style="font-family: "Courier New",Courier,monospace;"> convert(varchar(50),rtrim(hostname)) Host</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> FROM</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> master.dbo.sysprocesses a (nolock) </span><br />
<span style="font-family: "Courier New",Courier,monospace;"> inner join master.dbo.sysdatabases b (nolock) on a.dbid=b.dbid</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> WHERE</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> spid > 50 and loginame = @login and hostname = @host</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> ORDER BY</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> cpu desc</span><br />
<span style="font-family: "Courier New",Courier,monospace;"> </span><br />
<span style="font-family: "Courier New",Courier,monospace;"> OPEN cur_kill</span><br />
<span style="font-family: "Courier New",Courier,monospace;">IF @@CURSOR_ROWS > 0</span><br />
<span style="font-family: "Courier New",Courier,monospace;">BEGIN</span><br />
<span style="font-family: "Courier New",Courier,monospace;">FETCH NEXT FROM cur_kill INTO @Id, @login_desc, @host_desc</span><br />
<span style="font-family: "Courier New",Courier,monospace;">WHILE @@Fetch_status = 0</span><br />
<span style="font-family: "Courier New",Courier,monospace;">BEGIN</span><br />
<span style="font-family: "Courier New",Courier,monospace;">set @str = 'kill ' + cast(@id as nvarchar(max))</span><br />
<span style="font-family: "Courier New",Courier,monospace;">--print @str</span><br />
<span style="font-family: "Courier New",Courier,monospace;">exec (@str)</span><br />
<span style="font-family: "Courier New",Courier,monospace;">PRINT '[KILLED] - ID : '+ convert(varchar(20), @Id ) + ', Login : '+@login_desc+ ', Host : '+convert(varchar(20),@host_desc)</span><br />
<span style="font-family: "Courier New",Courier,monospace;">FETCH NEXT FROM cur_kill INTO @Id, @login_desc, @host_desc</span><br />
<span style="font-family: "Courier New",Courier,monospace;">END</span><br />
<span style="font-family: "Courier New",Courier,monospace;">END</span><br />
<span style="font-family: "Courier New",Courier,monospace;">CLOSE cur_kill</span><br />
<span style="font-family: "Courier New",Courier,monospace;">DEALLOCATE cur_kill
</span></div>
Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com1tag:blogger.com,1999:blog-6428405298205573074.post-82450014059751398512014-08-18T06:00:00.000+05:302014-08-18T07:07:40.897+05:30In Order to run a trace against SQL Server you must be a member of sysadmin. (Enable trace access without granting sysadmin role)<div dir="ltr" style="text-align: left;" trbidi="on">
<h4 style="text-align: left;">
Use below query to enable trace access without granting sysadmin role.</h4>
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">Use Master;<br />
GRANT VIEW SERVER STATE TO [Domain\ADGroup or User];<br />
GRANT SHOWPLAN TO [Domain\ADGroup or User];<br />
GRANT ALTER TRACE TO [Domain\ADGroup or User];</span><br />
<br />
<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"><a href="http://www.amazon.in/b?node=1592905031&ref_=as_acmain_dotd&tag=lm09-21" rel="nofollow">Checkout Deal of the Day on Amazon.</a> </span></div>
Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-30931664213581995412014-08-18T05:55:00.001+05:302014-08-18T05:55:45.736+05:30SQL Query to get IP address of local & client machine <div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<span style="font-family: "Courier New",Courier,monospace;"><br /></span>
<span style="font-family: "Courier New",Courier,monospace;">SELECT <br />
CONNECTIONPROPERTY('net_transport') AS net_transport,<br />
CONNECTIONPROPERTY('protocol_type') AS protocol_type,<br />
CONNECTIONPROPERTY('auth_scheme') AS auth_scheme,<br />
CONNECTIONPROPERTY('local_net_address') AS local_net_address,<br />
CONNECTIONPROPERTY('local_tcp_port') AS local_tcp_port,<br />
CONNECTIONPROPERTY('client_net_address') AS client_net_address;</span></div>
Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-18512449939554585892013-04-02T00:36:00.001+05:302013-04-02T00:36:25.029+05:30Facebook Feed is not getting displayed in latest release of Skype - version 6.3<div dir="ltr" style="text-align: left;" trbidi="on">
Hi Guys, Yes i know this post is something out of the scope of this blog but still i though to write this as i believe most of us uses Skype for communication, and if you have upgraded to Skype latest version 6.3 then you must have noticed <b>Facebook Feed Disconnection on Skype Home Page</b> which is very annoying.<br />
<br />
I tried to dig it a bit deeper and found the reason, but don't be happy i do not have the fix for this :( <br />
<br />
When you first connect to Facebook using Skype, it ask for some permission. On of them is <b>Permission to access your data when you are offline</b> which has been <b>Deprecated </b>by Facebook recently.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK38x_rJu9H81Es-OZjNiPZKGtIXW8BjXXMYmuo20lLmh1wM1w_yxhHR_qeTnfa1M0kUyLPaVVuMuBSYBHUcAGdhQPoajrN1Yslw56w-eJhX1PQ3rH7PHp1XoE6Im489NjoT07WrzI8XI/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="307" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgK38x_rJu9H81Es-OZjNiPZKGtIXW8BjXXMYmuo20lLmh1wM1w_yxhHR_qeTnfa1M0kUyLPaVVuMuBSYBHUcAGdhQPoajrN1Yslw56w-eJhX1PQ3rH7PHp1XoE6Im489NjoT07WrzI8XI/s640/Untitled.png" width="640" /></a></div>
<br />
<br />
<br />
You might see Facebook wall for a while and suddenly it goes and you left with the prompt to connect to Facebook again :)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzR54_j2hOGKWRDjfnjy74uyNkAzZ9NAxdGD4Nr5ujyGo_v98G_nqMxfT56JLLY_0lpP8yV5Iwm9Cn2pzv_91i5tzLZWNn89WZZGpBYlZ9LNnOzqk-6wRL-v9EKqTPs28dP25aOkPx39M/s1600/Untitled1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="379" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzR54_j2hOGKWRDjfnjy74uyNkAzZ9NAxdGD4Nr5ujyGo_v98G_nqMxfT56JLLY_0lpP8yV5Iwm9Cn2pzv_91i5tzLZWNn89WZZGpBYlZ9LNnOzqk-6wRL-v9EKqTPs28dP25aOkPx39M/s640/Untitled1.png" width="640" /></a></div>
<br />
If you wish to dig it deeper then Login to Facebook and go to <b>Security Setting -> App Setting</b> click on edit against <b>Skype</b>.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNTFSTwvsp6QwFgHy58hx6qRhrEZG-DhY0OuK4Tf_eyYoVHP2SaiH4sucqztbgZFkl-bsrVLCZjfY0I0CW9cwvH99IQzjgYYG-niEqR0T6jYUW2JxJNopRpyg8V53LUGQEbcO0I89KFTo/s1600/Untitled3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="155" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNTFSTwvsp6QwFgHy58hx6qRhrEZG-DhY0OuK4Tf_eyYoVHP2SaiH4sucqztbgZFkl-bsrVLCZjfY0I0CW9cwvH99IQzjgYYG-niEqR0T6jYUW2JxJNopRpyg8V53LUGQEbcO0I89KFTo/s640/Untitled3.png" width="640" /></a></div>
<br />
And you will get actual error here:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4A7g0yj2-07SGi1iA9B9xKCffsRXHM3q7FVbxlbeRByfyf9DUs8WVygZT_QDdcrAO3-vIVQV1jQYdvfeo3Od8_tbTNrp3Mm2NAJF2sA_UkzO1AwU3r0CUTVpLDi8PgPXWt0s4DOVdVOA/s1600/Untitled2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="244" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4A7g0yj2-07SGi1iA9B9xKCffsRXHM3q7FVbxlbeRByfyf9DUs8WVygZT_QDdcrAO3-vIVQV1jQYdvfeo3Od8_tbTNrp3Mm2NAJF2sA_UkzO1AwU3r0CUTVpLDi8PgPXWt0s4DOVdVOA/s640/Untitled2.png" width="640" /></a></div>
<br />
<br />
<br />
<br />
Guys help me with the solution if you have any? or i hope Microsoft/Skype Team will see my post and soon release a fix for this ;)<br />
<br />
<br /></div>
Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-23798556975402261312012-10-04T17:20:00.003+05:302012-10-04T17:21:47.454+05:30Change the email across all Job alerts using script in SQL Server<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
As a DBA sometimes we get request for add/update/delete of <b>DL’s – Distribution Lists (email groups) </b>across all jobs on a SQL Server Instances. If the frequency of such request is very frequent then it’s better to write a script and run it on requests by simply modifying the email addresses.<br /><br /><b>Here is how we will do this:</b><br /><br />We will take help of 2 tables <b> msdb.dbo.sysjobsteps</b> and <b>msdb.dbo.sysjobsteps</b><br /><br />Query to retrive the list of jobs along with steps which satisfies the condition to search for an email (Simply update the “your-email-address-here” below and execute the query).<br /><span style="font-family: "Courier New",Courier,monospace;"><br />SELECT j.name, js.step_name, js.command FROM msdb.dbo.sysjobsteps js WITH(NOLOCK)<br />LEFT JOIN msdb.dbo.sysjobs j WITH(NOLOCK)<br />ON j.job_id = js.job_id <br />WHERE js.command like '%<your-email-address-here>%'</span><br /><br /><br /><u>Update the old DL with new:</u><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">UPDATE msdb.dbo.sysjobsteps<br />SET command = REPLACE(command,'<search-email-group>','<new-email-group>')<br />WHERE command like '%<your-search-term-here>%'</span></div>
Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com1tag:blogger.com,1999:blog-6428405298205573074.post-21154257131727537632012-07-04T12:53:00.001+05:302012-07-04T13:05:54.280+05:30Reset MySQL root password in Windows and UNIX<div dir="ltr" style="text-align: left;" trbidi="on">
<b>1. Shutdown the MySQL Server –</b><br />
<br />
a. <u>Use windows services to shut down:</u> <i>Start > run > services.msc > MySQL > right click and select STOP </i><br />
<br />
<i> </i><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQr_Ba6Jeof4wjxFvLRtYNfOSAPEQTD4QJj52KwppsGQZFMPsq1JIIAyHWMnUdDwhd4KhNi6Wer3HgKBd-h9TuwrT5kVFPafEmO3s2AW0ZrtLYJYCtgxAl47ibVtqMBr3gACfFyjWxZPc/s1600/img1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="476" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQr_Ba6Jeof4wjxFvLRtYNfOSAPEQTD4QJj52KwppsGQZFMPsq1JIIAyHWMnUdDwhd4KhNi6Wer3HgKBd-h9TuwrT5kVFPafEmO3s2AW0ZrtLYJYCtgxAl47ibVtqMBr3gACfFyjWxZPc/s640/img1.png" width="640" /></a></div>
<br />
<br />
b. Using mysqladmin by running following command in command prompt: <br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">mysqladmin -u root shutdown</span> (make sure to provide the correct path for mysqladmin if it has not been added in windows path) <br />
<br />
<b>2. Start the MySQL Server in safe mode (anonymous login):</b><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"> <b>C:\>start mysqld-nt --skip-grant-tables</b></span> (A black screen will flicker and here you go)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxfT-uJYQRluIdolqI2pDQnHNSEyL_u9rhqeYWgq0samSTH3AyYuOduFWSjfx_rRTqjGEgFToPZVfVpRKAWVsn87qs_pwWZug39m44zu-02eQNpmfjd67KJofFdkq8C-P78OVKwOiJW6s/s1600/img2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxfT-uJYQRluIdolqI2pDQnHNSEyL_u9rhqeYWgq0samSTH3AyYuOduFWSjfx_rRTqjGEgFToPZVfVpRKAWVsn87qs_pwWZug39m44zu-02eQNpmfjd67KJofFdkq8C-P78OVKwOiJW6s/s1600/img2.png" /></a></div>
<br />
<br />
<br />
In UNIX environment u has to use below command:<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"><b>mysqld_safe --skip-grant-tables</b> </span><br />
<br />
<b>3. Now you open the command line and try to connect to the root user with empty password by running below command:</b><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">C:\>Mysql -uroot </span><br />
<br />
<b>4. when you logged in u will get a prompt as</b><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">mysql></span><br />
<br />
<b>5. Now select the MySQL database:</b><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">use mysql;</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqKgRsBhG-nO7rG54BfujSqrulkUQ6wq8Nb4eu4puzhbEQlzhmpN9ICxLr-tqNhdX0Z0tM2vSqRGQyRghfJX9ztqkYbp6NgmtBVsBMzJdvNAGqAfEfLtxjNrwnypG-2sEe8rNo2rQM1I4/s1600/img3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqKgRsBhG-nO7rG54BfujSqrulkUQ6wq8Nb4eu4puzhbEQlzhmpN9ICxLr-tqNhdX0Z0tM2vSqRGQyRghfJX9ztqkYbp6NgmtBVsBMzJdvNAGqAfEfLtxjNrwnypG-2sEe8rNo2rQM1I4/s1600/img3.png" /></a></div>
<br />
<br />
<br />
<b>6. Update the root password by running this command:</b><br />
<br />
<b style="font-family: "Courier New",Courier,monospace;"> mysql> update user set Password=PASSWORD('<new-password>') WHERE User='root';</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjspVmQQWHNqxJnUaeanrabArMZL2U9seTtcxtku7VxrTA6yqVCDkVJeQAN_JdHPOvmIjMVJc8DWiCan9DLyBGigWjpmbWVlb17nncB6g2VaSIInH1OdiF2mMI0Y_KZfYUt1GZJw6aOGd4/s1600/img4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjspVmQQWHNqxJnUaeanrabArMZL2U9seTtcxtku7VxrTA6yqVCDkVJeQAN_JdHPOvmIjMVJc8DWiCan9DLyBGigWjpmbWVlb17nncB6g2VaSIInH1OdiF2mMI0Y_KZfYUt1GZJw6aOGd4/s1600/img4.png" /></a></div>
<br />
<br />
<b>7. Shutdown the MySQL Server:</b> (it is very important to stop the server at this stage since it is running in anonymous mode):<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">mysqladmin -u root shutdown</span><br />
<br />
<b>8. Now start server again and can log in with new password.</b></div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-74578691694831733922012-06-07T18:11:00.000+05:302012-06-07T18:12:57.079+05:30Simple script to find the free space in sql server db files (data, log) against all databases<div dir="ltr" style="text-align: left;" trbidi="on">
Here is a simple SQL script to retrieve the free spaces on db files (data, log).<br />
<br />
The below script will give you the File size, used space and free space of currently selected database only. <br />
<br />
<br />
<div id="block1" style="background-color: #eeeeee; border: 1px solid #000; overflow: auto;">
select<br />
name<br />
, filename<br />
, convert(decimal(12,2),round(a.size/128.000,2)) as FileSizeMB<br />
, convert(decimal(12,2),round(fileproperty(a.name,'SpaceUsed')/128.000,2)) as SpaceUsedMB<br />
, convert(decimal(12,2),round((a.size-fileproperty(a.name,'SpaceUsed'))/128.000,2)) as FreeSpaceMB<br />
from dbo.sysfiles a
<br />
<br /></div>
<br />
<u><b>Output:</b></u><br />
<br />
<img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAnYAAABoCAIAAADzdSpsAAAYeElEQVR4nO2dy28b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RE4LbKV9zTmFGQjc9lwF546NnNSphxpqewx9cipr1ZwNymFFWkc8kqseNcWxjI4oarkeKNYb6ZzEns6Ojs8OonD/QY351Vb2WaPZgoav7N/6Ji8z5L0wck2EzM54InTm7rGxfVlfEyb5HonsmeIs9Hfq0WjIoPspZZQGLcUOFEcltBQC9a2KDIUn1TKWYs7hG0xT7HtMX+/yb8wEVvUboqXkBRdkw/vFtmHwtNWQ2Qb7+nNKcLGrH8XK10TilRxnoYfanRtirE0PnWSlVxsG0MmQBaJNQ3rYnNmRmEisvxdbDIHIdV1wEaYCawkdng6enF4XEaYgU9+WNTmlK2YpeutovR67jtwtmycgZ4hC46Zk4O59YCdxA5HBy+OygiT9btwV2S4F2Rjps8vTePqyVZCAMbAvuEUhmM9smPm5GBuPWAlsSfD08HBYRnBDb+7YQUA1cGxNuWYOTmYWw9YSey3peGG392wAoDq4FibcsycHMytByy/7lQWbvjdDSsAqA6OtSnHzMnB3HrASmIBAAAAkBVZdEWJLUnbAQAAgHkDEgsAAACUAiQWAAAAKAVILAAAAFAKkFgAAACgFCCxAAAAQClAYgEAAIBSgMQCAAAApQCJBQAAAEoBEgsAAACUAiQWAAAAKAVILAAAAFAKkFgAAACgFCCxAAAAQClAYgEAAIBSgMQCAAAApQCJBQAAAEoBEgsAAACUAiQWAAAAKAVILAAAAFAKkFgAAACgFCCxAAAAQCn8P+3VUhhQGLoUAAAAAElFTkSuQmCC" /><br />
<br />
To retrieve the File size, used space and free space across all databases i have written a script using above query.<br />
<br />
<br />
<div id="block1" style="background-color: #eeeeee; border: 1px solid #000; overflow: auto;">
-- create a temporary table to insert the above mentioned output against each databases.<br />
<br />
create table #db_files(<br />
db_files varchar(300),<br />
file_loc varchar(300),<br />
filesizeMB decimal(9,2),<br />
spaceUsedMB decimal(9,2),<br />
FreespaceMB decimal(9,2))<br />
<br />
declare @strSQL nvarchar(2000)<br />
DECLARE @dbName varchar(MAX)<br />
DECLARE @getDBname CURSOR<br />
<br />
SET @getDBname = CURSOR FOR<br />
select name from sys.databases<br />
<br />
OPEN @getDBname<br />
FETCH NEXT<br />
FROM @getDBname INTO @dbName<br />
WHILE @@FETCH_STATUS = 0<br />
BEGIN<br />
PRINT @dbName<br />
<br />
select @strSQL = <br />
'<br />
use ' + @dbname + '<br />
INSERT INTO #db_files<br />
select<br />
name<br />
, filename<br />
, convert(decimal(12,2),round(a.size/128.000,2)) as FileSizeMB<br />
, convert(decimal(12,2),round(fileproperty(a.name,''SpaceUsed'')/128.000,2)) as SpaceUsedMB<br />
, convert(decimal(12,2),round((a.size-fileproperty(a.name,''SpaceUsed''))/128.000,2)) as FreeSpaceMB<br />
from dbo.sysfiles a<br />
'<br />
exec sp_executesql @strSQL<br />
<br />
FETCH NEXT<br />
FROM @getDBname INTO @dbName<br />
<br />
END<br />
CLOSE @getDBname<br />
DEALLOCATE @getDBname<br />
GO<br />
<br />
select * from #db_files<br />
-- drop the temporary table <br />
drop table #db_files<br />
<br />
<br /></div>
<br />
<br />
<u><b>Output:</b></u><br />
<br />
<br />
<img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArcAAAEECAIAAAC9SYtmAAAgAElEQVR4nO19S48lx3Vm/BMuhg0yO5e90kLbsamFNbqF3AnwroCBLXpHG7zVQG4FyBg9IIG1EIaDrksBORgMwBHaXnIhwQD7VhfHSJqGhR4/6McMRUOs7rrvIu4s8hEnIk488nVvxM3zIdB9KzIy4pw48fgiMjMO+4pAIBAIBAIBAzu2AAQCgUAgEDwF+/4Pfnqq4dh1SyAQCARC2GDf/8FP96cIYgkEAoFAIHTEKbOE8YRjtyICgUAgnCZOmSXcjwPEEggEAoEwEEws4fxyjoZH53I45PTviO//4KcvRXz00UcfffTRhyLef//qZcgglkAgEAiE4WBhCZfzfRku9+eaEApLuLyU5fziiy/OLy+PMrv3BWIJBAKBQBgOzfYS1F2ER+fzR480LCFPYyYgyVpN+Hkax2ne8Kbv/+CntyJqlnB7ezv/cj//cv/Bx1+dn1/ehozdbkcsg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uLCYwLh5movAY0UvnHgTcKyeMEYSTOj52mcpN43TvQWYgn+oQ1LEMbGmm4rj8CGR4v3/JUOczThO6LtNw5iZFC621nCZru7W6xgeDIpt1mj6XNdjEvQVDf8rrv+phSMzfzvKqVhgVXf4P6CGMzEfO9o0Py8BHWMyxK4woY5VDHg2A3sZAQp+9owaUUaRGHE8qvSpQTNjC597+1b4xRrmN8S016Ch2jCEvjvAM9LQISvW2JAZwbUaKe7OiIGpLudJaw321d3yyHCQU9V6rKt4/+W0MDw4vwrPbJsAOsc0ujUOMcHz/uUGUEL3xEj1N2BJay3L18thgjDV7d6KCSMMRO5lgdKniRG0zEOaXRqnKNG0H0qaOE7YoS621nCar25fXk3RBhhdQcKshSB0C+C7lNBC98RI9TdzhI+HQwjrO5AQZYiEPpF0H0qaOE7YoS6u5y9OBRGWN2BgixFIPSLoPtU0MJ3xAh1t7MEAoFAIBAI44REGmSWMChDIRAIBAKBEBCIJRAIBAKBQMBBLIFAIBAIBAIOYgkEAoFAIBBwEEsgEAgEAoGAg1gCgUAgEAgEHP8fBGlldCkXXiQAAAAASUVORK5CYII=" /><u><b> </b></u>
<br />
<br />
<br />
<br />
This script will be helpful for lot of SQL Server DBA's out there.. cheers.. <br />
<br /></div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-68090417862578909022012-05-29T15:06:00.001+05:302012-05-29T15:43:56.889+05:30Space Management Report - Get Drive Size and Drive Free Space :SQL Server<div dir="ltr" style="text-align: left;" trbidi="on">
One of the regular DBA practice is to maintain the free space on Drives where the data files are located.<br />
<br />
Here i have created a script (<b>Space Management</b>) which gives us the <b>database files, its location,size, growth rate, the drive where its located, drive size, drive free space etc</b>...<br />
<br />
Most of the thing is very easy to retrieve through SQL Queries as those are maintained in tables under msdb databases, but the free space and size of drive is something which require system interaction using <b>master..xp_cmdshell </b>and that part of query is a bit complex :)<br />
<br />
<br />
<br />
<div id="block1" style="background-color: #eeeeee; border: 1px solid #000; overflow: auto;">
declare @Drive table(DriveName char,freespace decimal(9,2), totalspace decimal(9,2),percentfree decimal(9,2))<br />
<br />
BEGIN <br />
<br />
SET NOCOUNT ON;<br />
<br />
DECLARE @v_cmd nvarchar(255)<br />
,@v_drive char(99)<br />
,@v_sql nvarchar(255)<br />
,@i int<br />
<br />
SELECT @v_cmd = 'fsutil volume diskfree %d%'<br />
SET @i = 1<br />
<br />
-- Creating temporary tables to retrive system space information.<br />
CREATE TABLE #drives(iddrive smallint ,drive char(99))<br />
<br />
CREATE TABLE #temp1(drive char(99),shellCmd nvarchar(500));<br />
<br />
CREATE TABLE #results(drive char(99),freespace decimal(9,2), totalspace decimal(9,2));<br />
<br />
<br />
INSERT #drives (drive) <br />
<br />
EXEC master..xp_cmdshell 'mountvol'<br />
<br />
DELETE #drives WHERE drive not like '%:\%' or drive is null<br />
<br />
<br />
WHILE (@i <= (SELECT count(drive) FROM #drives))<br />
<br />
BEGIN<br />
<br />
UPDATE #drives <br />
SET iddrive=@i<br />
WHERE drive = (SELECT TOP 1 drive FROM #drives WHERE iddrive IS NULL)<br />
<br />
SELECT @v_sql = REPLACE(@v_cmd,'%d%',LTRIM(RTRIM(drive))) from #drives where iddrive=@i<br />
<br />
INSERT #temp1(shellCmd) <br />
EXEC master..xp_cmdshell @v_sql<br />
<br />
UPDATE #temp1 <br />
SET #temp1.drive = d.drive<br />
FROM #drives d<br />
WHERE #temp1.drive IS NULL and iddrive=@i<br />
<br />
SET @i = @i + 1<br />
<br />
END<br />
<br />
<br />
INSERT INTO #results<br />
SELECT bb.drive<br />
,CAST(CAST(REPLACE(REPLACE(SUBSTRING(shellCmd,CHARINDEX(':',shellCmd)+1,LEN(shellCmd)),SPACE(1),SPACE(0))<br />
,char(13),SPACE(0)) AS NUMERIC(32,2))/1024/1024/1024 AS DECIMAL(9,2)) as freespace<br />
,tt.titi as total<br />
FROM #temp1 bb<br />
JOIN (SELECT drive<br />
,CAST(CAST(REPLACE(REPLACE(SUBSTRING(shellCmd,CHARINDEX(':',shellCmd)+1,LEN(shellCmd)),SPACE(1),SPACE(0))<br />
,char(13),SPACE(0)) AS NUMERIC(32,2))/1024/1024/1024 AS DECIMAL(9,2)) as titi<br />
FROM #temp1<br />
WHERE drive IS NOT NULL<br />
AND shellCmd NOT LIKE '%free bytes%') tt<br />
ON bb.drive = tt.drive<br />
WHERE bb.drive IS NOT NULL<br />
AND bb.shellCmd NOT LIKE '%avail free bytes%'<br />
AND bb.shellCmd LIKE '%free bytes%';<br />
<br />
-- getting all system specific formatted data into @Drive table<br />
INSERT INTO @Drive<br />
SELECT LEFT(RTRIM(LTRIM(drive)),1) as drive<br />
,freespace<br />
,totalspace<br />
,CAST((freespace/totalspace * 100) AS DECIMAL(5,2)) as [percent free]<br />
FROM #results<br />
ORDER BY drive<br />
<br />
-- Dropping temporary tables<br />
DROP TABLE #drives<br />
DROP TABLE #temp1<br />
DROP TABLE #results<br />
<br />
<b> </b>SELECT <br />
@@Servername as Server,<br />
sd.name as Database_name,<br />
mas.name as File_Name, <br />
mas.size * 8 / 1024 File_Size_MB,<br />
CASE [is_percent_growth] <br />
WHEN 1 THEN CAST(mas.growth AS varchar(20)) + '%' <br />
ELSE CAST(mas.growth*8/1024 AS varchar(20)) + ' MB' <br />
END as Growth_rate, <br />
drv.DriveName as Drive_Name, <br />
drv.FreeSpace,<br />
drv.totalspace,<br />
CASE type<br />
WHEN 0 THEN 'Data' <br />
WHEN 1 THEN 'Log' <br />
END as File_type, <br />
mas.physical_name as File_Location <br />
FROM sys.master_files mas<br />
LEFT JOIN @Drive drv ON LEFT(mas.physical_name, 1) = drv.DriveName<br />
LEFT JOIN sys.databases sd ON mas.database_id = sd.database_id<br />
--WHERE sd.name IN ('db1','db2','db3') -- <b>Specify the database name if this report is needed for specific databases</b><br />
--AND mas.growth <>0 -- <b>Condition to retrive the record for growing files only.</b><br />
<br />
END<br />
<br /></div>
<br />
<ul style="text-align: left;">
<li>You can restrict the output for some of the databases by providing the database name which is commented by default.</li>
</ul>
<br />
<b> --WHERE sd.name IN ('db1','db2','db3') </b><b> </b><br />
<br />
<ul style="text-align: left;">
<li><b> </b>You can also restrict the output for growing files of the databases only by providing the growth <>0 which is commented by default.</li>
</ul>
<b> --AND mas.growth <>0</b><br />
<br />
There are further filters also possible like if someone want to restrict the query upto a size limit of files etc. simply write it down in where clause.<br />
<br />
<br />
<span style="font-size: small;"><u><b>Output:</b></u></span><br />
<br />
Output should be like this:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJDpTK7kDEl26M9_pTE4bV-CQII_Rc_Ith5aRi_eWevKZ9okZA3sh0CZKznXOFH8YEdp5D5x7LbRhOmXAxB_NcevSrNGXVqA0mqfqNA6Xr81U5Azmx1avSJOpGoG8wGeqswhjN2Zw0Smg/s1600/space_mgmt_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="198" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJDpTK7kDEl26M9_pTE4bV-CQII_Rc_Ith5aRi_eWevKZ9okZA3sh0CZKznXOFH8YEdp5D5x7LbRhOmXAxB_NcevSrNGXVqA0mqfqNA6Xr81U5Azmx1avSJOpGoG8wGeqswhjN2Zw0Smg/s640/space_mgmt_2.jpg" width="640" /></a></div>
<br />
<br />This could be very useful where someone have multiple servers and DBA has to generate weekly/Monthly report for all of the server, in such scenario one can create a SSIS package and execute this query on all the server and generate a single report for all the servers.<br />
<br />
Hope this will be helpful for people out there :) let me know if anyone has any issue.<br />
<br />
<br />
<br />
<br /></div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-27495023143642573852012-05-22T18:07:00.000+05:302012-05-22T18:08:30.569+05:30Script all the jobs in SQL Server<div dir="ltr" style="text-align: left;" trbidi="on">
This is very interesting fact that people always look for shortcuts especially while accomplishing the big tasks.<br />
<br />
Here i have came up with a scenario: I have got a task to setup a new server B (lets assume) exactly as a replica of Existing Server A.<br />
<br />
It involve a lot of steps in which there is a step to copy <b>all the EXISTING JOBS</b> FROM SERVER A to SERVER B (Please note i have written All the Jobs).<br />
<br />
Here is a easiest way i have found which might be helpful for many people.<br />
<br />
<b>Step1:</b> Enable Object explorer detail.<br />
<br />
<b>Step2:</b> <br />
In SQL Server 2005 or earlier: goto <b>view->Summary</b><br />
In SQL Server 2008 or older: goto <b>view-> Object Explorer Details</b><br />
<br />
<b>Step3:</b><br />
Expand <b>SQL Server Agent</b> and click on <b>Jobs.</b><br />
<br />
All the jobs will be visible in summary/Object Explorer Detail<b> </b>window. (See Screenshot).<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkFHfHUXWihzHHHDbt-MyI1KhUaZDgcULi_pvRWF4EEUgi8Jak3uwbhuwDY_Or4hcfRdu9OY6BuyPInJNNDhRWpfOLmQnB37V8LFy5ZTcCSlMyoEehtdMEEkpGC4yWCgYMzr4pv3gM22E/s1600/saj1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="451" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkFHfHUXWihzHHHDbt-MyI1KhUaZDgcULi_pvRWF4EEUgi8Jak3uwbhuwDY_Or4hcfRdu9OY6BuyPInJNNDhRWpfOLmQnB37V8LFy5ZTcCSlMyoEehtdMEEkpGC4yWCgYMzr4pv3gM22E/s640/saj1.png" width="640" /></a></div>
<br />
<br />
<br />
<b>Step4:</b><br />
<br />
Here you can select all the jobs or the desired jobs which you want to script out.<br />
<br />
After select <b>right click -> Script Job As -> Create To -> and select the desired location where you want to script all the selected jobs </b>(In the screenshot i have selected New Query Editor Window).<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiephVUK-9ZMocDptqijOFcaxCPLEGgRbxFQuNlJi2HNs85SymcjX33lQtT8jE31iXaXQRUxxcdtlVcDs36yN9Oc2ur2eGjxkw7Qr3Cnyc-rU_xM0-hehvCguBZT1-hf4cYbHtfq06OTYQ/s1600/saj2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="452" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiephVUK-9ZMocDptqijOFcaxCPLEGgRbxFQuNlJi2HNs85SymcjX33lQtT8jE31iXaXQRUxxcdtlVcDs36yN9Oc2ur2eGjxkw7Qr3Cnyc-rU_xM0-hehvCguBZT1-hf4cYbHtfq06OTYQ/s640/saj2.png" width="640" /></a></div>
<br />
<br />
Note: The above screenshots/Examples are of SQL Server 2008R2 you can follow the same steps with SQL Server 2005 or earlier versions.<br />
<br />
<br />
I hope this will be helpful for may people out there :)<br />
<br />
<br />
<br /></div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-50710975374458141552012-05-18T16:23:00.001+05:302012-05-18T18:25:18.531+05:30Database is in Transition. try the statement later: SQL Server<div dir="ltr" style="text-align: left;" trbidi="on">
<u><b>Problem:</b></u> <br />
<br />
I was trying to take the database offline to perform some maintenance on one of our QA server.<br />
<br />
We have got a strange error "<b>Database is in Transition. try the statement later Error 952</b>"<br />
<br />
Even i was not able to run the <b>sp_who</b> and <b>sp_who2</b> also as it was also giving the same error.<br />
<br />
<br />
<u><b>Resolution:</b></u> What i have tried?<br />
<br />
I <b>closed the SSMS (SQL Server Management Studio) and restarted it again.</b><br />
<br />
Then to confirm and check for any blocking query, i ran sp_who and sp_who2 and it ran successfully.<br />
<br />
Then to make Database offline/online i have used the below command and it worked like a charm :)<br />
<br />
<div style="background-color: #cccccc; font-family: "Courier New",Courier,monospace;">
USE master<br />GO<br /><br />ALTER DATABASE <span style="font-size: x-small;"><db_name></span><br /><br />SET OFFLINE WITH ROLLBACK IMMEDIATE</div>
<div style="background-color: #cccccc; font-family: "Courier New",Courier,monospace;">
...</div>
<div style="background-color: #cccccc; font-family: "Courier New",Courier,monospace;">
...</div>
<div align="left" style="background-color: #cccccc; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">ALTER DATABASE </span><span style="font-size: x-small;"><db_name> SET ONLINE</span></div>
<div align="left">
<br /></div>
<div align="left">
<br /></div>
<div align="left" style="font-family: Times,"Times New Roman",serif;">
<span style="font-size: x-small;"><span style="font-size: small;">Its a</span> </span>strange error with SQL-2005 Management Studio or we can say a bug.</div>
<div align="left" style="font-family: inherit;">
<br /></div>
<div align="left" style="font-family: inherit;">
<br /></div>
<div align="left">
<span style="font-size: x-small;"><span style="font-size: small;"><span style="font-family: Times,"Times New Roman",serif;">This small issue can cause a big headache for someone.. hope this will helpful. :) </span></span></span></div>
<div align="left">
<br /></div>
</div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-63603357823504360812011-08-20T03:00:00.001+05:302011-08-22T15:03:22.487+05:30zfs Snapshot Commands Example<div dir="ltr" style="text-align: left;" trbidi="on"><span class="Apple-style-span" style="background-color: white; font-size: 13px;"></span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyIFklLyq1nthi07OoqzJzwehULwcGDfMtwnIU9r2p14sR7LL4MzJ7z87KMaDJrO1wX07oDyDvcK-0dJGUM3fyMF2BtyTiMyUc_iX5xHOHynpXpmxvXYcGv-ZOks9L9BBef0_knXJJI3A/s1600/zfs_feature_2.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyIFklLyq1nthi07OoqzJzwehULwcGDfMtwnIU9r2p14sR7LL4MzJ7z87KMaDJrO1wX07oDyDvcK-0dJGUM3fyMF2BtyTiMyUc_iX5xHOHynpXpmxvXYcGv-ZOks9L9BBef0_knXJJI3A/s200/zfs_feature_2.jpg" width="200" /></a></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: arial,sans-serif;">As i have already discussed in my previous post <a href="http://learnmysql.blogspot.com/2011/08/zfs-filesystem-and-mysql.html">zfs filesystem and MySQL</a> about zfs overview and two most important command</span><span class="Apple-style-span" style="font-family: 'Courier New',Courier,monospace;"> zpool</span><span class="Apple-style-span" style="font-family: arial,sans-serif;"> and </span><span class="Apple-style-span" style="font-family: 'Courier New',Courier,monospace;">zfs</span><span class="Apple-style-span" style="font-family: arial,sans-serif;">. I am going to continue with usage of zfs snapshots. It </span><i style="font-family: arial,sans-serif;">includes <b>create a pool, Create file system, Taking a snapshot, Renaming Snapshots, Listing all snapshots, restoring from snapshot and Moving the snapshot to other location</b>.</i></div><div class="MsoNormal"><i style="font-family: arial,sans-serif;"><br />
</i></div><div class="MsoNormal" style="font-family: arial,sans-serif;">A <i>snapshot</i> is a read-only copy of a file system or volume. Snapshots can be created <b>almost instantly</b>, and initially consume no additional disk space within the pool. However, as data within the active dataset changes, the snapshot consumes disk space by continuing to reference the old data and so prevents the space from being freed. Snapshots of volumes cannot be accessed directly, but they can be cloned, backed up, rolled back to.<u></u><u></u></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><br />
</div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b>Creating a Pool:<u></u><u></u></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># zpool create zpool1 c2t0d0</span><u></u><u></u></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"><br />
</span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b>List pool:<u></u><u></u></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># zpool list<u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><br />
</div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b>Create file system under above create pool:<u></u><u></u></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="font-family: 'Times New Roman',serif; font-size: 12pt;">Once you have a storage pool, you can build file systems on it:<u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><br />
</div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># zfs create zpool1/data # zfs create zpool1/logs</span><span style="font-family: 'Courier New'; font-size: 10pt;"><u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;">Here we have built <b>“/data”</b> file system on<b> </b>pool<b> <i>zpool1<u></u><u></u></i></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b><i><br />
</i></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b><i>List all zfs file systems:<u></u><u></u></i></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># zfs list<u></u><u></u></span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: 'Courier New';"><br />
</span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b><i>Taking a Snapshot:<u></u><u></u></i></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># <b>zfs</b> <b>snapshot</b> < pool name>/<filesystem name>@<snapshot name><u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b><i>Example:<u></u><u></u></i></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># zfs snapshot zpool1/data01@Snapshot1<u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><br />
</div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b>Remove/Destroy a Snapshot:<u></u><u></u></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># <b>zfs</b> <b>destroy</b> < pool name>/<filesystem name>@<snapshot name><u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b><i>Example:<u></u><u></u></i></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># zfs destroy zpool1/data01@Snapshot1<u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"><br />
</span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b><u></u><u></u></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b>Rename Snapshots:<u></u><u></u></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;">You can rename snapshots but they must be renamed within the pool and dataset from which they were created.<b><u></u><u></u></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># <b>zfs</b> <b>rename</b> < pool name>/<filesystem name>@<snapshot name> < pool name>/<filesystem name>@<snapshot name><u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b><i>Example:<u></u><u></u></i></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># zfs rename <b>zpool1</b>/data01@Snapshot1 <b>zpool1</b>/data01@Snapshot2<u></u><u></u></span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: 'Courier New';"><br />
</span></div><div class="MsoNormal" style="font-family: arial,sans-serif;">Below snapshot rename operation is not supported because the target pool and file system name are different from the pool and file system where the snapshot was created.<span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"><u></u><u></u></span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: 'Courier New';"><br />
</span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># zfs rename <b>zpool1</b>/data01@Snapshot1 <b>zpool3</b>/data01@Snapshot2<u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><br />
</div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b>Displaying zfs Snapshots:<u></u><u></u></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># </span><span style="background-color: #cccccc; font-size: 10pt;">zfs list<u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># </span><span style="background-color: #cccccc; font-size: 10pt;">zfs list -t snapshot</span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><br />
</div><div class="MsoNormal" style="font-family: arial,sans-serif;">You can also list snapshots that were created for a particular file system:</div><div class="MsoNormal" style="font-family: arial,sans-serif;"><u></u></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># </span><span style="background-color: #cccccc; font-size: 10pt;">zfs list -r -t snapshot -o <name>,<creation> <pool>/<home><u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><br />
</div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b>Restore/Rolling Back zfs snapshots:<u></u><u></u></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># <b>zfs</b> <b>rollback</b> < pool name>/<filesystem name>@<snapshot name><u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b><i>Example:<u></u><u></u></i></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># zfs rollback zpool1/data01@Snapshot1<u></u><u></u></span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: 'Courier New';"><br />
</span></div><div class="MsoNormal" style="font-family: arial,sans-serif;">This will restore the entire file system with snapshot.<u></u><u></u></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><br />
</div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b>Restoring individual files:<u></u><u></u></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;">It is possible to copy individual file from a snapshot by changing into the hidden “.zfs” directory of the pool that has been snapped.<u></u><u></u></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><br />
</div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;">cd /<pool name>/<file system name><u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;">cd .zfs<u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;">cp <required file source location> <destination><u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><br />
</div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b>Example:<u></u><u></u></b></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;">cd /zpool1/data01<u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;">cd .zfs<u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;">cp <required file source location> <destination><u></u><u></u></span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: x-small;"><br />
</span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"><b style="background-color: white;">Moving a Snapshot to another system:</b></span><span class="Apple-style-span" style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"><u></u><u></u></span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif;"><span class="Apple-style-span" style="background-color: white;">Wecan move the snapshot to another system and install it there as a usable file system. But at first we need to create a pool to receive the snapshot on the target system.</span></span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: 'Courier New';"><br />
</span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b>Step1: </b>Create Pool on another system.<u></u><u></u></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b></b><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># zpool create -f zpool11 c2t0d0<u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"><br />
</span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"></span><u></u><u></u></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><b>Step2: </b>Send the snapshot over the network and receive it into the pool using a combination of zfs send/receive command and a netwolrk pipe.<u></u><u></u></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><span style="background-color: #cccccc; font-family: 'Courier New'; font-size: 10pt;"># zfs send zpool1/data01@snapshot1 | ssh <destination host> “usr/sbin/zfs receive zpool11/<myfilesystem><u></u><u></u></span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: 'Courier New';"><br />
</span></div><div class="MsoNormal"><span class="Apple-style-span" style="font-family: arial,sans-serif;">Here </span><span class="Apple-style-span" style="font-family: 'Courier New',Courier,monospace;">zpool11</span><span class="Apple-style-span" style="font-family: arial,sans-serif;"> is the name of pool on another system which we have created above and </span><span class="Apple-style-span" style="font-family: 'Courier New',Courier,monospace;">myfilesystem</span><span class="Apple-style-span" style="font-family: arial,sans-serif;"> is the name of filesystem you wish to put.<u></u><u></u></span></div><div class="MsoNormal" style="font-family: arial,sans-serif;"><br />
</div></div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-32560440965107449342011-08-17T16:44:00.003+05:302011-08-18T10:04:21.051+05:30zfs FileSystem and MySQL<div dir="ltr" style="text-align: left;" trbidi="on"><span lang=""><br />
</span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDvPnAJv-6z9pFoszyZL_XCTQLDj2sj4MSFDxtAXXFyXk0mMQtd_x3jNDjigY6aT_HPFVo38tPdjOMLWE1W-ufjcG46Ih7L0cG2P-48P1cLNIR1Rafw6k495W0QNBvRRMKTd2nSAUXTyo/s1600/zfs-banner.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="233" qaa="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDvPnAJv-6z9pFoszyZL_XCTQLDj2sj4MSFDxtAXXFyXk0mMQtd_x3jNDjigY6aT_HPFVo38tPdjOMLWE1W-ufjcG46Ih7L0cG2P-48P1cLNIR1Rafw6k495W0QNBvRRMKTd2nSAUXTyo/s640/zfs-banner.png" width="640" /></a></div><br />
<div closure_uid_429jj7="135">ZFS is a new kind of <b>128-bit</b> file system that provides <b>simple administration</b>, <b>transactional semantics</b>, <b>end-to-end data integrity</b>, and <b>immense scalability</b>. ZFS is not an incremental improvement to existing technology; it is a fundamentally new approach to data management. ZFS was first <b>introduced in Solaris in 2004</b> and it is a <b>default filesystem in OpenSolaris</b>, but Linux ports are underway, Apple is shipping it in OS X 10.5 Leopard with limited zfs capability ( <i>Apple shutdown this project afterward due to some known reason</i>), and it will be included in FreeBSD 7.</div><div closure_uid_429jj7="144"><br />
</div><div closure_uid_ktbm5a="135"><b>ZFS Features:</b></div><ul closure_uid_ktbm5a="146" style="text-align: left;"><li closure_uid_ktbm5a="145">Pooled Storage Model</li>
<li>Always consistent on disk</li>
<li>Protection from data corruption</li>
<li>Live data scrubbing</li>
<li>Instantaneous snapshots and clones</li>
<li>Portable snapshot streams</li>
<li>Highly scalable</li>
<li>Built in compression</li>
<li closure_uid_ktbm5a="147">Simplified administration model</li>
</ul><span lang=""></span><br />
<div closure_uid_ktbm5a="152"><b>Pooled Storage Model:</b> ZFS presents a pooled storage model that completely eliminates the concept of volumes and the associated problems of partitions, provisioning, wasted bandwidth and stranded storage. Thousands of file systems can draw from a common storage pool, each one consuming only as much space as it actually needs. The combined I/O bandwidth of all devices in the pool is available to all file systems at all times.</div><div closure_uid_ktbm5a="152"><br />
</div><div closure_uid_ktbm5a="152"><br />
</div><div class="separator" closure_uid_ktbm5a="403" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPq6X3E_RJQm-aCAsarCL0T1omAB1llHyM6laO4tByLa3LSTYsWl_A4oXWWnQSUepkDMlyE4zAN4Dg6R6Ol0rq4x2OsvM55mrSfN3N-a9QzB0_r0-IcZVZGUzPiEIGWqt7L6qCYEStJkc/s1600/zfs_zpool.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><b><img border="0" height="400" qaa="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPq6X3E_RJQm-aCAsarCL0T1omAB1llHyM6laO4tByLa3LSTYsWl_A4oXWWnQSUepkDMlyE4zAN4Dg6R6Ol0rq4x2OsvM55mrSfN3N-a9QzB0_r0-IcZVZGUzPiEIGWqt7L6qCYEStJkc/s400/zfs_zpool.png" width="320" /></b></a></div><br />
<br />
<br />
<b>Always consistent on disk: </b>All operations are copy-on-write transactions, so the on-disk state is always valid. Every block is checksummed to prevent silent data corruption, and the data is self-healing in replicated (mirrored or RAID) configurations. If one copy is damaged, ZFS detects it and uses another copy to repair it.<br />
<br />
<b>Protection from data corruption: </b>ZFS introduces a new data replication model called RAID-Z. It is similar to RAID-5 but uses variable stripe width to eliminate the RAID-5 write hole (stripe corruption due to loss of power between data and parity updates). All RAID-Z writes are full-stripe writes. There's no read-modify-write tax, no write hole, and — the best part — no need for NVRAM in hardware. ZFS loves cheap disks. <br />
<br />
<b>Live data scrubbing: </b>But cheap disks can fail, so ZFS provides disk scrubbing. Similar to ECC memory scrubbing, all data is read to detect latent errors while they're still correctable. A scrub traverses the entire storage pool to read every data block, validates it against its 256-bit checksum, and repairs it if necessary. All this happens while the storage pool is live and in use. <br />
ZFS has a pipelined I/O engine, similar in concept to CPU pipelines. The pipeline operates on I/O dependency graphs and provides scoreboarding, priority, deadline scheduling, out-of-order issue and I/O aggregation. I/O loads that bring other file systems to their knees are handled with ease by the ZFS I/O pipeline.<br />
<br />
<b>Instantaneous snapshots and clones (<i>Most important and useful for huge backups in seconds</i>): </b>ZFS provides 2 64 constant-time snapshots and clones. A snapshot is a read-only point-in-time copy of a file system, while a clone is a writable copy of a snapshot. Clones provide an extremely space-efficient way to store many copies of mostly-shared data such as workspaces, software installations, and diskless clients. <br />
<br />
<b>Portable snapshot streams (<i>Important & useful feature</i>): </b>You snapshot a ZFS file system, but you can also create incremental snapshots. Incremental snapshots are so efficient that they can be used for remote replication, such as transmitting an incremental update every 10 seconds.<br />
<br />
<b>Highly scalable (<i>Important useful feature</i>): </b>There are no arbitrary limits in ZFS. You can have as many files as you want: full 64-bit file offsets, unlimited links, directory entries, and so on. <br />
<br />
<b>Built in compression: </b>ZFS provides built-in compression. In addition to reducing space usage by 2-3x, compression also reduces the amount of I/O by 2-3x. For this reason, enabling compression actually makes some workloads go faster. <br />
In addition to file systems, ZFS storage pools can provide volumes for applications that need raw-device semantics. ZFS volumes can be used as swap devices, for example. And if you enable compression on a swap volume, you now have compressed virtual memory.<br />
<br />
<b>Simplified administration model: </b>ZFS administration is both simple and powerful. <i>zpool </i><span closure_uid_ktbm5a="215" style="font-family: Times,"Times New Roman",serif;">and</span><i> zfs are</i> <span style="font-family: Times,"Times New Roman",serif;">the only two command you need to know</span><i>.</i> Please see the <span class="wikiexternallink"><a href="http://docs.sun.com/app/docs/doc/819-2240/zpool-1m">zpool(1M)</a></span> and <span class="wikiexternallink"><a href="http://docs.sun.com/app/docs/doc/819-2240/zfs-1m">zfs(1M)</a></span> man pages for more information.<br />
<div closure_uid_ktbm5a="153">The storage pool is a key abstraction: a pool can consist of many physical devices, and can hold many filesystems. Whenever you add storage to the pool, it becomes available to any filesystem that may need it. To take a newly-attached disk and use the whole disk for ZFS storage, you would use the command.</div><div closure_uid_ktbm5a="153"><b><br />
</b></div><div closure_uid_ktbm5a="153"><span closure_uid_ktbm5a="161" style="background-color: #cccccc;"># zpool create zpool1 c2t0d0 </span></div><div closure_uid_ktbm5a="153"><br />
</div><div closure_uid_ktbm5a="153">Here, zpool1 represents the name of a pool, and c2t0d0 is a disk device.</div><div closure_uid_ktbm5a="153"><br />
</div><div closure_uid_ktbm5a="162">If you have a disk had already been formatted – say, with a UFS filesystem on one partition – you can create a storage pool from another free partition:</div><pre closure_uid_ktbm5a="163"><span style="background-color: #cccccc;"><b># zpool create zpool1 c2t0d0s2 </b></span></pre><br />
You can even use a plain file for storage:<br />
<pre closure_uid_ktbm5a="167"><span closure_uid_ktbm5a="170" style="background-color: #cccccc;"># zpool create zpool1 ~/storage/myzfile</span></pre><div closure_uid_ktbm5a="167"><br />
</div><div closure_uid_ktbm5a="177">Once you have a storage pool, you can build filesystems on it:</div><pre closure_uid_ktbm5a="173"><span closure_uid_ktbm5a="178" style="background-color: #cccccc;"># zfs create zpool1/data # zfs create zpool1/logs </span></pre><div closure_uid_ktbm5a="173"><br />
</div>Later on, if you run out of space, just add another device to the pool, and the filesystem will grow. <br />
<pre><span style="background-color: #cccccc;"><b># zpool add zp1 c3t0d0</b></span></pre><br />
<b><span style="font-size: small;">ZFS and Tablespaces:</span></b> <br />
<div closure_uid_ktbm5a="404"><b><br />
</b></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQa9TLTHBBh-eNfz_TRuBjyq5LDWb7K0MEhS2CM1U11qRvWoalh81ZkjgUZo8owclKwsVy2kR0ZOBpJ0Qu3pR3WRHFUMozyShQhR79Zi9q10n4tIqs1lMjSGS2gKsWR-fgP3dJ6J4BEeg/s1600/zfs-mysql.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><b><img border="0" height="188" qaa="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQa9TLTHBBh-eNfz_TRuBjyq5LDWb7K0MEhS2CM1U11qRvWoalh81ZkjgUZo8owclKwsVy2kR0ZOBpJ0Qu3pR3WRHFUMozyShQhR79Zi9q10n4tIqs1lMjSGS2gKsWR-fgP3dJ6J4BEeg/s640/zfs-mysql.png" width="640" /></b></a></div><div closure_uid_ktbm5a="404"><b><br />
</b></div><div closure_uid_ktbm5a="404"><b><br />
</b></div><pre closure_uid_ktbm5a="198"><span style="background-color: #cccccc;"><b>innodb_data_file_path = /dbzpool/data/ibdatafile:20G:autoextend</b></span></pre><div closure_uid_ktbm5a="198"><b><br />
</b></div><div closure_uid_ktbm5a="198">Here is the only innodb_data_file_path that any ZFS system might ever need. You can split this over as many drives as you want, and ZFS will balance the load intelligently. You can stripe it, mirror it, add space when you need room to grow, bring spare disks online, and take faulted disks offline, without ever restarting the database.</div><div closure_uid_ktbm5a="198"><br />
</div><div closure_uid_ktbm5a="198"><b><br />
</b></div><div closure_uid_ktbm5a="198"><b>Please refer </b><a href="http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide"><b>Best practice guide for zfs</b></a><b> and </b><a href="http://www.solarisinternals.com/wiki/index.php/ZFS_Evil_Tuning_Guide"><b>zfs evil tuning guide</b></a></div></div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-73368282049055502702011-08-17T15:25:00.000+05:302011-08-17T15:25:57.679+05:30MySQL Cluster Webinar: Best practices in scaling Web databases with Auto-Partitioning and SQL/noSQL Access<div dir="ltr" style="text-align: left;" trbidi="on"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8i2nXRrmeXiewzeplBgPFkBMDc5hO1ysItac_Wfsa6q0bcUw1N5MiPNnCoM-4hJhM8boIKF2b74wgkJ7xIbPItELzMmM1j-oourDen4a3S0vr3xmqOzdPln8Klkyv19tHQpw_P3HzCqg/s1600/mysql_cluster_conf.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="508" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8i2nXRrmeXiewzeplBgPFkBMDc5hO1ysItac_Wfsa6q0bcUw1N5MiPNnCoM-4hJhM8boIKF2b74wgkJ7xIbPItELzMmM1j-oourDen4a3S0vr3xmqOzdPln8Klkyv19tHQpw_P3HzCqg/s640/mysql_cluster_conf.png" width="640" /></a></div><br />
<br />
<b>Register yourself <a href="https://event.on24.com/eventRegistration/EventLobbyServlet?target=registration.jsp&eventid=331969&sessionid=1&key=016702704DFE3120BDA7DFDD0FB424DB&sourcepage=register">here</a></b> </div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-12909426240634646652011-07-28T11:03:00.000+05:302011-07-28T11:03:08.556+05:30MySQL 5.6.3 Performance improvements<div dir="ltr" style="text-align: left;" trbidi="on"><div class="mbl notesBlogText clearfix"><div><strong> </strong><a href="https://www.facebook.com/Mark.Callaghan"><span style="color: #3b5998;"><strong>Mark Callaghan</strong></span></a><strong closure_uid_a5rbkb="179"> at facebook tested the test release of MySQL 5.6.3 and he has found some performance improvement with InoDB feature. Read below...</strong><br />
<br />
Mark tried two of the previews for MySQL 5.6.3 at <a href="http://labs.mysql.com/">http://labs.mysql.com/</a>. His first attempt with the multi-threaded slave preview was not successful. Parallel apply on the slave is serial when the master does not also run 5.6.3. He said (<em>I hope this changes as a typical upgrade is first done on the slave.</em>)<br />
<br />
<div closure_uid_a5rbkb="148">He was more successful with the InnoDB features preview. A few more mutex contention bottlenecks were removed in it and he wanted to compare the peak row update rate between it and MySQL 5.1.52. he configured InnoDB to use a buffer pool large enough to cache all data and ran a custom version of sysbench with 8 tables. The peak rate on the preview is about twice the peak rate on the unmodified InnoDB plugin in 5.1.52 using an 8-core server.</div><div closure_uid_a5rbkb="148"><br />
</div><div closure_uid_a5rbkb="148">This is good news. <strong>The results below list the number of rows updated per second using 8 to 256 concurrent clients updating 1 row by primary key per UPDATE statement. </strong></div><div closure_uid_a5rbkb="148"><br />
</div><div closure_uid_a5rbkb="148"><strong>Configuration used:</strong></div><div closure_uid_a5rbkb="148"><br />
</div><div closure_uid_a5rbkb="148">The database had 8 tables with 2M rows each.</div><div closure_uid_a5rbkb="148">The binlog was disabled during the test.</div><div closure_uid_a5rbkb="148">innodb_flush_log_at_trx_commit=2,</div><div closure_uid_a5rbkb="148">innodb_doublewrite=0.</div><div closure_uid_a5rbkb="148"><br />
</div><div closure_uid_a5rbkb="148">This is a configuration meant for benchmarks but it also allows maximum stress to be put on InnoDB. He only ran the test once for each level of concurrency and won't try to explain the results at 32 connections.</div><div closure_uid_a5rbkb="148"><br />
</div><div closure_uid_a5rbkb="148"></div><table border="0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; margin: auto auto auto 4.65pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184; width: 475px;"><tbody closure_uid_a5rbkb="176">
<tr style="height: 15pt; mso-yfti-firstrow: yes; mso-yfti-irow: 0;"><td closure_uid_a5rbkb="175" nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #3f3f3f 1pt solid; border-right: #3f3f3f 1pt solid; border-top: #3f3f3f 1pt solid; height: 15pt; mso-border-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 38.7pt;" valign="bottom" width="52"><div align="right" class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; text-align: right;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">8</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #3f3f3f 1pt solid; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; mso-border-top-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 38.7pt;" valign="bottom" width="52"><div align="right" class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; text-align: right;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">16</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #3f3f3f 1pt solid; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; mso-border-top-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 44.3pt;" valign="bottom" width="59"><div align="right" class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; text-align: right;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">32</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #3f3f3f 1pt solid; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; mso-border-top-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 46.75pt;" valign="bottom" width="62"><div align="center" class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; text-align: center;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>64</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #3f3f3f 1pt solid; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; mso-border-top-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 46.75pt;" valign="bottom" width="62"><div align="center" class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; text-align: center;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>128</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #3f3f3f 1pt solid; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; mso-border-top-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 60.05pt;" valign="bottom" width="80"><div align="center" class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; text-align: center;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>256</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #3f3f3f 1pt solid; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; mso-border-top-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 81pt;" valign="bottom" width="108"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">Clients</span></span></div></td></tr>
<tr style="height: 15pt; mso-yfti-irow: 1;"><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #3f3f3f 1pt solid; border-right: #3f3f3f 1pt solid; border-top: #f0f0f0; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-left-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 38.7pt;" valign="bottom" width="52"><div align="right" class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; text-align: right;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">32423</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #f0f0f0; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 38.7pt;" valign="bottom" width="52"><div align="right" class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; text-align: right;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">60394</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #f0f0f0; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 44.3pt;" valign="bottom" width="59"><div align="right" class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; text-align: right;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">121480</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #f0f0f0; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 46.75pt;" valign="bottom" width="62"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"> <span style="mso-spacerun: yes;"> </span>77951</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #f0f0f0; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 46.75pt;" valign="bottom" width="62"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span> 76189</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #f0f0f0; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 60.05pt;" valign="bottom" width="80"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span> 74127</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #f0f0f0; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 81pt;" valign="bottom" width="108"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">mysql 5.1.52</span></span></div></td></tr>
<tr closure_uid_a5rbkb="178" style="height: 15pt; mso-yfti-irow: 2; mso-yfti-lastrow: yes;"><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #3f3f3f 1pt solid; border-right: #3f3f3f 1pt solid; border-top: #f0f0f0; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-left-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 38.7pt;" valign="bottom" width="52"><div align="right" class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; text-align: right;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">30446</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #f0f0f0; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 38.7pt;" valign="bottom" width="52"><div align="right" class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; text-align: right;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">53512</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #f0f0f0; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 44.3pt;" valign="bottom" width="59"><div align="right" class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt; text-align: right;"><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span closure_uid_a5rbkb="177" style="font-family: Calibri;">107291</span></span></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #f0f0f0; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 46.75pt;" valign="bottom" width="62"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><b><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"> 138408</span></span></b></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #f0f0f0; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 46.75pt;" valign="bottom" width="62"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><b><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span> 149003</span></span></b></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #f0f0f0; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 60.05pt;" valign="bottom" width="80"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><b><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"> <span style="mso-spacerun: yes;"> </span>151705</span></span></b></div></td><td nowrap="nowrap" style="background: #f2f2f2; border-bottom: #3f3f3f 1pt solid; border-left: #f0f0f0; border-right: #3f3f3f 1pt solid; border-top: #f0f0f0; height: 15pt; mso-border-bottom-alt: solid #3F3F3F .5pt; mso-border-right-alt: solid #3F3F3F .5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 81pt;" valign="bottom" width="108"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;"><b><span style="color: #3f3f3f; mso-ascii-font-family: Calibri; mso-bidi-font-family: Calibri; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;">mysql 5.6.3</span></span></b></div></td></tr>
</tbody></table><br />
<div closure_uid_a5rbkb="148"><br />
</div></div></div></div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-40480511247716014272011-07-27T11:44:00.002+05:302011-07-28T10:28:49.041+05:30Reduced contention during datafile extension<div dir="ltr" style="text-align: left;" trbidi="on"><div closure_uid_w5sfv0="149"><span class="messageBody" data-ft="{"type":3}">Another performance problem found by <a data-hovercard="/ajax/hovercard/page.php?id=337907684404" href="https://www.facebook.com/poormansprofiler">PoorMansProfiler</a></span></div><div closure_uid_w5sfv0="149"><br />
</div><div closure_uid_w5sfv0="149"><span class="messageBody" data-ft="{"type":3}"><strong>Innam rana said in his blog post on </strong><a href="http://blogs.innodb.com/wp/2011/07/reduced-contention-during-datafile-extension/"><strong>innodb blog</strong></a><strong>:</strong></span></div><br />
<span class="messageBody" data-ft="{"type":3}"></span><br />
<div closure_uid_udsnfr="127"></div><div closure_uid_w5sfv0="147"><br />
</div><br />
<div class="post">InnoDB has an internal file system management module that primarily manages the space in the data files. One of the pain points was the coarse level of locking used when a data file has to be extended. More about this issue can be found <a href="http://bugs.mysql.com/bug.php?id=56433"><strong><span style="color: #549ad8;">here</span></strong></a>. In the latest labs release we have fixed this problem.<br />
When we need to extend a data file inside InnoDB we write zero filled pages synchronously to the file. The user thread which is extending the data file holds fil_system::mutex during the whole operation. This mutex covers changes to all data structures related to file system management. What this means is that when we do a regular IO we do need to acquire fil_system::mutex though only for a short time. Because the thread doing the data file extension is holding the mutex during the whole IO operation any other thread (user or background) trying to access data file for regular read or write ends up waiting. This brings the whole system to a virtual stand still as no read or write activity can happen. This is true even if a thread is trying to access a data file that is not the one being extended.<br />
We fixed this issue by introducing an internal flag to the data structure indicating that a file is being extended. Now if a user thread needs to extend a data file it does acquire the fil_system::mutex but releases it after setting the flag. Once it is done with the extension IO it resets the flag. This allows other threads to access data files while one of the file is being extended. This also allows multiple files to be extended in parallel. Our tests have shown that the issue of stalls due to file extension is indeed fixed by this approach.<br />
A related feature which can be considered as future work is to off load the file extension to a background thread.<br />
<br />
<br />
<br />
</div></div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-33373530396705580992011-07-22T11:57:00.000+05:302011-07-22T11:57:02.079+05:30When does InnoDB compress and decompress pages?<div dir="ltr" style="text-align: left;" trbidi="on"><br />
<div class="mbl notesBlogText clearfix"><div>There are two sections for rows in the page format for InnoDB compressed tables. The compressed section has one or more rows and must be decompressed to access individual rows. The <a __untrusted="true" href="http://dev.mysql.com/doc/innodb/1.1/en/innodb-compression-internals.html" rel="nofollow" target="_blank">modification log</a> has uncompressed rows and rows can be accessed without decompressing. The modification log is used to avoid decompressing and then possibly recompressing the compressed section on every row change. The buffer pool also has separate uncompressed copies of some pages so that every row read does not require a page decompression.<br />
<br />
I want to understand when a page must be decompressed or recompressed. This is definitely an incomplete list.<br />
<ul><li>A page is decompressed when a row is read and the uncompressed version of the page is not in the buffer pool.</li>
<li>I think a row can be deleted from the compressed section without decompressing it in many cases as I think <a href="http://dev.mysql.com/doc/innodb/1.1/en/innodb-compression-tuning.html" onmousedown="UntrustedLink.bootstrap($(this), "aAQDPCl6i", event, bagof(null));" rel="nofollow" target="_blank">marking it deleted</a> uses fields not in the compressed section. </li>
<li>Inserts are done to the modification log assuming it has room. When it is full the modification log and data from the compressed section are merged and the result is recompressed. When the result is too large to fit in a compressed page then the page is split and both post-split pages are recompressed.</li>
<li>I don't understand the code for UPDATE statements and need to read more source code. The <a href="http://dev.mysql.com/doc/innodb/1.1/en/innodb-compression-internals.html" onmousedown="UntrustedLink.bootstrap($(this), "YAQAXtmal", event, bagof(null));" rel="nofollow" target="_blank">docs</a> state that updates can be done to the modification log but I don't know what that implies.</li>
</ul>A compression failure occurs when a page is recompressed and the result is too big. Innodb fixes this by <a href="http://dev.mysql.com/doc/innodb/1.1/en/innodb-compression-internals.html" onmousedown="UntrustedLink.bootstrap($(this), "0AQCofegQ", event, bagof(null));" rel="nofollow" target="_blank">splitting the page</a>. This only works for index-organized tables and InnoDB is index-organized. You can monitor the rate of compression failures using the information schema table <a href="http://dev.mysql.com/doc/innodb/1.1/en/innodb-information-schema-innodb_cmp.html" onmousedown="UntrustedLink.bootstrap($(this), "5AQAOtxUc", event, bagof(null));" rel="nofollow" target="_blank">INNODB_CMP</a>. This reports the global rate of compression failures. When you have a server with many tables you need to know which tables have the high failure rate and that information is only available in a yet-to-be-published Facebook patch.<br />
<br />
But even the changes in the Facebook patch are not sufficient. In some cases it is important to understand which indexes in a table cause the compression failures. The alternative is to guess. All indexes on a table do not compress equally well yet the same compression factor for a table is used for all indexes on it via the KEY_BLOCK_SIZE option to CREATE TABLE.<br />
<div closure_uid_3badyo="183"><br />
</div><div closure_uid_3badyo="183">------------------------------------------------------------------------------------------------------------ </div>By <a href="https://www.facebook.com/Mark.Callaghan"><span style="color: #3b5998;">Mark Callaghan</span></a><br />
<div closure_uid_3badyo="137">Source: <a href="https://www.facebook.com/notes/mark-callaghan/when-does-innodb-compress-and-decompress-pages/10150196544635933">MySQL at Facebook</a></div></div></div></div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-46083231251578642632011-07-19T12:03:00.001+05:302011-07-19T12:05:43.420+05:30MySQL Cluster Architecture<strong><span style="font-size: large;">Introduction:</span></strong><br />
<br />
MySQL Cluster is a write-scalable, real-time, ACID-compliant transactional database, combining 99.999% availability with the low TCO of open source. Designed around a distributed, multi-master architecture with no single point of failure, MySQL Cluster scales horizontally on commodity hardware to serve read and write intensive workloads, accessed via SQL and NoSQL interfaces.<br />
<br />
MySQL Cluster's real-time design delivers predictable, millisecond response times with the ability to service millions of operations per second. Support for in-memory and disk-based data, automatic data partitioning (sharding) with load balancing and the ability to add nodes to a running cluster with zero downtime allows linear database scalability to handle the most unpredictable web-based workloads. <br />
<div></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1uvk1ablYIOjAmZnXUuEwdqcmfeJzVV2B7nBgaSRjaaFeKnkOVDFeona1GX7NUWkTTFfyc0vMaQswXeTuzvCfYpvSFYnCv_ONki3lRG4sSKww3wqHkYy0BcfdlZJ6c-BPlzWPfFQtZS0/s1600/mysql_cluster_acchitecture.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" m$="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1uvk1ablYIOjAmZnXUuEwdqcmfeJzVV2B7nBgaSRjaaFeKnkOVDFeona1GX7NUWkTTFfyc0vMaQswXeTuzvCfYpvSFYnCv_ONki3lRG4sSKww3wqHkYy0BcfdlZJ6c-BPlzWPfFQtZS0/s400/mysql_cluster_acchitecture.png" width="400" /></a></div><br />
<br />
<br />
<br />
MySQL Cluster comprises three types of node which collectively provide service to the application: <br />
<div> </div><ul><li>Data nodes manage the storage and access to data. Tables are automatically sharded across the data nodes which also transparently handle load balancing, replication, failover and self-healing.</li>
</ul><br />
<ul><li>Application nodes provide connectivity from the application logic to the data nodes. Multiple APIs are presented to the application. MySQL provides a standard SQL interface, including connectivity to all of the leading web development languages and frameworks. There are also a whole range of NoSQL inerfaces including memcached, REST/JSON, C++ (NDB-API), Java, JPA and LDAP.</li>
</ul><br />
<ul><li>Management nodes are used to configure the cluster and provide arbitration in the event of a network partition.</li>
</ul><br />
Source: <a href="http://www.mysql.com/products/cluster/architecture.html">http://www.mysql.com/products/cluster/architecture.html</a>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-46783443112300245262011-07-14T18:13:00.003+05:302011-07-14T18:22:36.185+05:30getopts in shell script<b><u>getopts</u><span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;"><br />
</span></span></b><span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;">The getopts command simplifies the task of validating and parsing command line options and arguments for your shell scripts. <br />
<br />
<strong>Syntax:</strong></span></span><br />
<b><span style="font-family: Arial; font-size: x-small;"></span><br />
<span style="font-family: "Courier New", Courier, monospace;">getopts <<i>optstring name> </i><b>[</b><i>arg</i>...<b>]</b> </span><br />
<b><span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;"><br />
<span style="font-family: Arial, Helvetica, sans-serif;">Example:</span></span></span></b><br />
<br />
<span style="font-family: Arial; font-size: x-small;">Step1</span>: First I define all my option holding variables.<br />
<span style="font-family: Courier New; font-size: x-small;"><span style="font-family: Courier New; font-size: x-small;"><br />
ListFiles=0<br />
MoveFiles=0<br />
email=""</span></span><br />
<br />
<b><b><strong><span style="font-size: x-small;">Step2:</span></strong> While loop.<br />
<br />
The following while statement loops through all the options and sets them to the corresponding variable. <b>getopts returns true</b> while there are options to be processed. The argument string, here <b><span style="font-family: Courier New; font-size: x-small;"><span style="font-family: Courier New; font-size: x-small;">"lme:h"</span></span>, specifies which options the script accepts. If the user specifies an option which is not in this string, it will go into * section which will display a help to use this script with examples. If the option is succeeded by a colon, the value immediately following the option is placed in the variable <b>$OPTARG.</b></b></b></b><br />
<b><b><b><span style="font-family: Courier New; font-size: x-small;"><span style="font-family: Courier New; font-size: x-small;"><br />
while getopts "lme:h" option; do<br />
case "$option" in<br />
l) ListFiles=1;;<br />
m) MoveFiles=1;;<br />
e) email="$OPTARG";;<br />
h|*) helpFunction;;<br />
esac<br />
done<br />
<br />
<b><span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;">Script Call:<br />
-----------------------------------------------------------------------------------------------------------------------------------------------</span></span><b><span style="font-family: Courier New; font-size: x-small;"><span style="font-family: Courier New; font-size: x-small;">ExampleScript.sh -l</span></span><span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;"> </span></span></b></b><br />
<b><b><b><b><b><span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;">#It will go into case <b>l) </b>and set </span></span><b><span style="font-family: Courier New; font-size: x-small;"><span style="font-family: Courier New; font-size: x-small;">ListFiles=1.</span></span><span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;"><br />
</span></span><b><span style="font-family: Courier New; font-size: x-small;"><span style="font-family: Courier New; font-size: x-small;"></span></span></b></b></b></b></b></b></b><br />
<b><b><b><b><b><b><b><span style="font-family: Courier New;"><span style="font-family: Courier New;">ExampleScript.sh -m</span></span><span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;"> </span></span></b></b></b></b></b></b></b><br />
<span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;">#It will go into case m) and set </span></span><span style="font-family: Courier New; font-size: x-small;"><span style="font-family: Courier New; font-size: x-small;"><strong>MoveFiles=1.</strong></span></span><span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;"><br />
</span></span><span style="font-family: Courier New; font-size: x-small;"><span style="font-family: Courier New; font-size: x-small;"></span></span><br />
<b><b><b><b><b><b><b><b><b><span style="font-family: Courier New;"><span style="font-family: Courier New;">ExampleScript.sh -m -e "<a href="mailto:example@gmail.com">example@gmail.com</a>"</span></span></b></b></b></b></b></b></b></b></b><br />
<span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;">#It will go into case m) and e) and set </span></span><span style="font-family: Courier New; font-size: x-small;"><span style="font-family: Courier New; font-size: x-small;"><strong>MoveFiles=1</strong> </span></span><span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;">as well as get the email address in </span></span><span style="font-family: Courier New; font-size: x-small;"><span style="font-family: Courier New; font-size: x-small;"><strong>$O</strong></span></span><span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;"><strong>variable</strong> and set it to "<strong>email"</strong> variable.</span></span><span style="font-family: Courier New; font-size: x-small;"><span style="font-family: Courier New; font-size: x-small;"><br />
</span></span><br />
<b><b><b><b><b><b><b><b><b><b><b><span style="font-family: Courier New;"><span style="font-family: Courier New;">ExampleScript.sh -h</span></span></b></b></b></b></b></b></b></b></b></b></b><br />
<span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;">#It will go into case h|*) and call the function </span></span><span style="font-family: Courier New; font-size: x-small;"><span style="font-family: Courier New; font-size: x-small;"><strong>helpFunction</strong> to show help.</span></span><span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;"><br />
<span style="font-family: "Courier New", Courier, monospace;"></span></span></span><br />
<b><b><b><b><b><b><b><b><b><b><b><b><span style="font-family: Arial;"><span style="font-family: Arial;"><span style="font-family: "Courier New", Courier, monospace;">ExampleScript.sh -<anything apart from optstringname we have provided></span></span></span></b></b></b></b></b></b></b></b></b></b></b></b><br />
<span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: x-small;"><span style="font-size: x-small;">#It will also go into case h|*) and will be treated as <strong>"*"</strong> and show the help. </span><br />
<strong>------------------------------------------------------------------------------------------------------------------------------------------------<br />
<br />
<br />
Comments/suggestions are welcome.. Happy scripting ... :)</strong></span></span><span lang="EN"></span><strong><span style="font-family: Calibri; font-size: small;"><span style="font-family: Calibri; font-size: small;"><span lang=""> </span></span></span></strong><br />
<strong><span style="font-size: x-small;"></span></strong></span></span></b></b></b></b>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-42407229743964994552011-07-01T18:03:00.002+05:302011-07-01T18:14:20.860+05:30GET SIZE OF DIRECTORY (EXCLUDE SUBDIRECTORY) IN UNIX<div dir="ltr" style="text-align: left;" trbidi="on">We <span style="font-family: inherit;">all know du command</span> to get the size of a directory. But the problem is when you use "<span style="font-family: "Courier New", Courier, monospace;">du <directory name></span>" it will give you the list of all subdirectory including the directory you want with size.<br />
<br />
Bt what if i only want the size of directory which i have passed as an argument and not all the subdirectory?<br />
<br />
In that senario we can use:<br />
<br />
<strong><span style="background-color: #cccccc; font-family: "Courier New", Courier, monospace;">du -sh <directory name> </span></strong><br />
<br />
<strong><em>Example 1:</em></strong><br />
<br />
<span style="background-color: #cccccc; font-family: "Courier New", Courier, monospace;">du -h /home/mysql/admin/ </span><br />
<span style="background-color: #cccccc; font-family: "Courier New", Courier, monospace;"> 1K /home/mysql/admin/scripts/neel </span><br />
<span style="background-color: #cccccc; font-family: "Courier New", Courier, monospace;"> 8K /home/mysql/admin/scripts </span><br />
<span style="background-color: #cccccc; font-family: "Courier New", Courier, monospace;"> 1K /home/mysql/admin/bin-logs/test_instance_4 </span><br />
<span style="background-color: #cccccc; font-family: "Courier New", Courier, monospace;"> 1K /home/mysql/admin/bin-logs/test_instance_3 </span><br />
<span style="background-color: #cccccc; font-family: "Courier New", Courier, monospace;"> 1K /home/mysql/admin/bin-logs/orphan </span><br />
<span style="background-color: #cccccc; font-family: "Courier New", Courier, monospace;"> 1K /home/mysql/admin/bin-logs/test_instance_1 </span><br />
<span style="background-color: #cccccc; font-family: "Courier New", Courier, monospace;"> 1K /home/mysql/admin/bin-logs/test_instance_2 </span><br />
<span style="background-color: #cccccc; font-family: "Courier New", Courier, monospace;"> 9K /home/mysql/admin/bin-logs </span><br />
<span style="font-family: "Courier New", Courier, monospace;"><span style="background-color: #cccccc;"> <strong>20K /home/mysql/admin </strong></span></span><br />
<br />
<br />
In the above example i have have passed <span style="font-family: "Courier New", Courier, monospace;">"/home/mysql/admin/"</span> as an argument of <span style="font-family: "Courier New", Courier, monospace;">du</span> and it results all subdirectory with size. (Please note<span style="font-family: "Courier New", Courier, monospace;"><strong> -h</strong></span> switch converts the size into human redable and understandable format i.e KB).<br />
<br />
<strong><em>Example 2:</em></strong><br />
<br />
<span style="font-family: "Courier New", Courier, monospace;"> du -<strong>s</strong>h /home/mysql/admin/</span><br />
<span style="font-family: "Courier New", Courier, monospace;"> <strong>20K /home/mysql/admin</strong></span><br />
<br />
In this example i have used switch<strong><span style="font-family: "Courier New", Courier, monospace;"> "s"</span></strong> ( to show the size of current directory and not the subdirectory) along with <span style="font-family: "Courier New", Courier, monospace;">"h"</span> (human redable format) and it gave me the size of <span style="font-family: "Courier New", Courier, monospace;">"/home/mysql/admin</span>"<br />
directory only rather than all subdirectories also.<br />
<br />
I hope this will help someone. :)</div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-14474964257387080692011-06-28T17:31:00.000+05:302011-06-28T17:31:11.169+05:30Turn on or off color syntax highlighting in vi or vim editor<div dir="ltr" style="text-align: left;" trbidi="on"><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;"><span style="font-family: Calibri;">Vim or vi is a text editor. It can be used to edit all kinds of plain text. It is especially useful for editing programs or UNIX/Linux configuration files.</span></div><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Turn on syntax highlighting:</span></span></span></h2><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">Open file (for example test.sh):</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;"><code><span style="font-size: 10pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;">$ vi test.sh</span></code></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;"><span style="font-family: Calibri;">Now press ESC key to enter into command mode then type <span style="mso-spacerun: yes;"> </span>” : syntax on OR syn on”</span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;"><code><span style="font-size: 10pt; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: major-fareast;">:syntax on</span></code><code><span style="font-size: 10pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"></span></code></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;"><code><span style="font-size: 10pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;">OR</span></code></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;"><code><span style="font-size: 10pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="font-family: "Courier New", Courier, monospace;">:syn on</span></span></code></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;"><code><span style="font-size: 10pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;">That’s it.. the color syntax highlighting will be enabled until you close that file (useful when you working on server where you can’t enable it permanently because of restriction and not having desired access of .vimrc file.)</span></code></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;"><br />
</div><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Turn off syntax highlighting:</span></span></span></h2><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">Press ESC key to enter into command mode then type “: syntax off OR syn off”</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: "Courier New", Courier, monospace;"><code><span style="font-size: 10pt; line-height: 115%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: major-fareast;">:syntax off</span></code><code><span style="font-size: 10pt; line-height: 115%; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"></span></code></span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><code><span style="font-size: 10pt; line-height: 115%; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;">OR</span></code></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><code><span style="font-size: 10pt; line-height: 115%; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;"><span style="font-family: "Courier New", Courier, monospace;">: syn off</span></span></code></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><h2 style="margin: 10pt 0in 0pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Enable color syntax highlighting permanently:</span></span></span></h2><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">You may need to add "syntax on" (or "syn on") in your $HOME/.vimrc file</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: "Courier New", Courier, monospace;">$ vi HOME/.vimrc</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">Add "syntax on" (or "syn on")</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">Press ESC to enter into command mode then</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: Calibri;">Save and close the file.</span></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><span style="font-family: "Courier New", Courier, monospace;">:wq <enter> </span></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;"><code><i style="mso-bidi-font-style: normal;"><span style="font-size: 10pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin;">Please note: .vimrc is a system file so it will be hidden and you can see it by using command “ls”</span></i></code></div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;"><b><span style="font-family: "Times New Roman", "serif"; font-size: 10pt; mso-bidi-font-size: 24.0pt; mso-fareast-font-family: "Times New Roman"; mso-font-kerning: 18.0pt;">Any comment would be appreciated thanks </span></b><b><span style="font-family: Wingdings; font-size: 10pt; mso-ascii-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 24.0pt; mso-char-type: symbol; mso-fareast-font-family: "Times New Roman"; mso-font-kerning: 18.0pt; mso-hansi-font-family: "Times New Roman"; mso-symbol-font-family: Wingdings;"><span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings;">J</span></span></b><b><span style="font-family: "Times New Roman", "serif"; font-size: 10pt; mso-bidi-font-size: 24.0pt; mso-fareast-font-family: "Times New Roman"; mso-font-kerning: 18.0pt;"></span></b></div><div class="MsoNormal" style="margin: 0in 0in 10pt;"><br />
</div></div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-15440725608173118042011-06-24T14:24:00.000+05:302011-06-24T14:24:57.057+05:30mysql optimizer Index strategy<div dir="ltr" style="text-align: left;" trbidi="on"><div class="MsoNormal" style="margin: 0in 0in 0pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"><span lang="EN" style="font-family: "Helvetica", "sans-serif"; font-size: 10.5pt; mso-ansi-language: EN;">If the table has a multiple-column index, any leftmost prefix of the index can be used by the optimizer to find rows. For example, if you have a three-column index on </span><b><span lang="EN" style="background: white; color: #026789; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">(col1, col2, col3)</span></b><span lang="EN" style="font-family: "Helvetica", "sans-serif"; font-size: 10.5pt; mso-ansi-language: EN;">, you have indexed search capabilities on </span><b><span lang="EN" style="background: white; color: #026789; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">(col1)</span></b><span lang="EN" style="font-family: "Helvetica", "sans-serif"; font-size: 10.5pt; mso-ansi-language: EN;">, </span><b><span lang="EN" style="background: white; color: #026789; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">(col1, col2)</span></b><span lang="EN" style="font-family: "Helvetica", "sans-serif"; font-size: 10.5pt; mso-ansi-language: EN;">, and </span><b><span lang="EN" style="background: white; color: #026789; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">(col1, col2, col3)</span></b><span lang="EN" style="font-family: "Helvetica", "sans-serif"; font-size: 10.5pt; mso-ansi-language: EN;">. </span></div><div class="MsoNormal" style="margin: 0in 0in 0pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"><span lang="EN" style="font-family: "Helvetica", "sans-serif"; font-size: 10.5pt; mso-ansi-language: EN;">MySQL cannot use an index if the columns do not form a leftmost prefix of the index. Suppose that you have the <a href="http://dev.mysql.com/doc/refman/5.0/en/select.html" title="12.2.8. SELECT Syntax"><b><span style="background: white; color: #026789; font-family: "Courier New"; font-size: 10pt;">SELECT</span></b></a> statements shown here: </span></div><div class="MsoNormal" style="background: #eeeeee; line-height: 15pt; margin: 0in 0in 0pt;"><span lang="EN" style="color: black; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">SELECT * FROM </span><i><span lang="EN" style="background: #cccccc; color: #026789; font-family: "Courier New"; font-size: 9.5pt; mso-ansi-language: EN;">tbl_name</span></i><span lang="EN" style="color: black; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;"> WHERE col1=</span><i><span lang="EN" style="background: #cccccc; color: #026789; font-family: "Courier New"; font-size: 9.5pt; mso-ansi-language: EN;">val1</span></i><span lang="EN" style="color: black; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">;</span></div><div class="MsoNormal" style="background: #eeeeee; line-height: 15pt; margin: 0in 0in 0pt;"><span lang="EN" style="color: black; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">SELECT * FROM </span><i><span lang="EN" style="background: #cccccc; color: #026789; font-family: "Courier New"; font-size: 9.5pt; mso-ansi-language: EN;">tbl_name</span></i><span lang="EN" style="color: black; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;"> WHERE col1=</span><i><span lang="EN" style="background: #cccccc; color: #026789; font-family: "Courier New"; font-size: 9.5pt; mso-ansi-language: EN;">val1</span></i><span lang="EN" style="color: black; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;"> AND col2=</span><i><span lang="EN" style="background: #cccccc; color: #026789; font-family: "Courier New"; font-size: 9.5pt; mso-ansi-language: EN;">val2</span></i><span lang="EN" style="color: black; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">;</span></div><div class="MsoNormal" style="background: #eeeeee; line-height: 15pt; margin: 0in 0in 0pt;"><br />
</div><div class="MsoNormal" style="background: #eeeeee; line-height: 15pt; margin: 0in 0in 0pt;"><span lang="EN" style="color: black; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">SELECT * FROM </span><i><span lang="EN" style="background: #cccccc; color: #026789; font-family: "Courier New"; font-size: 9.5pt; mso-ansi-language: EN;">tbl_name</span></i><span lang="EN" style="color: black; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;"> WHERE col2=</span><i><span lang="EN" style="background: #cccccc; color: #026789; font-family: "Courier New"; font-size: 9.5pt; mso-ansi-language: EN;">val2</span></i><span lang="EN" style="color: black; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">;</span></div><div class="MsoNormal" style="background: #eeeeee; line-height: 15pt; margin: 0in 0in 0pt;"><span lang="EN" style="color: black; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">SELECT * FROM </span><i><span lang="EN" style="background: #cccccc; color: #026789; font-family: "Courier New"; font-size: 9.5pt; mso-ansi-language: EN;">tbl_name</span></i><span lang="EN" style="color: black; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;"> WHERE col2=</span><i><span lang="EN" style="background: #cccccc; color: #026789; font-family: "Courier New"; font-size: 9.5pt; mso-ansi-language: EN;">val2</span></i><span lang="EN" style="color: black; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;"> AND col3=</span><i><span lang="EN" style="background: #cccccc; color: #026789; font-family: "Courier New"; font-size: 9.5pt; mso-ansi-language: EN;">val3</span></i><span lang="EN" style="color: black; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">;</span></div><div class="MsoNormal" style="margin: 0in 0in 0pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"><span lang="EN" style="font-family: "Helvetica", "sans-serif"; font-size: 10.5pt; mso-ansi-language: EN;">If an index exists on </span><b><span lang="EN" style="background: white; color: #026789; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">(col1, col2, col3)</span></b><span lang="EN" style="font-family: "Helvetica", "sans-serif"; font-size: 10.5pt; mso-ansi-language: EN;">, only the first two queries use the index. The third and fourth queries do involve indexed columns, but </span><b><span lang="EN" style="background: white; color: #026789; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">(col2)</span></b><span lang="EN" style="font-family: "Helvetica", "sans-serif"; font-size: 10.5pt; mso-ansi-language: EN;"> and </span><b><span lang="EN" style="background: white; color: #026789; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">(col2, col3)</span></b><span lang="EN" style="font-family: "Helvetica", "sans-serif"; font-size: 10.5pt; mso-ansi-language: EN;"> are not leftmost prefixes of </span><b><span lang="EN" style="background: white; color: #026789; font-family: "Courier New"; font-size: 10pt; mso-ansi-language: EN;">(col1, col2, col3)</span></b><span lang="EN" style="font-family: "Helvetica", "sans-serif"; font-size: 10.5pt; mso-ansi-language: EN;">. </span></div><div class="MsoNormal" style="margin: 0in 0in 0pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 0pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"><br />
</div><div class="MsoNormal" style="margin: 0in 0in 0pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"><span lang="EN" style="font-family: "Helvetica", "sans-serif"; font-size: 10.5pt; mso-ansi-language: EN;">For detail please visit</span></div><a href="http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html">http://dev.mysql.com/doc/refman/5.0/en/mysql-indexes.html</a><br />
</div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0tag:blogger.com,1999:blog-6428405298205573074.post-57971225485178616332011-02-16T12:47:00.002+05:302011-02-16T13:17:28.090+05:30Innodb plugin 1.0.4 fine tune for performance<div dir="ltr" style="text-align: left;" trbidi="on"><span class="Apple-style-span" style="font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px;"></span><br />
<div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b>SERVER SETTINGS (my.cnf)</b></div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b>==========================================================================================================</b></div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">#The MySQL server always must be started with the option ignore_builtin_innodb, as long as you want to use the InnoDB Plugin as a shared library.</div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">ignore_builtin_innodb</div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">#load the InnoDB Plugin and all Information Schema tables implemented in the InnoDB Plugin when the server starts:</div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">plugin-load = innodb=ha_innodb_plugin.so;innodb_trx=ha_innodb_plugin.so;innodb_locks=ha_innodb_plugin.so;<br />
innodb_lock_waits=ha_innodb_plugin.so;innodb_cmp=ha_innodb_plugin.so;innodb_cmp_reset=<br />
ha_innodb_plugin.so;innodb_cmpmem=ha_innodb_plugin.so;innodb_cmpmem_reset=ha_innodb_plugin.so</div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">#To use compression, enable the "file per table" and "file compression"</div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">innodb_file_per_table=1<br />
innodb_file_format=barracuda</div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b>#innodb_buffer_pool_size= 512M (Better performance if increased. suggested value is 50-80% of memory).</b></div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">#The limit on the number of concurrent threads.<br />
innodb_thread_concurrency=32</div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">#number of background threads used for read. The purpose of this change is to make InnoDB more scalable on high end systems. Each background thread can handle up to 256 pending I/O requests.</div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">innodb_read_io_threads=16</div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">#Optional<br />
#InnoDB uses to store data dictionary information and other internal data structures.<br />
#The more tables you have in your application, the more memory you need to allocate here.</div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">innodb_additional_mem_pool_size=20M</div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b>==========================================================================================================</b></div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b><br />
</b></div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b>Cheers!!!!!!!!!<a href="http://www.amazon.com/High-Performance-MySQL-ebook/dp/B0028N4W7Y?ie=UTF8&tag=jindagikaisiy-20&link_code=btl&camp=213689&creative=392969" target="_blank">High Performance MySQL</a><img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=jindagikaisiy-20&l=btl&camp=213689&creative=392969&o=1&a=B0028N4W7Y" style="border: none !important; margin: 0px !important; padding: 0px !important;" width="1" /></b></div><div style="color: black; font-family: Verdana, arial, sans-serif; font-size: 11px; font-weight: normal; line-height: 16px; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 16px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><b><iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=jindagikaisiy-20&o=1&p=8&l=bpl&asins=B0028N4W7Y&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"></iframe></b></div></div>Navjyothttp://www.blogger.com/profile/10947311044610057980noreply@blogger.com0