Files
doc-exports/docs/dws/tool/DWS_DS_50.html
Lu, Huayi 4194b50d78 DWS TOOL 811 version
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>
2022-12-14 20:46:26 +00:00

36 lines
6.1 KiB
HTML

<a name="EN-US_TOPIC_0000001145913123"></a><a name="EN-US_TOPIC_0000001145913123"></a>
<h1 class="topictitle1">Creating a Schema</h1>
<div id="body32001227"><p id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_p60077419">In relational database technology, schemas provide a logical classification of objects in the database. Some of the objects that a schema may contain include functions/procedures, tables, sequences, views, and indexes.</p>
<p id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_p3825860">Follow the steps below to define a schema:</p>
<ol id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_ol34432747"><li id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_li56122452"><span>In the <strong id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_b25081440131251">Object Browser</strong> pane, right-click the selected <strong id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_b1195910194122">Schemas</strong> group<strong id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_b3361418155857"> </strong>and select <strong id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_b30252770155857">Create Schema</strong>.</span><p><div class="note" id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_note45121114156"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_p2108123116379">Only refresh can be performed on <strong id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_b13319236164315">Catalogs</strong> group.</p>
</div></div>
</p></li><li id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_li43969424"><span>Enter the schema name and click <strong id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_b40966612164033">OK</strong>. You can create the schema only if the database connection is active.</span><p><p id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_p141874823617">You can view the new schema in the<strong id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_b10944100164033"> Object Browser</strong> pane.</p>
<p id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_p49496992">The status bar displays the status of the completed operation.</p>
</p></li></ol>
<p id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_p41459272">You can perform the following actions on a schema:</p>
<ul id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_ul5836058419128"><li id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_li125051201266">Refreshing a schema - To refresh a schema, right-click the selected <strong id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_b27214660">Schema Name</strong> and select <strong id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_b43605354">Refresh Schema</strong>. All the objects under that schema will be refreshed.</li><li id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_li711613188810">Renaming a schema (Refer to <a href="DWS_DS_53.html">Renaming a Schema</a> for more details)</li><li id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_li1344100419128">Dropping a schema (Refer to <a href="DWS_DS_55.html">Dropping a Schema</a> for more details)</li><li id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_li4845839819128">Exporting DDL (Refer to <a href="DWS_DS_51.html">Exporting Schema DDL</a> for more details)</li><li id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_li2686162472918">Exporting DDL and data (Refer to <a href="DWS_DS_52.html">Exporting Schema DDL and Data</a> for more details)</li><li id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_li581011919128">Grant/Revoke privilege (Refer to <a href="DWS_DS_54.html">Granting/Revoking a Privilege</a> for more details)</li></ul>
<div class="section" id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_section1115903674918"><h4 class="sectiontitle">Displaying the Default Schema</h4><p id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_p250491715010">Data studio displays default schema of the user in the toolbar.</p>
<p id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_p12745321546"><span><img id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_image136525873710" width="522.69" height="191.848776" src="figure/en-us_image_0000001145833111.png" title="Click to enlarge" class="imgResize"></span></p>
<p id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_p6751101519218">When a create query without mentioning the schema name is executed from SQL Terminal, the corresponding objects are created under the default schema of the user.</p>
<p id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_p10332111913509">When a select query is executed in SQL terminal without mentioning the schema name, the default schemas are searched to find these objects.</p>
<p id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_p11201141831913">When Data Studio starts, the default schemas are set to <strong id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_b1864919304139">&lt;username&gt;</strong>, public schemas in same priority.</p>
<p id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_p137541237102613">If another schema is selected in the drop-down, the selected schema will be set as the default schema, overriding previous setting.</p>
<p id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_p144612120572">The selected schema is set as the default schema for all active connections of the database (selected in database list drop-down).</p>
<div class="note" id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_note1518845742819"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001145913123__en-us_topic_0185264516_p19191115742811">This feature is not available for OLTP database.</p>
</div></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="DWS_DS_48.html">Schemas</a></div>
</div>
</div>
<script language="JavaScript">
<!--
image_size('.imgResize');
var msg_imageMax = "view original image";
var msg_imageClose = "close";
//--></script>