<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4612558851091892700</id><updated>2024-08-30T03:21:38.315-07:00</updated><category term="oracle SQL"/><category term="oracle database"/><category term="oracle 10g"/><category term="SQL"/><category term="Optimizer"/><category term="user"/><category term="v$session"/><category term="parameter"/><category term="sid"/><category term="sqlplus;database name"/><category term="userid"/><category term="username"/><category term="SET"/><category term="SPOOL"/><category term="SQL Faq"/><category term="SQL Tutorial"/><category term="column"/><category term="imp"/><category term="import"/><category term="initialization"/><category term="optimization"/><category term="oracle DBA"/><category term="oracle hints"/><category term="process"/><category term="rename"/><category term="rename table"/><category term="sizing"/><category term="sql hints"/><category term="statistics"/><category term="status"/><category term="system tables"/><category term="table"/><category term="table locks"/><category term="tablespace"/><category term="temp tablespace"/><category term="user name"/><category term="v$lock"/><category term="v$parameter"/><category term="v$process"/><category term="v$sessmetric"/><category term="v$sql"/><title type='text'>Database Stuff</title><subtitle type='html'>Repository of Database Related Information, Assets and Knowledge Base covering Oracle, SQLs, Scripts, Performance Tuning etc</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-1576794409295062441</id><published>2012-09-13T00:17:00.000-07:00</published><updated>2012-09-13T00:17:58.703-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle 10g"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle database"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="sid"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="table locks"/><category scheme="http://www.blogger.com/atom/ns#" term="username"/><category scheme="http://www.blogger.com/atom/ns#" term="v$lock"/><category scheme="http://www.blogger.com/atom/ns#" term="v$session"/><title type='text'>Oracle: Script to check for table locks</title><summary type="text">Script to check for Oracle table locks:

Display details on which table is being locked by which process/user


select s1.username || &#39;@&#39; || s1.machine
&amp;nbsp; || &#39; ( SID=&#39; || s1.sid || &#39; ) &amp;nbsp;is blocking &#39;
&amp;nbsp; || s2.username || &#39;@&#39; || s2.machine || &#39; ( SID=&#39; || s2.sid || &#39; ) &#39; AS blocking_status
&amp;nbsp; from v$lock l1, v$session s1, v$lock l2, v$session s2
&amp;nbsp; where s1.sid=l1.sid and s2.</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/1576794409295062441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/1576794409295062441' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/1576794409295062441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/1576794409295062441'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2012/09/oracle-script-to-check-for-table-locks.html' title='Oracle: Script to check for table locks'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-161037077720506835</id><published>2012-09-12T22:13:00.000-07:00</published><updated>2012-09-12T22:16:20.410-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Optimizer"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle 10g"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle database"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="v$session"/><category scheme="http://www.blogger.com/atom/ns#" term="v$sessmetric"/><title type='text'>Oracle: Script to display current slow job details</title><summary type="text">Oracle Script to display slow jobs details


