forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
26 lines
4.4 KiB
HTML
26 lines
4.4 KiB
HTML
<a name="EN-US_TOPIC_0000001098654996"></a><a name="EN-US_TOPIC_0000001098654996"></a>
|
|
|
|
<h1 class="topictitle1">Setting the Validity Period of an Account</h1>
|
|
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001098654996__s7c1c2565b2b841ec881829e704e8a717"><h4 class="sectiontitle">Precautions</h4><p id="EN-US_TOPIC_0000001098654996__ab25b557ff4474f9680f699c770dd54c9">When creating a user, you need to specify the validity period of the user, including the start time and end time.</p>
|
|
<p id="EN-US_TOPIC_0000001098654996__ace34c9ceff984f948355ff898766d7c2">To enable a user not within the validity period to use its account, set a new validity period.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001098654996__sa398a839e3d74c50a068b14b208697ea"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0000001098654996__o99f94fab8e694050a76370943a5a216b"><li id="EN-US_TOPIC_0000001098654996__l174a0e50032e450b84f352b350c3967e"><span>Run the following command to create a user and specify the start time and end time.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001098654996__s7dec106782c740e7a2baef0a23a6b805"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="n">joe</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="n">PASSWORD</span><span class="w"> </span><span class="s1">'password'</span><span class="w"> </span><span class="k">VALID</span><span class="w"> </span><span class="k">BEGIN</span><span class="w"> </span><span class="s1">'2015-10-10 08:00:00'</span><span class="w"> </span><span class="k">VALID</span><span class="w"> </span><span class="k">UNTIL</span><span class="w"> </span><span class="s1">'2016-10-10 08:00:00'</span><span class="p">;</span><span class="w"></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</p></li><li id="EN-US_TOPIC_0000001098654996__ld5c1660f0dba4e458ad7fb23d4310d36"><span>If the user is not within the specified validity period, run the following command to set the start time and end time of a new validity period.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001098654996__s027dd039d2fa40e08fb75b694f113008"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">ALTER</span><span class="w"> </span><span class="k">USER</span><span class="w"> </span><span class="n">joe</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="k">VALID</span><span class="w"> </span><span class="k">BEGIN</span><span class="w"> </span><span class="s1">'2016-11-10 08:00:00'</span><span class="w"> </span><span class="k">VALID</span><span class="w"> </span><span class="k">UNTIL</span><span class="w"> </span><span class="s1">'2017-11-10 08:00:00'</span><span class="p">;</span><span class="w"></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</p></li></ol>
|
|
<div class="note" id="EN-US_TOPIC_0000001098654996__nbe8d04c697874b449321e13d8de92a92"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001098654996__a92951797c10843768c69cf9691c07fd4">If <strong id="EN-US_TOPIC_0000001098654996__en-us_topic_0151096201_en-us_topic_0085032332_b842352706164027">VALID BEGIN</strong> is not specified in the <strong id="EN-US_TOPIC_0000001098654996__en-us_topic_0151096201_en-us_topic_0085032332_b1454926090103234">CREATE ROLE</strong> or <strong id="EN-US_TOPIC_0000001098654996__en-us_topic_0151096201_en-us_topic_0085032332_b21245649103234">ALTER ROLE</strong> statement, the start time of the validity period is not limited. If <strong id="EN-US_TOPIC_0000001098654996__en-us_topic_0151096201_en-us_topic_0085032332_b1872733137103234">VALID UNTIL</strong> is not specified, the end time of the validity period is not limited. If both of the parameters are not specified, the user is always valid.</p>
|
|
</div></div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0063.html">Setting Security Policies</a></div>
|
|
</div>
|
|
</div>
|
|
|