{"id":307,"date":"2008-02-08T22:51:46","date_gmt":"2008-02-09T02:51:46","guid":{"rendered":"http:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/"},"modified":"2017-04-12T07:27:46","modified_gmt":"2017-04-12T11:27:46","slug":"tablespace-and-datafiles-in-oracle-database-back-to-basics","status":"publish","type":"post","link":"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/","title":{"rendered":"Tablespace and Datafiles in Oracle Database : Back to Basics"},"content":{"rendered":"<pre>Image taken from Oracle Documentation<\/pre>\n<p><a title=\"Tablespace , Datafile, Oracle database object\" href=\"https:\/\/onlineappsdba.com\/wp-content\/uploads\/2008\/01\/tablespace_datafile_table.jpg\"><img decoding=\"async\" src=\"https:\/\/onlineappsdba.com\/wp-content\/uploads\/2008\/01\/tablespace_datafile_table.jpg\" alt=\"Tablespace , Datafile, Oracle database object\" \/><\/a><\/p>\n<p><strong>Tablespace<\/strong> : is logical storage unit in Oracle Database.<br \/>\nii) Tablespace connsit of one or more datafiles (check below)<br \/>\niii) Information about Tablespace\u00a0can be obtained from\u00a0view <strong>DBA_TABLESPACES, USER_TABLESPACES, DBA_TEMP_FILES <\/strong>(for Temporary Tablespaces)<br \/>\niv) Tablespace is further divided in to logical units Segments (Segment\u00a0is divided in to Extent and Extent in to Block) . To know more about Segment, Extents and Blocks <a href=\"https:\/\/onlineappsdba.com\/index.php\/2008\/01\/31\/blocks-extents-segments-in-oracle-database-back-to-basics\/\" target=\"_blank\">click here<\/a><br \/>\nv) Various type of tablespace are BIGFILE, SYSTEM, SYSAUX, UNDO<\/p>\n<p><strong>Datafiles<\/strong> : is physical structure to store oracle data<br \/>\nii) One or more physical datafile are logically grouped together to make a tablespace<br \/>\niii) Information about\u00a0Datafile can be obtained from view <strong>DBA_DATA_FILES<br \/>\n<\/strong>iv) A Datafile can be associated with only one tablespace<\/p>\n<p><strong><u>Adding Tablespace in database<\/u><br \/>\n<\/strong>Use\u00a0CREATE TABLESPACE command to add tablespace in Database like<br \/>\nCREATE TABLESPACE &lt;tablespace_name&gt; DATAFILE &lt;location_of_datafile&gt;<br \/>\nCREATE TABLESPACE\u00a0my_tablespace DATAFILE\u00a0&#8216;\/u01\/oracle\/oradata\/data01.dbf&#8217;;<\/p>\n<p>To create undo tablespace<br \/>\nCREATE <strong>UNDO<\/strong>TABLESPACE\u00a0&lt;tablespace_name&gt; DATAFILE &lt;location_of_datafile&gt; SIZE &lt;size&gt; [AUTOEXTEND ON|OFF] [RETENTION GURANTEE|NOGURANTEE]<\/p>\n<p>To create Temporary tablespace<br \/>\nCREATE\u00a0<strong>TEMPORARY<\/strong>TABLESPACE\u00a0&lt;tablespace_name&gt; <strong>TEMP<\/strong>FILE &lt;location_of_datafile&gt; SIZE &lt;size&gt; [AUTOEXTEND ON|OFF]<\/p>\n<p><strong><u>Adding Datafile in a Tablespace<br \/>\n<\/u><\/strong>Use\u00a0ALTER TABLESPACE to add\u00a0datafile in\u00a0tablespace like<br \/>\nALTER\u00a0TABLESPACE &lt;tablespace_name&gt; ADD DATAFILE &lt;location_of_datafile&gt;<br \/>\nALTER TABLESPACE\u00a0my_tablespace ADD DATAFILE\u00a0&#8216;\/u01\/oracle\/oradata\/data02.dbf&#8217;;<\/p>\n<p>To add temporary file in TEMP table space<br \/>\nALTER TABLESPACE &lt;tablespace_name&gt; ADD <strong>TEMP<\/strong>FILE &#8216;&lt;location_of_tempfile&gt;&#8217; SIZE &lt;size&gt;;<\/p>\n<p><strong><u>Modify Datafile<br \/>\n<\/u><\/strong>You can modify datafile using ALTER DATABASE command like<br \/>\nALTER\u00a0DATABASE DATAFILE &lt;location_of_datafile&gt;\u00a0AUTOEXTEND ON|OFF NEXT &lt;size&gt; MAXSIZE &lt;size&gt;;<\/p>\n<p>ALTER DATABASE DATAFILE &#8216;\/u01\/oracle\/oradata\/data02.dbf&#8217; AUTOEXTEND ON NEXT 30M MAXSIZE 1200M;<\/p>\n<p>which means datafile data02.dbf can automatically grow upto 1200 MB size in blocks of 30 MB each time as required.<\/p>\n<p><strong><u>Related<br \/>\n<\/u><\/strong><a href=\"http:\/\/www.psoug.org\/reference\/tablespaces.html\">http:\/\/www.psoug.org\/reference\/tablespaces.html<\/a><\/p>\n<p>Did you get a chance to download Free Interview Questions related to Database? If not, download it here\u00a0<a href=\"http:\/\/k21academy.com\/oracle-dba-12c-interview-question\">http:\/\/k21academy.com\/oracle-dba-12c-interview-question<\/a><\/p>\n<p><a href=\"http:\/\/k21academy.com\/oracle-dba-12c-interview-question\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-11718\" src=\"https:\/\/onlineappsdba.com\/wp-content\/uploads\/2009\/08\/IMG-20170225-WA0010-1024x154.jpg\" alt=\"Database interview questions\" width=\"1024\" height=\"154\" srcset=\"https:\/\/onlineappsdba.com\/wp-content\/uploads\/2009\/08\/IMG-20170225-WA0010-1024x154.jpg 1024w, https:\/\/onlineappsdba.com\/wp-content\/uploads\/2009\/08\/IMG-20170225-WA0010-150x23.jpg 150w, https:\/\/onlineappsdba.com\/wp-content\/uploads\/2009\/08\/IMG-20170225-WA0010-300x45.jpg 300w, https:\/\/onlineappsdba.com\/wp-content\/uploads\/2009\/08\/IMG-20170225-WA0010-80x12.jpg 80w, https:\/\/onlineappsdba.com\/wp-content\/uploads\/2009\/08\/IMG-20170225-WA0010-220x33.jpg 220w, https:\/\/onlineappsdba.com\/wp-content\/uploads\/2009\/08\/IMG-20170225-WA0010-250x38.jpg 250w, https:\/\/onlineappsdba.com\/wp-content\/uploads\/2009\/08\/IMG-20170225-WA0010-280x42.jpg 280w, https:\/\/onlineappsdba.com\/wp-content\/uploads\/2009\/08\/IMG-20170225-WA0010-510x77.jpg 510w, https:\/\/onlineappsdba.com\/wp-content\/uploads\/2009\/08\/IMG-20170225-WA0010-750x113.jpg 750w, https:\/\/onlineappsdba.com\/wp-content\/uploads\/2009\/08\/IMG-20170225-WA0010-975x146.jpg 975w, https:\/\/onlineappsdba.com\/wp-content\/uploads\/2009\/08\/IMG-20170225-WA0010-1190x179.jpg 1190w, https:\/\/onlineappsdba.com\/wp-content\/uploads\/2009\/08\/IMG-20170225-WA0010.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Image taken from Oracle Documentation Tablespace : is logical storage unit in Oracle Database. ii) Tablespace connsit of one or [&hellip;]<\/p>\n","protected":false},"author":115,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[191,190],"class_list":["post-307","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-datafiles","tag-tablespace"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tablespace and Datafiles in Oracle Database : Back to Basics -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tablespace and Datafiles in Oracle Database : Back to Basics -\" \/>\n<meta property=\"og:description\" content=\"Image taken from Oracle Documentation Tablespace : is logical storage unit in Oracle Database. ii) Tablespace connsit of one or [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/\" \/>\n<meta property=\"article:published_time\" content=\"2008-02-09T02:51:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-12T11:27:46+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/onlineappsdba.com\/wp-content\/uploads\/2008\/01\/tablespace_datafile_table.jpg\" \/>\n<meta name=\"author\" content=\"Masroof Ahmad\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Masroof Ahmad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/\",\"url\":\"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/\",\"name\":\"Tablespace and Datafiles in Oracle Database : Back to Basics -\",\"isPartOf\":{\"@id\":\"https:\/\/onlineappsdba.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/onlineappsdba.com\/wp-content\/uploads\/2008\/01\/tablespace_datafile_table.jpg\",\"datePublished\":\"2008-02-09T02:51:46+00:00\",\"dateModified\":\"2017-04-12T11:27:46+00:00\",\"author\":{\"@id\":\"https:\/\/onlineappsdba.com\/#\/schema\/person\/909a876ed58d400faf82caf81d61bfdb\"},\"breadcrumb\":{\"@id\":\"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/#primaryimage\",\"url\":\"http:\/\/onlineappsdba.com\/wp-content\/uploads\/2008\/01\/tablespace_datafile_table.jpg\",\"contentUrl\":\"http:\/\/onlineappsdba.com\/wp-content\/uploads\/2008\/01\/tablespace_datafile_table.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/onlineappsdba.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tablespace and Datafiles in Oracle Database : Back to Basics\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/onlineappsdba.com\/#website\",\"url\":\"https:\/\/onlineappsdba.com\/\",\"name\":\"\",\"description\":\"Oracle Implementation &amp; Training Experts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/onlineappsdba.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/onlineappsdba.com\/#\/schema\/person\/909a876ed58d400faf82caf81d61bfdb\",\"name\":\"Masroof Ahmad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/onlineappsdba.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/10f9db7bdbbd7f9ccfbe9b2d208e5978fc28315e9c704383e639a926ea0fce5f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/10f9db7bdbbd7f9ccfbe9b2d208e5978fc28315e9c704383e639a926ea0fce5f?s=96&d=mm&r=g\",\"caption\":\"Masroof Ahmad\"},\"url\":\"https:\/\/onlineappsdba.com\/index.php\/author\/masroof\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tablespace and Datafiles in Oracle Database : Back to Basics -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/","og_locale":"en_US","og_type":"article","og_title":"Tablespace and Datafiles in Oracle Database : Back to Basics -","og_description":"Image taken from Oracle Documentation Tablespace : is logical storage unit in Oracle Database. ii) Tablespace connsit of one or [&hellip;]","og_url":"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/","article_published_time":"2008-02-09T02:51:46+00:00","article_modified_time":"2017-04-12T11:27:46+00:00","og_image":[{"url":"http:\/\/onlineappsdba.com\/wp-content\/uploads\/2008\/01\/tablespace_datafile_table.jpg","type":"","width":"","height":""}],"author":"Masroof Ahmad","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Masroof Ahmad","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/","url":"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/","name":"Tablespace and Datafiles in Oracle Database : Back to Basics -","isPartOf":{"@id":"https:\/\/onlineappsdba.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/#primaryimage"},"image":{"@id":"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/#primaryimage"},"thumbnailUrl":"http:\/\/onlineappsdba.com\/wp-content\/uploads\/2008\/01\/tablespace_datafile_table.jpg","datePublished":"2008-02-09T02:51:46+00:00","dateModified":"2017-04-12T11:27:46+00:00","author":{"@id":"https:\/\/onlineappsdba.com\/#\/schema\/person\/909a876ed58d400faf82caf81d61bfdb"},"breadcrumb":{"@id":"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/#primaryimage","url":"http:\/\/onlineappsdba.com\/wp-content\/uploads\/2008\/01\/tablespace_datafile_table.jpg","contentUrl":"http:\/\/onlineappsdba.com\/wp-content\/uploads\/2008\/01\/tablespace_datafile_table.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/onlineappsdba.com\/index.php\/2008\/02\/08\/tablespace-and-datafiles-in-oracle-database-back-to-basics\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/onlineappsdba.com\/"},{"@type":"ListItem","position":2,"name":"Tablespace and Datafiles in Oracle Database : Back to Basics"}]},{"@type":"WebSite","@id":"https:\/\/onlineappsdba.com\/#website","url":"https:\/\/onlineappsdba.com\/","name":"","description":"Oracle Implementation &amp; Training Experts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/onlineappsdba.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/onlineappsdba.com\/#\/schema\/person\/909a876ed58d400faf82caf81d61bfdb","name":"Masroof Ahmad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/onlineappsdba.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/10f9db7bdbbd7f9ccfbe9b2d208e5978fc28315e9c704383e639a926ea0fce5f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/10f9db7bdbbd7f9ccfbe9b2d208e5978fc28315e9c704383e639a926ea0fce5f?s=96&d=mm&r=g","caption":"Masroof Ahmad"},"url":"https:\/\/onlineappsdba.com\/index.php\/author\/masroof\/"}]}},"_links":{"self":[{"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/posts\/307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/users\/115"}],"replies":[{"embeddable":true,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/comments?post=307"}],"version-history":[{"count":0,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/posts\/307\/revisions"}],"wp:attachment":[{"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/media?parent=307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/categories?post=307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/onlineappsdba.com\/index.php\/wp-json\/wp\/v2\/tags?post=307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}