<?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>TechCorner &#187; database</title>
	<atom:link href="http://www.benh.org/techblog/category/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benh.org/techblog</link>
	<description>web 2.0, tools, software reviews, tweaks and latest technology</description>
	<lastBuildDate>Fri, 03 Sep 2010 04:52:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Finding free/used temporary table space in Oracle</title>
		<link>http://www.benh.org/techblog/2006/07/find-out-usedfree-space-in-a-temporary-tablespace/</link>
		<comments>http://www.benh.org/techblog/2006/07/find-out-usedfree-space-in-a-temporary-tablespace/#comments</comments>
		<pubDate>Sat, 29 Jul 2006 04:21:00 +0000</pubDate>
		<dc:creator>Benedict Herold</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[dba]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.benh.org/techie/2006/07/how-do-i-find-usedfree-space-in-a-temporary-tablespace-in-oracle/</guid>
		<description><![CDATA[
If you&#8217;re a freak who work around with Oracle as backend, you would face the sitution where the oracle temporary space would be exhausted.
The usage temporary tablespace can&#8217;t be found out exactly using DBA_FREE_SPACE. To find out the true value of temporary table space we may need to use  [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#ads--><br />
If you&#8217;re a freak who work around with Oracle as backend, you would face the sitution where the oracle temporary space would be exhausted.</p>
<p>The usage temporary tablespace can&#8217;t be found out exactly using DBA_FREE_SPACE. To find out the true value of temporary table space we may need to use V$TEMP_SPACE_HEADER data dictonary.</p>
<p><code></p>
<pre class="brush:sql">SELECT   tablespace_name, SUM (bytes_used), SUM (bytes_free)
    FROM v$temp_space_header
GROUP BY tablespace_name;</pre>
<p></code></p>
<p>If you&#8217;re looking out to find out the usage of other table space we need to use the following script.</p>
<p><code></p>
<pre class="brush:sql">CLEAR
SET HEAD ON
SET VERIFY OFF
SPOOL file
COL tspace form a25 Heading "Tablespace"
COL tot_ts_size form 99999999999999 Heading "Size (Mb)"
COL free_ts_size form 99999999999999 Heading "Free (Mb)"
COL ts_pct form 9999 Heading "% Free"
COL ts_pct1 form 9999 Heading "% Used"
BREAK on report
COMPUTE sum of free_ts_size on report
COMPUTE sum of tot_ts_size on report
SELECT                                                            /* + RULE */
         df.tablespace_name tspace, df.BYTES / (1024 * 1024) tot_ts_size,
         SUM (fs.BYTES) / (1024 * 1024) free_ts_size,
         NVL (ROUND (SUM (fs.BYTES) * 100 / df.BYTES), 1) ts_pct,
         ROUND ((df.BYTES - SUM (fs.BYTES)) * 100 / df.BYTES) ts_pct1
    FROM dba_free_space fs,
         (SELECT   tablespace_name, SUM (BYTES) BYTES
              FROM dba_data_files
          GROUP BY tablespace_name) df
   WHERE fs.tablespace_name(+) = df.tablespace_name
GROUP BY df.tablespace_name, df.BYTES
UNION ALL
SELECT                                                            /* + RULE */
         df.tablespace_name tspace, fs.BYTES / (1024 * 1024) tot_ts_size,
         SUM (df.bytes_free) / (1024 * 1024) free_ts_size,
         NVL (ROUND ((SUM (fs.BYTES) - df.bytes_used) * 100 / fs.BYTES),
              1
             ) ts_pct,
         ROUND ((SUM (fs.BYTES) - df.bytes_free) * 100 / fs.BYTES) ts_pct1
    FROM dba_temp_files fs,
         (SELECT   tablespace_name, bytes_free, bytes_used
              FROM v$temp_space_header
          GROUP BY tablespace_name, bytes_free, bytes_used) df
   WHERE fs.tablespace_name(+) = df.tablespace_name
GROUP BY df.tablespace_name, fs.BYTES, df.bytes_free, df.bytes_used
ORDER BY 4 DESC
/
SPOOL off</pre>
<p></code></p>
<p>To find the size of table different technique has to be used.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benh.org/techblog/2006/07/find-out-usedfree-space-in-a-temporary-tablespace/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Finding locked objects in Oracle</title>
		<link>http://www.benh.org/techblog/2006/07/finding-locked-objects-in-oracle/</link>
		<comments>http://www.benh.org/techblog/2006/07/finding-locked-objects-in-oracle/#comments</comments>
		<pubDate>Wed, 26 Jul 2006 12:21:00 +0000</pubDate>
		<dc:creator>Benedict Herold</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[dba]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.benh.org/techie/2006/07/finding-locked-objects-in-oracle/</guid>
		<description><![CDATA[
If you&#8217;re wondering why particular query or procedure is talking a long such a long time to run; then make sure you check out whether the object you&#8217;re accessing is locked or not. There are quite a few dba views available to make our task less complicated. You can use the below query which will  [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#ads--><br />
If you&#8217;re wondering why particular query or procedure is talking a long such a long time to run; then make sure you check out whether the object you&#8217;re accessing is locked or not. There are quite a few dba views available to make our task less complicated. You can use the below query which will return you the list of locked objects.</p>
<pre class="brush:sql">
SELECT c.owner, c.object_name, c.object_type, b.SID, b.serial#, b.status,
       b.osuser, b.machine
  FROM v$locked_object a, v$session b, dba_objects c
 WHERE b.SID = a.session_id AND a.object_id = c.object_id;
</pre>
<p>You can now decide whether to kill the job/ process or someother roundabout to remove the lock obtained on the particular object.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benh.org/techblog/2006/07/finding-locked-objects-in-oracle/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Oracle server uptime</title>
		<link>http://www.benh.org/techblog/2006/07/oracle-server-uptime/</link>
		<comments>http://www.benh.org/techblog/2006/07/oracle-server-uptime/#comments</comments>
		<pubDate>Sun, 23 Jul 2006 04:33:00 +0000</pubDate>
		<dc:creator>Benedict Herold</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[uptime]]></category>

		<guid isPermaLink="false">http://www.benh.org/techie/2006/07/how-to-find-the-uptime-of-the-oracle-database/</guid>
		<description><![CDATA[
The following query works well with Oracle 9i. i&#8217;ve no clue whether this works with others too or not.

SELECT TO_CHAR (startup_time, 'DD-MON-YYYY HH24:MI:SS') "DB Startup Time"
  FROM SYS.v_$instance;

even there is possiblity to find the startup time by quering logon_time from sys.v_$session  [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#ads--><br />
The following query works well with Oracle 9i. i&#8217;ve no clue whether this works with others too or not.</p>
<pre class="brush:sql">
SELECT TO_CHAR (startup_time, 'DD-MON-YYYY HH24:MI:SS') "DB Startup Time"
  FROM SYS.v_$instance;
</pre>
<p>even there is possiblity to find the startup time by quering logon_time from sys.v_$session view.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benh.org/techblog/2006/07/oracle-server-uptime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Hidden Parameters</title>
		<link>http://www.benh.org/techblog/2006/07/oracle-hidden-parameters/</link>
		<comments>http://www.benh.org/techblog/2006/07/oracle-hidden-parameters/#comments</comments>
		<pubDate>Wed, 19 Jul 2006 04:57:00 +0000</pubDate>
		<dc:creator>Benedict Herold</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[dba]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://www.benh.org/techie/2006/07/how-to-get-the-list-of-all-hidden-oracle-parameters/</guid>
		<description><![CDATA[
Oracle initialization or INIT.ORA parameters with an underscore in front are hidden or unsupported parameters.  One can get a list of all hidden parameters by executing this query:

SELECT *
  FROM SYS.x$ksppi
 WHERE SUBSTR (ksppinm, 1, 1) = '_';

The following query displays parameter names with  [...]]]></description>
			<content:encoded><![CDATA[<p><!--adsense#ads--><br />
Oracle initialization or INIT.ORA parameters with an underscore in front are hidden or unsupported parameters.  One can get a list of all hidden parameters by executing this query:</p>
<p><code></p>
<pre class="brush:sql">SELECT *
  FROM SYS.x$ksppi
 WHERE SUBSTR (ksppinm, 1, 1) = '_';</pre>
<p></code></p>
<p>The following query displays parameter names with their current value:</p>
<p><code></p>
<pre class="brush:sql">
SELECT   a.ksppinm "Parameter", b.ksppstvl "Session Value",
         c.ksppstvl "Instance Value"
    FROM x$ksppi a, x$ksppcv b, x$ksppsv c
   WHERE a.indx = b.indx AND a.indx = c.indx AND SUBSTR (ksppinm, 1, 1) = '_'
ORDER BY a.ksppinm;</pre>
<p></code></p>
<p><span style="text-decoration: underline;">Remember</span>: Thou shall not play with undocumented parameters! Using undocumented parameters without the consent of Oracle Support will make your database &#8220;un-supported&#8221;. You will be on your own if the parameters you&#8217;ve set cause problems or data corruption.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benh.org/techblog/2006/07/oracle-hidden-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rename Oracle database username</title>
		<link>http://www.benh.org/techblog/2006/07/rename-oracle-database-username/</link>
		<comments>http://www.benh.org/techblog/2006/07/rename-oracle-database-username/#comments</comments>
		<pubDate>Wed, 19 Jul 2006 04:44:00 +0000</pubDate>
		<dc:creator>Benedict Herold</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[dba]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://www.benh.org/techie/2006/07/is-it-possible-to-rename-a-database-user-schema/</guid>
		<description><![CDATA[No, this is not available till now  in Oracle and has been noted down as a enhancement request.
Still here is a workaround way of doing that:

Do a user-level export of user A
create new user B
import system/manager from user=A to user=B
drop user A

]]></description>
			<content:encoded><![CDATA[<p><!--adsense#ads-->No, this is not available till now  in Oracle and has been noted down as a enhancement request.<br />
Still here is a workaround way of doing that:</p>
<ol class="bb-list" style="list-style-type: circle;">
<li>Do a user-level export of user A</li>
<li>create new user B</li>
<li>import system/manager from user=A to user=B</li>
<li>drop user A</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.benh.org/techblog/2006/07/rename-oracle-database-username/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

