<?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 Tips and Techniques &#187; Oracle Errors</title>
	<atom:link href="http://www.oraclecity.com/category/oracle-errors/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oraclecity.com</link>
	<description>Oracle 11g, Oracle 10g, PL/SQL, Oracle Enterprise Manager 11g Grid Control, Oracle Performance Tuning, Microsoft SQL Server and T-SQL</description>
	<lastBuildDate>Thu, 12 Jan 2012 11:36:07 +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>ORA-01031: insufficient privileges</title>
		<link>http://www.oraclecity.com/oracle-errors/ora-01031-insufficient-privileges/</link>
		<comments>http://www.oraclecity.com/oracle-errors/ora-01031-insufficient-privileges/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 12:53:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Errors]]></category>
		<category><![CDATA[ORA-01031: insufficient privileges]]></category>

		<guid isPermaLink="false">http://www.oraclecity.com/?p=554</guid>
		<description><![CDATA[ORA-01031: insufficient privileges is encountered when the user does not have privilege to create an object.]]></description>
			<content:encoded><![CDATA[<p><strong>Cause: </strong>The error will occur when a user tries to create an object and the user<br />
does not have the privilege to create one.</p>
<p><strong>For example:</strong></p>
<p>Suppose you just create a new user called test1.<br />
Then test1 logins and tries to create a simple table called t1.</p>
<p>But as the user does not yet have privilege to create an object (even in his own schema),<br />
the error ORA-01031: insufficient privileges will be encountered.</p>
<p>[oracle@HOST1 ~]$ <strong>sqlplus / as sysdba</strong></p>
<p>SQL&gt; <strong>create user test1 identified by test1;</strong></p>
<p><span id="more-554"></span></p>
<p>User created.</p>
<p>SQL&gt; <strong>grant connect to test1;</strong></p>
<p>Grant succeeded.</p>
<p>SQL&gt; <strong>exit</strong></p>
<p>[oracle@HOST1 ~]$ <strong>sqlplus test1/test1</strong></p>
<p>SQL*Plus: Release 11.1.0.7.0 &#8211; Production on Wed Jan 19 12:47:45 2011</p>
<p>Copyright (c) 1982, 2008, Oracle.  All rights reserved.</p>
<p>Connected to:<br />
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 &#8211; 64bit Production<br />
With the Partitioning, OLAP, Data Mining and Real Application Testing options</p>
<p>SQL&gt; <strong>create table t1(num number);</strong><br />
create table t1(num number)<br />
*<br />
ERROR at line 1:<br />
<strong>ORA-01031: insufficient privileges</strong></p>
<p>SQL&gt;<strong> exit;</strong></p>
<p>Solution:</p>
<p>Grant appropriate privilege to the user.</p>
<p>[oracle@HOST1 ~]$ <strong>sqlplus / as sysdba</strong></p>
<p>SQL&gt; <strong>grant resource to test1;</strong></p>
<p>SQL&gt;  <strong>create table t1(num number);</strong></p>
<p>Table created.</p>
<p>SQL&gt; <strong>drop table t1;</strong></p>
<p>Table dropped.</p>
<p>SQL&gt;<strong> exit</strong><br />
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 &#8211; 64bit Production<br />
With the Partitioning, OLAP, Data Mining and Real Application Testing options<br />
[oracle@HOST1 ~]$</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclecity.com/oracle-errors/ora-01031-insufficient-privileges/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ORA-00942: Table or View does not exist</title>
		<link>http://www.oraclecity.com/oracle-errors/ora-00942-oracletable-or-view-does-not-exist/</link>
		<comments>http://www.oraclecity.com/oracle-errors/ora-00942-oracletable-or-view-does-not-exist/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 16:12:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Errors]]></category>

		<guid isPermaLink="false">http://www.oraclecity.com/?p=365</guid>
		<description><![CDATA[ORA-00942: Table or View does not exist]]></description>
			<content:encoded><![CDATA[<p><big><strong>ORA-00942: Table or View does not exist</strong></big><br />
<strong>Cause of error:</strong> Oracle table or view does not exist in the database.<br />
Oracle database privileges are missing or granted incorrectly.</p>
<p><strong>Actions to take: </strong>Make sure that the table or view or synonym that you are  referencing exists in the database and ensure they have necessary privileges.</p>
<p>For example if you try to access a table or view from another schema and you do not have  select privilege to that table or view then you will get this error message. Even if you  specify the table or view name using the schema name- you will still get this error.</p>
<p>Lets’ say there is a table called table1 in a schema called schema1. There is another  schema called schema2. At the moment you are in Oracle schema2 and want to execute an  Oracle select statement on table1 such as</p>
<p><big><strong>select * from schema1.table;</strong></big></p>
<p>But if you do not have Oracle select privilege granted to you then you will get ORA-00942.</p>
<p>To fix that login to Oracle in your schema1 schema and then run the following statement to  grant select privilege to schema2.</p>
<p><big><strong>SQL&gt; grant select on schema1.table1 to schema2;</strong></big></p>
<p>Now you should be able to access table1 data from schema2 as long as you qualify the  Oracle table name with the schema name i.e. schema1.table1. This query should return you  data now.</p>
<p><strong><big>select * from schema1.table;<span id="more-365"></span></big></strong></p>
<p>However you may find that specifying the schema name of the table owner each time is quite  problematic/time consuming &#8211; i.e. the schema name is not easy to spell or quite long. In  that case you can to use Oracle synonyms.</p>
<p>Creating an Oracle synonym allows you to specify the name of an Oracle object from another  Oracle schema as if they are in your current schema.</p>
<p>To know how it works / see example Click here<a href="../oracle-synonym-example/"> for Oracle Synonym examples</a></p>
<p>I hope this post helped. Please leave your comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclecity.com/oracle-errors/ora-00942-oracletable-or-view-does-not-exist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ORA-01552: cannot use system rollback</title>
		<link>http://www.oraclecity.com/oracle-errors/ora-01552-cannot-use-system-rollback/</link>
		<comments>http://www.oraclecity.com/oracle-errors/ora-01552-cannot-use-system-rollback/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 11:46:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Errors]]></category>

		<guid isPermaLink="false">http://www.oraclecity.com/?p=256</guid>
		<description><![CDATA[ORA-01552: cannot use system rollback - explained and shows to resole this error]]></description>
			<content:encoded><![CDATA[<p><strong><big>Problem:</big></strong></p>
<p>Today I encountered an error in my oracle database which displays the error ORA-01552:  cannot use system rollback.</p>
<p>I do not recollect experiencing this error before.</p>
<p><strong><big>Investigation:</big></strong></p>
<p>So I went to Google looking for an answer. In most of the posts in various forums the  recommendation is</p>
<p>1. To create rollback segments</p>
<p>2. To make existing rollback segments online.</p>
<p>So I suspected my rollback segments are offline. But when I run the query</p>
<p><span id="more-256"></span></p>
<p><big><strong> select segment_name, owner, tablespace_name, status from  dba_rollback_segs;</strong></big></p>
<p><big><strong> </strong></big></p>
<p>I found that all the rollabck segments online and there are 6 rollback segments in my  database. So it can not be the offline  rollback segment. Also as I have 6 rollback  segments I don&#8217;t need any extra rollback segments anymore.</p>
<p>Then I questioned myself:  is there enough space in the tablespace used for the  rollback segments. After running the query:</p>
<p><big><strong>SELECT tablespace_name, sum((bytes/1024)/1024) free FROM DBA_FREE_SPACE  group by tablespace_name;</strong></big></p>
<p><big><strong> </strong></big></p>
<p><big><strong>Solutions:</strong></big></p>
<p>What I found is that the tablespace used for rollback segments have only 4M free space  left. Considering the number of transactions that were running on the database &#8211; I felt  like this is not enough, so I increased the size of the tablespace by running the commands  (to increase datafile size):</p>
<p>ALTER DATABASE DATAFILE &#8216;/u01/oradata/datafile/ora_rollback_db1.dbf&#8217; RESIZE 500M;</p>
<p>Then I tried again and I still keep getting ORA-01552: cannot use system rollback  error. So the change did not take effect on the fly.</p>
<p>Then I restarted Oracle database. This time it is gone.</p>
<p>So &#8211; what I learned is that, it is not always just the non existence of rollback  segments or offline rollback segments that could cause this error to occur. In this case I  found that the error occurred because there was not enough space on the tablespace where  rollback segments are based.</p>
<p>I hope this will help readers to understand this defect a bit more clearly.</p>
<p>If you like this post or just want to add more on the defect please leave your comment.</p>
<p><big><strong> </strong></big></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclecity.com/oracle-errors/ora-01552-cannot-use-system-rollback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ORA-06512 at string line string Tips and Example</title>
		<link>http://www.oraclecity.com/oracle-errors/ora-06512-at-string-line-string-tips-and-example/</link>
		<comments>http://www.oraclecity.com/oracle-errors/ora-06512-at-string-line-string-tips-and-example/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 15:13:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Errors]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[Oracle error codes]]></category>

		<guid isPermaLink="false">http://www.oraclecity.com/?p=216</guid>
		<description><![CDATA[Cause: Backtrace message as the stack is unwound by unhandled exceptions. This is basically to indicate where a particular error number occurred in an operation.]]></description>
			<content:encoded><![CDATA[<p>Cause: Backtrace message as the stack is unwound by unhandled exceptions. This is basically to indicate where a particular error number occurred in an operation.</p>
<p><strong>Example 1:</strong></p>
<p style="padding-left: 30px;"><em><strong>declare<br />
l_fname varchar2(3);<br />
begin<br />
l_fname := &#8216;abcd&#8217;;<br />
end;<br />
/<br />
<span id="more-216"></span>declare<br />
*<br />
ERROR at line 1:<br />
ORA-06502: PL/SQL: numeric or value error<br />
ORA-06512: at line 4</strong></em></p>
<p>Notice here that the actual error occurred is actually ORA-065 02. But the 2nd error code ORA-06512 helps us to understand/locate the exact location where the error occurred.</p>
<p><strong>Example 2:</strong></p>
<p>Create three stored procedure as</p>
<p style="padding-left: 30px;"><em><strong>create or replace procedure p_test11(p_empno number, p_sal number)<br />
is<br />
begin<br />
p_test22(11,10);<br />
end;<br />
/</strong></em></p>
<p><em><strong></strong><strong>create or replace procedure p_test22(p_empno number, p_sal number)<br />
is<br />
begin<br />
p_test33(p_empno, p_sal);<br />
end;<br />
/</strong></em></p>
<p><em><strong>create or replace procedure p_test33(p_empno number, p_sal number)<br />
is<br />
l_num number;<br />
l_num2 number;<br />
l_num3 number;<br />
begin<br />
null;<br />
l_num := p_empno;<br />
l_num2 := p_sal;<br />
l_num3 := &#8216;abc&#8217;;<br />
end;<br />
/</strong></em></p>
<p style="padding-left: 60px;">Note that the stored procedure p_test33 has got an error condition at line 10, we are assigning characters to a numeric field. But the stored procedure compile happily as we don&#8217;t check the validity of pl/sql statements at this point.</p>
<p>Now when you call p_test11 with correct parameters you will get this error:</p>
<p style="padding-left: 30px;"><em><strong>SQL&gt; exec p_test11(1,2);<br />
begin p_test11(1,2); end;</strong></em></p>
<p><em><strong>*<br />
ERROR at line 1:<br />
ORA-06502: PL/SQL: numeric or value error<br />
ORA-06512: at &#8220;TPASS.P_TEST33&#8243;, line 10<br />
ORA-06512: at &#8220;TPASS.P_TEST22&#8243;, line 4<br />
ORA-06512: at &#8220;TPASS.P_TEST11&#8243;, line 4<br />
ORA-06512: at line 1</strong></em></p>
<p>Notice the ORA-06512, it is correctly identifying exactly where the errors are occurring.</p>
<p>How to Fix:</p>
<p>identify the line number and the root error code ( in this case <em><strong>ORA-06502: PL/SQL: numeric or value error<strong><em></em></strong></strong></em>)</p>
<p>and fix the prolem.</p>
<p>Learn more on <a title="ora-06502" href="http://www.oraclecity.com/ora-06502-plsql-numeric-or-value-error-string-tips-and-example/"><em><strong>ORA-06502: PL/SQL: numeric or value error</strong></em></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclecity.com/oracle-errors/ora-06512-at-string-line-string-tips-and-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ORA-06502 PL/SQL: numeric or value error string &#8211; Tips and Example</title>
		<link>http://www.oraclecity.com/oracle-errors/ora-06502-plsql-numeric-or-value-error-string-tips-and-example/</link>
		<comments>http://www.oraclecity.com/oracle-errors/ora-06502-plsql-numeric-or-value-error-string-tips-and-example/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 20:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle Errors]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[Oracle error codes]]></category>

		<guid isPermaLink="false">http://www.oraclecity.com/?p=207</guid>
		<description><![CDATA[Understand and Learn with example: Cause: An arithmetic, numeric, string, conversion, or constraint error occurred. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 99 to a variable declared NUMBER(2).]]></description>
			<content:encoded><![CDATA[<p><strong><span style="text-decoration: underline;">Cause:</span></strong> An arithmetic, numeric, string, conversion, or constraint error occurred. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 99 to a variable declared NUMBER(2).</p>
<p><strong>Example 1:</strong></p>
<p style="padding-left: 30px; text-align: left;"><em><strong>declare<br />
l_name varchar2(3);<br />
begin<br />
l_name := &#8216;abcd&#8217;</strong> </em><strong> </strong><em><strong>;<br />
end;<br />
/</strong></em></p>
<p style="padding-left: 30px;"><em><strong><span id="more-207"></span><br />
</strong><strong>declare<br />
*<br />
ERROR at line 1:<br />
ORA-06502: PL/SQL: numeric or value error<br />
ORA-06512: at line</strong></em></p>
<p style="padding-left: 30px;">
<p>Explanation: ORA-06502 occurred at line  4 because the variable l_name is defined as varchar2(3). But at line 4 we am assigning a value which is four character long ( larger than the variable can accommodate). That&#8217;s why the error is encountered.</p>
<p><strong>Example 2</strong>: Iin a stored procedure</p>
<p style="padding-left: 30px;"><em><strong>create or replace procedure p_test(p_empno number, p_sal number)<br />
is<br />
begin<br />
null;<br />
end;<br />
/</strong></em></p>
<p>Now called the stored procedure as</p>
<p style="padding-left: 30px;"><em><strong>SQL&gt; exec p_test(&#8216;abc&#8217;, 200);</strong></em></p>
<p>You will get the following output</p>
<p><em><strong>begin p_test(&#8216;abc&#8217;, 200); end;</strong></em></p>
<p><em><strong>*<br />
ERROR at line 1:<br />
ORA-06502: PL/SQL: numeric or value error<br />
ORA-06512: at line 1</strong></em></p>
<p><span style="text-decoration: underline;"><strong>Explanation:</strong></span> the stored procedure p_test is expecting two parameters both of which are numeric types. But while calling the procedure I am passing a character value. The pl/sql engine can not convert characters to numbers so it returns ORA-06512.</p>
<p><strong><span style="text-decoration: underline;">How to Fix:</span></strong></p>
<p>This problem can be fixed by changing the data type or by passing correct type of data.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oraclecity.com/oracle-errors/ora-06502-plsql-numeric-or-value-error-string-tips-and-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

