Showing posts with label Oracle Error. Show all posts
Showing posts with label Oracle Error. Show all posts

Thursday, August 21, 2008

System.Data.OracleClient requires Oracle client software version 8.1.7 or greater

I have oracle database installed in my computer. My Operating system is XP. I wrote an application in asp.net. It connected to oracle database. I had the connection string in web.config where I used the OracleClient as the provider.




(Fig: Connection string with provider as OracleClient )

But I could not connect to the database. A connection error occured. The error speaks:
System.Data.OracleClient requires Oracle client software version 8.1.7 or greater
But the odd is that I could easily connect to the database using OLEDB provider.

(Fig: Connection string with OLEDB provider)

I pasted the error statement in the google search textbox. I got almost same solutionfrom most of the sites. I will state the solution as suggested by the sites and put my experiences along with it.

Solution
Oracle 9.2 Client software requires that you give the Authenticated User privilege to the Oracle Home by following these steps:

1. Log on to Windows as a user with Administrator privileges.

2. Launch Windows Explorer from the Start Menu and and navigate to the ORACLE_HOME folder. This is typically the "Ora92" folder under the "Oracle" folder (i.e. D:\Oracle\Ora92).

3. Right-click on the ORACLE_HOME folder and choose the "Properties" option from the drop down list. A "Properties" window should appear.

4. Click on the "Security" tab of the "Properties" window.

5. Click on "Authenticated Users" item in the "Name" list (on Windows XP the "Name" list is called "Group or user names").

6. Uncheck the "Read and Execute" box in the "Permissions" list under the "Allow" column (on Windows XP the "Permissions" list is called "Permissions for Authenticated Users").

7. Re-check the "Read and Execute" box under the "Allow" column (this is the box you just unchecked).

8. Click the "Advanced" button and in the "Permission Entries" list make sure you see the "Authenticated Users" listed there with:
Permission = Read & Execute Apply To = This folder, subfolders and files

If this is NOT the case, edit that line and make sure the "Apply onto" drop-down box is set to "This folder, subfolders and files". This should already be set properly but it is important that you verify this.

9. Click the "Ok" button until you close out all of the security properties windows. The cursor may present the hour glass for a few seconds as it applies the permissions you just changed to all subfolders and files.

10. Reboot your computer to assure that these changes have taken effect.
Re-execute the application and it should now work.

Thank you Paul for the solution.

My Experiences-I got the problem in Oracle 8i.-I use Windows xp. My ORACLE_HOME is ora81 folder. When I select the properties, Iget the following window.

(Fig. When I right click and select properties of Ora81 folder in Windows XP)

As we can see there is no security tab. I tried the Web Sharing tab but with vain. So I had to follow the following steps to view the security tab.

1. Open the C:/ folder.
2. From Tools menu and click Folder Options.
3. The Folder Options window opens. Click the View tab.
4. In the advanced setting go to the last check box- Use simple file sharing(Recommended) and uncheck it.
5. Click apply and then Ok.

(Fig: How to see security tab in properties of the folder Ora81 in Windows XP)

Now again view the properties of Ora81 folder you will see the security tab.

(Fig: Security tab displayed in folder properties in windows xp)
I could see the security tab but there was no Authenticated User group.
So I added it using the Add button. And I followed all above mentioned steps.But the problem persisted.

My Solution
I just completely uninstalled the Oracle product from my PC. Then I reinstalled it.To my surprise it worked now.

I am surprised now, is to reinstall the oracle database the only feasible solution?May someone listen and reply me.

Meantime, you may be interested in object relational features of Oracle implemented using a simple yet practical ecommerce database.

Happy dot-netting! Happy Oracling!!

Sunday, August 17, 2008

ORA-02270: no matching unique or primary key for this column-list

I generated this error this morning. I was a little bit upset when the error occured. Mostly the error source of this error has been described in the Internet as follows:

Cause: A REFERENCES clause in a CREATE/ALTER TABLE statement gives a column-list for which there is no matching unique or primary key constraint in the referenced table.

Action: Find the correct column names using the ALL_CONS_COLUMNS catalog view

In my case, this error occured when I tried to add a foreign key constraint to a table.Later I found that there did not exist primary key in the referenced table or the column being referenced was not a primary key.

I think the better way to describe this would be to list out all possible reasons like the one I wrote above. Any way, I had to make the referenced column a primary key and it was done the next time!

At the end, you may also be interested in implementing object relational database features like inheritance, member function, collection array, nested table etc. in Oracle illustrated using a simple yet useful ecommerce scenario.

Happy Oracling! Happy programming!!

Thursday, August 14, 2008

ORA-00955: name is already used by an existing object

When I tried to create a new table in database I got the error:

