<pre><codeclass="cmd language-cmd">systemctl status taosd</code></pre>
<p>If the service is running successfully, you can play around though TDengine shell <code>taos</code>, the command line interface tool located in directory /usr/local/bin/taos </p>
<p>If the service is running successfully, you can play around through TDengine shell <code>taos</code>, the command line interface tool located in directory /usr/local/bin/taos </p>
<p><strong>Note: The <em>systemctl</em> command needs the root privilege. Use <em>sudo</em> if you are not the <em>root</em> user.</strong></p>
<p>It lists all STables in current DB, including the name, created time, number of fileds, number of tags, and number of tables which are created via this STable. </p>
<aclass='anchor'id='Describe-a-STable'></a><h3>Describe a STable</h3>
<p>To delete a STable, all the tables created via this STable shall be deleted first, otherwise, it will fail.</p>
<aclass='anchor'id='List-the-Associated-Tables-of-a-STable'></a><h3>List the Associated Tables of a STable</h3>
<pre><codeclass='language-mysql'lang='mysql'>SELECT TBNAME,[TAG_NAME,…] FROM <stable_name> WHERE <tag_name><[=|=<|>=|<>] values..> ([AND|OR] …)
</code></pre>
<pre><codeclass='language-mysql'lang='mysql'>SELECT TBNAME,[TAG_NAME,…] FROM <stable_name> WHERE <tag_name><[=|=<|>=|<>] values..> ([AND|OR] …)</code></pre>
<p>It will list all the tables which satisfy the tag filter conditions. The tables are all created from this specific STable. TBNAME is a new keyword introduced, it is the table name associated with the STable. </p>
<pre><codeclass='language-mysql'lang='mysql'>SELECT COUNT(TBNAME) FROM <stable_name> WHERE <tag_name><[=|=<|>=|<>] values..> ([AND|OR] …)
</code></pre>
<pre><codeclass='language-mysql'lang='mysql'>SELECT COUNT(TBNAME) FROM <stable_name> WHERE <tag_name><[=|=<|>=|<>] values..> ([AND|OR] …)</code></pre>
<p>The above SQL statement will list the number of tables in a STable, which satisfy the filter condition.</p>
<aclass='anchor'id='Management-of-Tags'></a><h2>Management of Tags</h2>
<p>You can add, delete and change the tags for a STable, and you can change the tag value of a table. The SQL commands are listed below. </p>
<aclass='anchor'id='Add-a-Tag'></a><h3>Add a Tag</h3>
<pre><codeclass='language-mysql'lang='mysql'>ALTER TABLE <stable_name> ADD TAG <new_tag_name><TYPE>
</code></pre>
<pre><codeclass='language-mysql'lang='mysql'>ALTER TABLE <stable_name> ADD TAG <new_tag_name><TYPE></code></pre>
<p>It adds a new tag to the STable with a data type. The maximum number of tags is 6. </p>
<aclass='anchor'id='Drop-a-Tag'></a><h3>Drop a Tag</h3>
<pre><codeclass='language-mysql'lang='mysql'>ALTER TABLE <stable_name> DROP TAG <tag_name>
</code></pre>
<pre><codeclass='language-mysql'lang='mysql'>ALTER TABLE <stable_name> DROP TAG <tag_name></code></pre>
<p>It drops a tag from a STable. The first tag could not be deleted, and there must be at least one tag.</p>
<aclass='anchor'id='Change-a-Tag's-Name'></a><h3>Change a Tag's Name</h3>
<pre><codeclass='language-mysql'lang='mysql'>ALTER TABLE <stable_name> CHANGE TAG <old_tag_name><new_tag_name>
</code></pre>
<pre><codeclass='language-mysql'lang='mysql'>ALTER TABLE <stable_name> CHANGE TAG <old_tag_name><new_tag_name></code></pre>
<p>It changes the name of a tag from old to new. </p>
<aclass='anchor'id='Change-the-Tag's-Value'></a><h3>Change the Tag's Value</h3>
<pre><codeclass='language-mysql'lang='mysql'>ALTER TABLE <table_name> SET <tag_name>=<new_tag_value>
</code></pre>
<pre><codeclass='language-mysql'lang='mysql'>ALTER TABLE <table_name> SET TAG <tag_name>=<new_tag_value></code></pre>
<p>It changes a table's tag value to a new one. </p>