<?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; Database Maintenance</title>
	<atom:link href="http://www.bestremotedba.com/topics/database-administration/database-maintenance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bestremotedba.com</link>
	<description>Oracle Database Administration Blog</description>
	<lastBuildDate>Tue, 07 Sep 2010 03:32:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>ORA-01595: error freeing extent (3) of rollback segment (1))</title>
		<link>http://www.bestremotedba.com/ora-01595-error-freeing-extent-3-of-rollback-segment-1/</link>
		<comments>http://www.bestremotedba.com/ora-01595-error-freeing-extent-3-of-rollback-segment-1/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 02:05:28 +0000</pubDate>
		<dc:creator>mudhalvan</dc:creator>
				<category><![CDATA[Database Maintenance]]></category>
		<category><![CDATA[ORA-01595 ORA-00607]]></category>
		<category><![CDATA[ORA-01595: error freeing extent (3) of rollback segment (1))]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=544</guid>
		<description><![CDATA[ORA-01595: error freeing extent (3) of rollback segment (1))]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>Error Message:<br />
SMON: following errors trapped and ignored:<br />
ORA-01595: error freeing extent (3) of rollback segment (1))<br />
ORA-00607: Internal error occurred while making a change to a data block<br />
ORA-00600: internal error code, arguments: [4193], [6179], [6757], [], [], [], [], []</p>
<p>Suggested Fix:<br />
   Recreate Undo Tablespace</p>