column e_dttm format a15
column usr format a10
column hp format 9999999999
select
TO_CHAR(m. end_time, &#39; DD-MON-YYYY HH24:MI: SS&#39; ) e_dttm, &amp;nbsp; &amp;nbsp; &amp;nbsp;-- Interval End Time
m.intsize_csec/100 ints, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -- Interval size in sec
s.username usr,
m.session_id sid,
</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/161037077720506835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/161037077720506835' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/161037077720506835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/161037077720506835'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2012/09/oracle-script-to-display-current-slow.html' title='Oracle: Script to display current slow job details'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-1250308213192171028</id><published>2012-09-12T21:55:00.001-07:00</published><updated>2012-09-12T22:18:05.925-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle 10g"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle database"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="parameter"/><category scheme="http://www.blogger.com/atom/ns#" term="sqlplus;database name"/><category scheme="http://www.blogger.com/atom/ns#" term="user"/><category scheme="http://www.blogger.com/atom/ns#" term="userid"/><title type='text'>Oracle: Script to display session details</title><summary type="text">Script to display Oracle session details:

column value format a40
column description format a100

SELECT &#39;AUDITED_CURSORID&#39; AS Parameter, SYS_CONTEXT(&#39;USERENV&#39;,&#39;AUDITED_CURSORID&#39;) AS Value, &#39;Returns the cursor ID of the SQL that triggered the audit&#39; AS Description FROM Dual
UNION ALL
SELECT &#39;AUTHENTICATION_DATA&#39; AS Parameter, SYS_CONTEXT(&#39;USERENV&#39;,&#39;AUTHENTICATION_DATA&#39;) AS Value, &#39;Authentication</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/1250308213192171028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/1250308213192171028' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/1250308213192171028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/1250308213192171028'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2012/09/script-to-display-oracle-session-details.html' title='Oracle: Script to display session details'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-8409214664217442193</id><published>2010-09-13T23:10:00.000-07:00</published><updated>2010-11-15T15:04:20.823-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="optimization"/><category scheme="http://www.blogger.com/atom/ns#" term="Optimizer"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle 10g"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle hints"/><category scheme="http://www.blogger.com/atom/ns#" term="sql hints"/><title type='text'>Oracle Hints (10G)</title><summary type="text">
Hints for Optimization Approaches and Goals

ALL_ROWSThe ALL_ROWS hint explicitly chooses the cost-based approach to optimize a statement block with a goal of best throughput (that is, minimum total resource consumption).
FIRST_ROWSThe FIRST_ROWS hint explicitly chooses the cost-based approach to optimize a statement block with a goal of best response time (minimum resource usage to return first</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/8409214664217442193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/8409214664217442193' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/8409214664217442193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/8409214664217442193'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2010/09/oracle-hints.html' title='Oracle Hints (10G)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-4366114331478687257</id><published>2010-05-17T21:38:00.000-07:00</published><updated>2010-05-17T21:41:38.674-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SET"/><category scheme="http://www.blogger.com/atom/ns#" term="SPOOL"/><title type='text'>Oracle: SqlPlus Useful Set Command</title><summary type="text">Useful SET commands for output formatting and SPOOL:


SET TERM      OFF
-- TERM = ON will display on terminal screen (OFF = show in LOG only)

  
SET ECHO      ON 
-- ECHO = ON will Display the command on screen (+ spool)
-- ECHO = OFF will Display the command on screen but not in spool files.
-- Interactive commands are always echoed to screen/spool.

  
SET TRIMOUT   ON 
-- TRIMOUT = ON will </summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/4366114331478687257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/4366114331478687257' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/4366114331478687257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/4366114331478687257'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2010/05/oracle-sqlplus-useful-set-command.html' title='Oracle: SqlPlus Useful Set Command'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-5176355586587286194</id><published>2010-05-12T18:45:00.000-07:00</published><updated>2010-05-12T18:45:23.267-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="imp"/><category scheme="http://www.blogger.com/atom/ns#" term="import"/><category scheme="http://www.blogger.com/atom/ns#" term="status"/><title type='text'>Oracle: Monitoring progress of import jobs</title><summary type="text">Code to monitor speed of import jobs:


select
&amp;nbsp;&amp;nbsp; substr(sql_text,instr(sql_text,&#39;INTO &quot;&#39;),30) table_name,
&amp;nbsp;&amp;nbsp; rows_processed,
&amp;nbsp;&amp;nbsp; round((sysdate-
&amp;nbsp;&amp;nbsp; &amp;nbsp;to_date(first_load_time,&#39;yyyy-mm-dd hh24:mi:ss&#39;))*24*60,1) minutes,
&amp;nbsp;&amp;nbsp; trunc(rows_processed/
&amp;nbsp;&amp;nbsp; &amp;nbsp;((sysdate-to_date(first_load_time,&#39;yyyy-mm-dd hh24:mi:ss&#39;))*24*60)) rows_per_minute</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/5176355586587286194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/5176355586587286194' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/5176355586587286194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/5176355586587286194'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2010/05/oracle-monitoring-progress-of-import.html' title='Oracle: Monitoring progress of import jobs'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-7554101278934448733</id><published>2009-10-28T15:48:00.000-07:00</published><updated>2009-10-28T15:48:21.541-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="initialization"/><category scheme="http://www.blogger.com/atom/ns#" term="parameter"/><category scheme="http://www.blogger.com/atom/ns#" term="v$parameter"/><title type='text'>Oracle: Initialization Parameters (10g)</title><summary type="text">Initialization parameters for Oracle 10g can be obtained from v$parameter;

sample script to get values:
set pagesize 1000

set linesize 150
column name format a40
column value format a40
column description format a40


select name, value, description from v$parameter order by name;



useful links:
http://www.dba-oracle.com/t_oracle10g_initialization_parms.htm</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/7554101278934448733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/7554101278934448733' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/7554101278934448733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/7554101278934448733'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2009/10/oracle-initialization-parameters-10g.html' title='Oracle: Initialization Parameters (10g)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-8727058935479636712</id><published>2009-10-01T23:56:00.000-07:00</published><updated>2009-10-01T23:56:33.037-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle database"/><category scheme="http://www.blogger.com/atom/ns#" term="system tables"/><title type='text'>Oracle: Commonly Used System Tables</title><summary type="text">
Below is an alphabetical listing of commonly used Oracle system tables.


System TableDescription
ALL_ARGUMENTSArguments in object accessible to the user
ALL_CATALOGAll tables, views, synonyms, sequences accessible to the user
ALL_COL_COMMENTSComments on columns of accessible tables and views
ALL_CONSTRAINTSConstraint definitions on accessible tables
ALL_CONS_COLUMNSInformation about accessible </summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/8727058935479636712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/8727058935479636712' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/8727058935479636712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/8727058935479636712'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2009/10/oracle-commonly-used-system-tables.html' title='Oracle: Commonly Used System Tables'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-6025929072424905584</id><published>2009-09-28T00:20:00.000-07:00</published><updated>2009-09-28T00:24:53.541-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="sizing"/><category scheme="http://www.blogger.com/atom/ns#" term="tablespace"/><title type='text'>Oracle: List freespace by Tablespaces</title><summary type="text">Use the following script to get sizing (free,used etc) for tablespaces:


------------------------------------------------------------------------------
-- This SQL Plus script lists freespace by tablespace
------------------------------------------------------------------------------
set linesize &amp;nbsp; &amp;nbsp;200
set pages &amp;nbsp; &amp;nbsp; &amp;nbsp; 100
set verify off
set feedback off

  
col stat &amp;</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/6025929072424905584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/6025929072424905584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/6025929072424905584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/6025929072424905584'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2009/09/use-following-script-to-get-sizing.html' title='Oracle: List freespace by Tablespaces'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-883177821121957369</id><published>2009-09-27T18:23:00.000-07:00</published><updated>2012-09-13T00:25:46.434-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle database"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="process"/><category scheme="http://www.blogger.com/atom/ns#" term="sid"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="userid"/><category scheme="http://www.blogger.com/atom/ns#" term="username"/><category scheme="http://www.blogger.com/atom/ns#" term="v$process"/><category scheme="http://www.blogger.com/atom/ns#" term="v$session"/><category scheme="http://www.blogger.com/atom/ns#" term="v$sql"/><title type='text'>Oracle: SQL for displaying current processes, userids</title><summary type="text">use the followings sql for displaying current running processes, userids:

SET TERMOUT &amp;nbsp; &amp;nbsp;ON
SET HEADING &amp;nbsp; &amp;nbsp;ON

 
SET PAGESIZE &amp;nbsp; 40
SET LINESIZE &amp;nbsp; 180
SET NEWPAGE &amp;nbsp; &amp;nbsp;0
SET VERIFY &amp;nbsp; &amp;nbsp; OFF
SET ECHO &amp;nbsp; &amp;nbsp; &amp;nbsp; OFF
SET UNDERLINE &amp;nbsp;=
SET FEEDBACK &amp;nbsp; ON
SET LONG &amp;nbsp; &amp;nbsp; &amp;nbsp; 1000
SET EMBED &amp;nbsp; &amp;nbsp; &amp;nbsp;ON

 
COLUMN </summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/883177821121957369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/883177821121957369' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/883177821121957369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/883177821121957369'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2009/09/oracle-sql-for-displaying-current.html' title='Oracle: SQL for displaying current processes, userids'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-6428705358762457554</id><published>2009-09-24T00:47:00.000-07:00</published><updated>2009-09-24T00:47:19.582-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="rename"/><category scheme="http://www.blogger.com/atom/ns#" term="rename table"/><category scheme="http://www.blogger.com/atom/ns#" term="table"/><title type='text'>Oracle: Rename Table</title><summary type="text">Oracle rename table syntaxOracle provides a rename table syntax as follows:

alter table
&amp;nbsp;&amp;nbsp; table_name
rename to
&amp;nbsp;&amp;nbsp; new_table_name;


For example, we could rename the customer table to old_customer with this syntax:

alter table
&amp;nbsp;&amp;nbsp; customer
rename to
&amp;nbsp;&amp;nbsp; old_customer;


When you rename an Oracle table you must be aware that Oracle does not update </summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/6428705358762457554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/6428705358762457554' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/6428705358762457554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/6428705358762457554'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2009/09/oracle-rename-table.html' title='Oracle: Rename Table'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-7709831468062551973</id><published>2009-09-23T22:28:00.000-07:00</published><updated>2009-09-23T22:28:37.351-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="column"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="statistics"/><title type='text'>Oracle: Column Statistics SQL</title><summary type="text">Get column statistics via the following sql.
change xxx to table name of interest.

SELECT COLUMN_NAME, NUM_DISTINCT, NUM_NULLS, NUM_BUCKETS, DENSITY
FROM DBA_TAB_COL_STATISTICS
WHERE TABLE_NAME =&#39;XXXX&#39;
ORDER BY COLUMN_NAME;
</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/7709831468062551973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/7709831468062551973' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/7709831468062551973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/7709831468062551973'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2009/09/oracle-column-statistics-sql.html' title='Oracle: Column Statistics SQL'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-8916454285209172118</id><published>2009-09-23T21:42:00.000-07:00</published><updated>2009-09-23T21:42:17.523-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Optimizer"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle database"/><title type='text'>Oracle: Optimizer settings</title><summary type="text">Oracle OPTIMIZER settings

alter session set &quot;_optimizer_cost_model&quot; =choose;&amp;nbsp; 
alter session set &quot;_optimizer_cost_model&quot;=io; 
alter session set &quot;_optimizer_cost_model&quot;=cpu;
</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/8916454285209172118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/8916454285209172118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/8916454285209172118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/8916454285209172118'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2009/09/oracle-optimizer-settings.html' title='Oracle: Optimizer settings'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-3317383593867791431</id><published>2009-09-23T21:39:00.000-07:00</published><updated>2009-09-23T21:39:30.872-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="temp tablespace"/><category scheme="http://www.blogger.com/atom/ns#" term="user"/><title type='text'>Oracle: Check which user is holding temp tablespace</title><summary type="text">Check which user holding temp tablespace

SELECT s.username, s.sid, &amp;nbsp;u.TABLESPACE, u.CONTENTS, u.extents, u.blocks
&amp;nbsp; FROM v$session s, v$sort_usage u
&amp;nbsp;WHERE s.saddr = u.session_addr;
</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/3317383593867791431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/3317383593867791431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/3317383593867791431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/3317383593867791431'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2009/09/oracle-check-which-user-is-holding-temp.html' title='Oracle: Check which user is holding temp tablespace'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-6876103514088431320</id><published>2009-09-23T21:33:00.001-07:00</published><updated>2009-09-24T01:08:22.051-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle 10g"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle database"/><category scheme="http://www.blogger.com/atom/ns#" term="user"/><title type='text'>Oracle:  SQLplus Prompt to show user, connection (10g)</title><summary type="text">SQLplus Prompt to show user, connection (Oracle 10g)

run the following in sqlplus:

set sqlprompt &quot;_USER&#39;@&#39;_CONNECT_IDENTIFIER _PRIVILEGE&amp;gt; &quot;


Display:
user@DB (privilege if exist)&amp;gt;
</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/6876103514088431320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/6876103514088431320' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/6876103514088431320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/6876103514088431320'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2009/09/oracle-sqlplus-prompt-to-show-user.html' title='Oracle:  SQLplus Prompt to show user, connection (10g)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-7317144617931066177</id><published>2009-09-23T21:16:00.000-07:00</published><updated>2009-09-23T21:19:01.652-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="user name"/><title type='text'>Oracle: Show current user</title><summary type="text">Show current userShow user;orSelect user from dual;</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/7317144617931066177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/7317144617931066177' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/7317144617931066177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/7317144617931066177'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2009/09/oracle.html' title='Oracle: Show current user'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-8668689651238643008</id><published>2009-09-23T21:09:00.000-07:00</published><updated>2009-09-28T00:17:05.696-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="sqlplus;database name"/><title type='text'>Oracle: Get database name using sqlplus</title><summary type="text">Get database name using this sql:

select ora_database_name from dual;</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/8668689651238643008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/8668689651238643008' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/8668689651238643008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/8668689651238643008'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2009/09/oracle-get-database-name-using-sqlplus.html' title='Oracle: Get database name using sqlplus'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-3282398085268878316</id><published>2008-12-01T21:52:00.000-08:00</published><updated>2009-09-23T21:31:49.167-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Faq"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Tutorial"/><title type='text'>SQL Stuff</title><summary type="text">w3schools SQL Tutorial:
http://www.w3schools.com/sql/default.asp

SQL (orafaq):
http://www.orafaq.com/wiki/SQL

Oracle SQL FAQ:
http://www.orafaq.com/wiki/SQL_FAQ</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/3282398085268878316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/3282398085268878316' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/3282398085268878316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/3282398085268878316'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2008/12/sql-stuff.html' title='SQL Stuff'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4612558851091892700.post-5763435524863055664</id><published>2008-12-01T21:45:00.000-08:00</published><updated>2008-12-01T21:51:45.415-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle database"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle DBA"/><category scheme="http://www.blogger.com/atom/ns#" term="oracle SQL"/><title type='text'>Oracle Database Stuff</title><summary type="text">Oracle FAQ - Oracle Wiki: http://www.orafaq.com/wiki/Main_PageOracle DBA FAQ - Oracle Basic Concepts: http://dev.fyicenter.com/faq/oracle/oracle_basic_concept.phpOracle SQL *Plus: An Introduction and Tutorial: http://cisnet.baruch.cuny.edu/holowczak/oracle/sqlplus/</summary><link rel='replies' type='application/atom+xml' href='http://database-stuff.blogspot.com/feeds/5763435524863055664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4612558851091892700/5763435524863055664' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/5763435524863055664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4612558851091892700/posts/default/5763435524863055664'/><link rel='alternate' type='text/html' href='http://database-stuff.blogspot.com/2008/12/oracle-database-stuff.html' title='Oracle Database Stuff'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>