ORA-00955: name is already used by an existing object

In fact, I had just deleted a table from TOAD.

( I use TOAD- perhaps most users use TOAD (Tool for Application Developer), I actually don't know how much users useTOAD! I think it is a very good tool if one uses Oracle as the backend. For only those who are beginning to use Oracle as the backend, here is where you can find what the TOAD is. You can download it and use it easily.I bet you will not require any training. Just look at it and find how easy it is! Not more than 28 MB. It is exactly 27.4 MB in the BackUP folder of my D- Drive! Ok, I will blog about it sometime later. A marvellous product-TOADSoft.com - Home of the World's #1 Tool for Database Professionals! (as they claim!!)

Click here: http://www.toadsoft.com.
You will be welcomed with the following messages:

Toad®, Market-leading tool that provides quick and easy database development and administration.Welcome to ToadSoft!

Toad is a powerful, low-overhead tool that makes database and application development faster and easier and simplifies day-to-day administration tasks.

Whether you are a database developer, application developer, DBA or business analyst, Toad offers specific features to make you more productive than ever before.
).
I thought I dropped the table Equipments and tried to run the script to create a table with exactly the same again. So I found out that ORA-00955 is not a severe error. I just dropped the table Equipements and regenerated it using the scriptI had already generated. It worked!

Cause: The "error ORA-00955: name is already used by an existing object" occurs if there isalready a database object (table, synonym, view, index, or cluster) and we try to create an object with the same name.

Note: I described that I was creating a table by running a script against the database from thetool TOAD. In fact, one can do it using the graphical interface of TOAD also. TOAD is in fact an IDE for Oracle database management and programming. I also love graphical tools!!

Before completing this post, I would like to invite you to read on implementation of object relational database features like inheritance, collection array, nested table etc. in Oracle which has been well illustrated using a simple ecommerce database scenario.

Happy Oracling! Happy Programming!!

Tuesday, July 29, 2008

Oracle Error ORA-01722: Invalid Number

ORA-01722: Invalid Number mostly occurs in runtime. There are some errors in programming that may generate ORA-01722: Invalid Number error. Let me present this formally.

Cause:
The attempted conversion of a character string to a number failed because the character string was not a valid numeric literal. Only numeric fields or character fields containing numeric data may be used in arithmetic functions or expressions. Only numeric fields may be added to or subtracted from dates.

Action:
Check the character strings in the function or expression. Check that they contain only numbers, a sign, a decimal point, and the character "E" or "e" and retry the operation

Experience:
I got the error in runtime when I assigned numeric value to a varchar2 parameter passed to a package. There may other so many possible reasons as discussed above. 

At the end, you may also like to read on implementing object relational database features in oracle like nested table, inheritance, collection array, member function etc.

Happy Programming!

Friday, July 25, 2008

Oracle Error ORA-12704: character set mismatch

One gets much worried by ORA-12704:character set mismatch. It is hard to track what is going on. But the guideline below will give relief.

Causes of Oracle Error ORA-12704: character set mismatch

-The string operands(other than an nlsparams argument) to an operator or built-in function do not have the same character set.

- An nlsparams operand is not in the database character set.

- String data with character set other than the database character set is passed to a built-in function not expecting it.

- The second argument to CHR() or CSCONVERT() is not CHAR_CS or NCHAR_CS.

- A string expression in the VALUES clause of an INSERT statement, or the SET clause of an UPDATE statement, does not have the same character set as the column into which the value would be inserted.

- A value provided in a DEFAULT clause when creating a table does not have the same character set as declared for the column.

- An argument to a PL/SQL function does not conform to the character set requirements of the corresponding parameter.

Action to be taken


Check one of the suspected region in your coding in PL/SQL and find the error occuring part. Then you can fix it and get rid of it! Happy error detection!!

Finally I would like to welcome you to get insight on implementing object relational features in oracle illustrated with a simple ecommerce scenario.

Happy Programming!

Wednesday, July 23, 2008

Oracle Error: PLS-00323

I encountered Oracle Error: PLS-00323 this morning. It took me time to resolve and fix it. In much cases, PLS-00323 get around you and you have to wander from here to there in Internet. Before going to Internet, you might have been tired of doing all your brains! This is all because of the oracle package that consists of a package specification and its corresponding body definition. Say, you have a package with three variables defined in your sub program and only two defined in your package body. Exactly here you get the error PLS-00323.

PLS-00323: subprogram or cursor 'BANK_GETBYPRIMARYKEY' is declared in a package specification and must be defined in the package body.

Here 'BANK_GETBYPRIMARYKEY' is my sub program.

Fixes: To be sure you can just check the matches in package specification and package body. Happy database programming.

Popular Posts

Recent Articles