<p>1.	Create the new undo tablespace. </p>
<p>	create UNDO tablespace UNDO2  datafile &#8216;<file location>/UNDO201.dbf&#8217; size 200M  REUSE AUTOEXTEND ON NEXT 10M MAXSIZE 500M; </p>
<p>2.	Assign New Undo Tablespace to Everyone</p>
<p>	alter system set undo_tablespace = &#8216;UNDO2&#8242; ;</p>
<p>3.	drop old undo table space (might have to wait for all sessions holding space in old undo to leave)</p>
<p>		drop tablespace <your old Tablespace Name> including contents cascade constraints;</p>
<p>before Recreating please check whether any data files is in recovery mode and the data files using DBV (DB Verify)</p>
<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.bestremotedba.com/ora-01595-error-freeing-extent-3-of-rollback-segment-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to delete duplicate records</title>
		<link>http://www.bestremotedba.com/how-to-delete-duplicate-records/</link>
		<comments>http://www.bestremotedba.com/how-to-delete-duplicate-records/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 02:26:24 +0000</pubDate>
		<dc:creator>aarthimudhalvan</dc:creator>
				<category><![CDATA[Database Maintenance]]></category>
		<category><![CDATA[How to delete duplicate records]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/how-to-delete-duplicate-records/</guid>
		<description><![CDATA[delete from where rowid not in ( select min(rowid) from group by ); delete from emp a where rowid > any (select rowid from emp b where a.empid=b.empid); delete from T t1 where t1.rowid >( select min(t2.rowID) from T t2 where t1.col1 = t2.col1 and t1.col2 = t2.col2);]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>delete from <Tablename> where rowid not in (<br />
	select min(rowid) from<br />
<tablename> group by <duplicate fieldname>);</p>
<p>delete from emp a where rowid ><br />
	any (select rowid from emp b where a.empid=b.empid);</p>
<p>delete from T t1 where t1.rowid >( select min(t2.rowID) from T t2<br />
	where t1.col1 = t2.col1 and t1.col2 = t2.col2);</p>
<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.bestremotedba.com/how-to-delete-duplicate-records/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Row chaining and Row Migration</title>
		<link>http://www.bestremotedba.com/row-chaining-and-row-migration/</link>
		<comments>http://www.bestremotedba.com/row-chaining-and-row-migration/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 01:42:48 +0000</pubDate>
		<dc:creator>mudhalvan</dc:creator>
				<category><![CDATA[Database Maintenance]]></category>
		<category><![CDATA[Row Chaining]]></category>
		<category><![CDATA[Row chaining and Row Migration]]></category>
		<category><![CDATA[Row Migration]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=289</guid>
		<description><![CDATA[Concepts: There are two circumstances when this can occur, the data for a row in a table may be too large to fit into a single data block. This can be caused by either row chaining or row migration. Chaining: Occurs when the row is too large to fit into one data block when it [...]]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p><strong>Concepts:</strong> There are two circumstances when this can occur, the data for a row in a table may be too large to fit into a single data block.  This can be caused by either row chaining or row migration. </p>
<p><strong>Chaining:</strong> Occurs when the row is too large to fit into one data block when it is first inserted. In this case, Oracle stores the data for the row in a chain of data blocks (one or more) reserved for that segment. Row chaining most often occurs with large rows, such as rows that contain a column of datatype LONG, LONG RAW, LOB, etc. Row chaining in these cases is unavoidable. </p>
<p><strong>Migration:</strong> Occurs when a row that originally fitted into one data block is updated so that the overall row length increases, and the block&#8217;s free space is already completely filled.  In this case, Oracle migrates the data for the entire row to a new data block, assuming the entire row can fit in a new block.  Oracle preserves the original row piece of a migrated row to point to the new block containing the migrated row: the rowid of a migrated row does not change.<br />
 	When a row is chained or migrated, performance associated with this row decreases because Oracle must scan more than one data block to retrieve the information for that row.  </p>
<p>  o INSERT and UPDATE statements that cause migration and chaining perform poorly, because they perform additional processing. </p>
<p> o SELECTs that use an index to select migrated or chained rows must perform additional I/Os. </p>
<p><strong>Detection: </strong>Migrated and chained rows in a table or cluster can be identified by using the ANALYZE command with the LIST CHAINED ROWS option. This command collects information about each migrated or chained row and places this information into a specified output table.  To create the table that holds the chained rows,<br />
execute script UTLCHAIN.SQL.<br />
  SQL> ANALYZE TABLE scott.emp LIST CHAINED ROWS;<br />
  SQL> SELECT * FROM chained_rows;<br />
You can also detect migrated and chained rows by checking the &#8216;table fetch continued row&#8217; statistic in the v$sysstat view.<br />
   SQL> SELECT name, value FROM v$sysstat WHERE name = &#8216;table fetch continued row&#8217;;<br />
   NAME                                                                 VALUE<br />
  &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;<br />
  table fetch continued row                                              308 </p>
<p>Although migration and chaining are two different things, internally they are represented by Oracle as one.  When detecting migration and chaining of rows you should analyze carrefully what you are dealing with. </p>
<p><strong>Resolving: </strong><br />
o In most cases chaining is unavoidable, especially when this involves tables with large columns such as LONGS, LOBs, etc.  When you have a lot of chained rows in different tables and the average row length of these tables is not that large, then you might consider rebuilding the database with a larger blocksize. </p>
<p>  e.g.: You have a database with a 2K block size. Different tables have multiple large varchar columns with an average row length of more than 2K.  Then this means that you will have a lot of chained rows because you block size is too small.  Rebuilding the database with a larger block size can give you a significant performance benefit.<br />
o Migration is caused by PCTFREE being set too low, there is not enough room in avoid migration, all tables that are updated should have their PCTFREE set so that there is enough space within the block for updates.<br />
You need to increase PCTFREE to avoid migrated rows.  If you leave more free space available in the block for updates, then the row will have more room to grow.<br />
 SQL Script to eliminate row migration :<br />
  &#8212; Get the name of the table with migrated rows:<br />
  ACCEPT table_name PROMPT &#8216;Enter the name of the table with migrated rows: &#8216; </p>
<p>  &#8212; Clean up from last execution<br />
  set echo off<br />
  DROP TABLE migrated_rows;<br />
  DROP TABLE chained_rows;<br />
  &#8212; Create the CHAINED_ROWS table<br />
  @&#8230;/rdbms/admin/utlchain.sql<br />
  set echo on<br />
  spool fix_mig<br />
  &#8212; List the chained and migrated rows<br />
  ANALYZE TABLE &#038;table_name LIST CHAINED ROWS; </p>
<p>  &#8212; Copy the chained/migrated rows to another table<br />
  create table migrated_rows as<br />
    SELECT orig.*<br />
    FROM &#038;table_name orig, chained_rows cr<br />
    WHERE orig.rowid = cr.head_rowid<br />
      AND cr.table_name = upper(&#8216;&#038;table_name&#8217;); </p>
<p>  &#8212; Delete the chained/migrated rows from the original table<br />
  DELETE FROM &#038;table_name WHERE rowid IN (SELECT head_rowid FROM chained_rows); </p>
<p>  &#8212; Copy the chained/migrated rows back into the original table<br />
  INSERT INTO &#038;table_name SELECT * FROM migrated_rows; </p>
<p>  spool off<br />
<strong><br />
Tips </strong></p>
<p>1.	Analyze the table and check the chained count for that particular table<br />
8671 Chain Count</p>
<p>analyze table tbl_tmp_transaction_details compute statistics</p>
<p>select table_name,chain_cnt,pct_free,pct_used from dba_tables where table_name=&#8217;TBL_TMP_TRANSACTION_DETAILS&#8217;</p>
<p>   2. Increase the pctfree size to 30</p>
<p>   alter table  tbl_tmp_transaction_details pctfree 30 </p>
<p>3. Regenerate Report (When rows get updated only we will have Chained rows)</p>
<p>    tbl_report_generation_status</p>
<p>    begin dbms_job.run(190); end;</p>
<p>   4. Analyze the table and check the chained count for that particular table<br />
0 Chain Count</p>
<p>analyze table tbl_tmp_transaction_details compute statistics</p>
<p>select table_name,chain_cnt,pct_free,pct_used from dba_tables where table_name=&#8217;TBL_TMP_TRANSACTION_DETAILS&#8217;</p>
<p>Note:<br />
	If we want to do the procedure to delete the chained rows from original table and insert the same again, then we need chained_rows table<br />
	To create chained rows we need to run the utlchain.sql from $ORACLE_HOME/rdbms</p>
<p>Find out the chained rows.</p>
<p>analyze table tbl_tmp_transaction_details list chained count;</p>
<p>	The above command will move the chained rows to chained_row table<br />
Based on the rowid in chained_row table we can move those record to temp table and delete those chained rows from original table then insert the same again into original table.</p>
<p>select * from tbl_tmp_transaction_details where rowid=&#8217;AAAG8DAAGAAAGOKABD&#8217;: </p>
<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.bestremotedba.com/row-chaining-and-row-migration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import terminated successfully without warnings &#8211; But no Object imported</title>
		<link>http://www.bestremotedba.com/import-terminated-successfully-without-warnings-but-no-object-imported/</link>
		<comments>http://www.bestremotedba.com/import-terminated-successfully-without-warnings-but-no-object-imported/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 06:42:12 +0000</pubDate>
		<dc:creator>mudhalvan</dc:creator>
				<category><![CDATA[Database Maintenance]]></category>
		<category><![CDATA[But no Object imported]]></category>
		<category><![CDATA[Import terminated successfully without warnings]]></category>
		<category><![CDATA[Import terminated successfully without warnings ; But no Object imported]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=175</guid>
		<description><![CDATA[Import terminated successfully without warnings - But no Object imported]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>Import terminated successfully without warnings &#8211; But no Object imported</p>
<p>Scenario: We have got the Dump from remote site and they have mentioned that dump was exported from SYSTEM user. </p>
<p>we tried the following two option but none of the expected object was imported to &#8220;bbb&#8221; schema</p>
<p>[oracle@UNIX backup]$ imp userid=system/xxxx fromuser=aaa touser=bbb file=backup.dmp log=export-1.log</p>
<p>[oracle@UNIX backup]$ imp userid=system/xxxx fromuser=system touser=bbb file=backup.dmp log=export-1.log</p>
<p>[oracle@UNIX backup]$ tail -1 imp.log<br />
Import terminated successfully without warnings.<br />
[oracle@UNIX backup]$</p>
<p>	Import log says import completed successfully but it is not showing any object getting imported in log also. </p>
<p>	We have tried with show=y option to see the content but still it is not showing. </p>
<p>Cause :<br />
	It is because we have expected objects in &#8220;CCCC&#8221; user at remote site. When engineer exported the dump<br />
	he used system user and did the full export of the database. </p>
<p>Solution<br />
	Since the remote site DBA used full export from system user and we need object from &#8220;CCCC&#8221; we have to do any of the following option</p>
<p>		1. Do Full Import against the target database<br />
		or<br />
		2. Import command with the fromuser=&#8221;CCCC&#8221;</p>
<p>		How do you find out the which user have the object you required without remote site enginner inform you. Only option is edit<br />
	the dump file in any editor if it is small. If not cat the file with more<br />
		$ cat backup.dmp |more<br />
			Look for the word CONNECT CCCC</p>
<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.bestremotedba.com/import-terminated-successfully-without-warnings-but-no-object-imported/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>virtual circuit status, enq: TX &#8211; row lock contention, latch: shared pool &#8211; Values are High</title>
		<link>http://www.bestremotedba.com/virtual-circuit-status-enq-tx-row-lock-contention-latch-shared-pool-values-are-high/</link>
		<comments>http://www.bestremotedba.com/virtual-circuit-status-enq-tx-row-lock-contention-latch-shared-pool-values-are-high/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 09:23:55 +0000</pubDate>
		<dc:creator>mudhalvan</dc:creator>
				<category><![CDATA[Database Maintenance]]></category>
		<category><![CDATA[enq: TX - row lock contention]]></category>
		<category><![CDATA[latch: shared pool - Values are High]]></category>
		<category><![CDATA[virtual circuit status]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=173</guid>
		<description><![CDATA[virtual circuit status, enq: TX - row lock contention, latch: shared pool - Values are High]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>virtual circuit status, enq: TX &#8211; row lock contention, latch: shared pool &#8211; Values are High</p>
<p>If you set the SGA_TARGET> 0 or MEMORY_TARGET parameter is set then check for the Bug 7039896 Spin under kghquiesce_regular_extent holding shared pool latch with AMM</p>
<p>Double check with Oracle Support before you apply any patch. </p>
<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.bestremotedba.com/virtual-circuit-status-enq-tx-row-lock-contention-latch-shared-pool-values-are-high/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance Impact of temporary tablespace</title>
		<link>http://www.bestremotedba.com/performance-impact-of-temporary-tablespace/</link>
		<comments>http://www.bestremotedba.com/performance-impact-of-temporary-tablespace/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 07:53:15 +0000</pubDate>
		<dc:creator>lavpandit</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[Temporary Tablespace Maintenance]]></category>
		<category><![CDATA[Performance Impact of temporary tablespace]]></category>
		<category><![CDATA[TempData file]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=140</guid>
		<description><![CDATA[Performance Impact of temporary tablespace]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>While creating temporary tablespace one can create it by using datafile or tempfile but there is a big difference in performance using temp file will give you better performance since it is autimatically managed by oracle, once temp segment is inactive and nolonger in use oracle mark it that space available to others so it can be used by others. But when you use datafiles for temp tablespace smon has to drop inactive segments manually to release the space this is big overhead smon invokes to remove inactive temp segments periodically it may take upto 12 hrs of time so it unneccessarily raises requirement for bigger temporary tablespace. So better to always use tempfiles for temporary tablespaces</p>
<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.bestremotedba.com/performance-impact-of-temporary-tablespace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SGA Keep</title>
		<link>http://www.bestremotedba.com/sga-keep/</link>
		<comments>http://www.bestremotedba.com/sga-keep/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 06:55:38 +0000</pubDate>
		<dc:creator>mudhalvan</dc:creator>
				<category><![CDATA[Database Maintenance]]></category>
		<category><![CDATA[SGA Keep]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=117</guid>
		<description><![CDATA[SGA Keep ]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>SGA Keep is only possible for the below type of objects</p>
<p>- PACKAGE<br />
- PACKAGE BODY<br />
- FUNCTION<br />
- TRIGGER<br />
- TYPE<br />
-  Cursor</p>
<p>TABLE &#038; LIBRARY<br />
	Not possible<br />
- Procedure , PACKAGE ,PACKAGE BODY &#038; FUNCTION<br />
 SQL> exec dbms_shared_pool.keep(&#8216;xxxxxxxx&#8217;, &#8216;p&#8217;);<br />
- TYPE<br />
 SQL> exec dbms_shared_pool.keep(&#8216;xxxxxxxx&#8217;, &#8216;t&#8217;);<br />
- TRIGGER<br />
 SQL> exec dbms_shared_pool.keep(&#8216;xxxxxxxx&#8217;, &#8216;r&#8217;);<br />
- CURSOR<br />
    1. Issue SQL statement to load it into the shared pool.<br />
    2. Determine the ADDRESS and HASH_VALUE of the SQL statement.  This can<br />
       usually be obtained from calling DBMS_SHARED_POOL.SIZES.  For example,<br />
       in the output from the SIZES procedure above you can determine that:<br />
         ADDRESS = 70378A10<br />
         HASH_VALUE = -614308548<br />
       for the SQL statement:<br />
         select ename from emp where empno = 7788<br />
       If the information cannot be determined from SIZES, then check the view<br />
       V$SQLAREA.<br />
    3. Issue the following statement to keep the cursor:<br />
       SQL> exec dbms_shared_pool.keep(&#8217;70378A10, -614308548&#8242;, &#8216;c&#8217;)<br />
       PL/SQL procedure successfully completed.</p>
<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.bestremotedba.com/sga-keep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Move Tables Between Tablespaces</title>
		<link>http://www.bestremotedba.com/move-tables-between-tablespaces/</link>
		<comments>http://www.bestremotedba.com/move-tables-between-tablespaces/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 06:52:10 +0000</pubDate>
		<dc:creator>mudhalvan</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[Database Maintenance]]></category>
		<category><![CDATA[Move Table from one Tablespace to another Tablespace]]></category>
		<category><![CDATA[Move Tables Between Tablespaces]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=113</guid>
		<description><![CDATA[Move Table from one Tablespace to another Tablespace]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>Move Tables Between Tablespaces / Move Table from one Tablespace to another Tablespace</p>
<p>	There are many methods available to move the tables between tablespaces.</p>
<p>1. Export /Import<br />
	export the existing table<br />
	remove quota from the old tablespace<br />
	change the default tablespace to the new tablespace<br />
	drop the old table<br />
	import the table<br />
	change the default tablespace back again<br />
	restore quota on the old tablespace </p>
<p>2. ALTER TABLE<br />
<table_name> MOVE TABLESPACE < target_tablespace></p>
<p>	This is possible Only if U are on 8i Provided the table does not have LOBs<br />
	You cannot MOVE an entire partitioned table (either heap or index organized). You must move individual partitions or subpartitions.<br />
    You cannot move a table with a LONG or LONG RAW. You must exp that table and imp it into a table<br />
	Recreate underlying indexes using &#8216;alter index rebuild&#8217;<br />
	Check the Invalid objects using this table and compile it to become valid.<br />
	The indexes on the tables being moved will become unusable after the table, rebuild them right after moving a table &#8212; before moving the next table (to reduce downtime).</p>
<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.bestremotedba.com/move-tables-between-tablespaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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;</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>
		<item>
		<title>List of sessions locked the particular Object</title>
		<link>http://www.bestremotedba.com/list-of-sessions-locked-the-particular-object/</link>
		<comments>http://www.bestremotedba.com/list-of-sessions-locked-the-particular-object/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 02:42:33 +0000</pubDate>
		<dc:creator>mudhalvan</dc:creator>
				<category><![CDATA[Database Maintenance]]></category>

		<guid isPermaLink="false">http://www.bestremotedba.com/?p=105</guid>
		<description><![CDATA[List of sessions locked the particular Object]]></description>
			<content:encoded><![CDATA[<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_start --><p>SELECT   sid,<br />
         serial#,<br />
         username,<br />
         machine<br />
  FROM   v$session<br />
 WHERE   sid IN<br />
               (SELECT   sid<br />
                  FROM   v$lock<br />
                 WHERE   id1 IN<br />
                               (SELECT   object_id<br />
                                  FROM   dba_objects<br />
                                 WHERE   object_name = <ObjectName><br />
                                         AND owner = <Owner>))</p>
<!-- Advanced AdSense by Jim Gaudet --><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.bestremotedba.com/list-of-sessions-locked-the-particular-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
