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

25 October, 2014

Java SE 7 Programming Essentials - my 2nd Java book

English: The cover illustration for the Java P...
English: The cover illustration for the Java Programming book on Wikibooks (Photo credit: Wikipedia)
25-October-2014


About a week ago, I finished reading my 2nd book on Java programming - Java SE 7 Programming Essentials, authored by Michael Ernest. It was basically written for a beginner, but one who is aiming for an Oracle certification, the OCA Java SE 7 (Oracle Certified Associate, Java SE 7).

I have been doing software development since 1996, using PROMIS and VMS, and the very first Windows, and DOS, etc., and I have used .NET in all of my latest applications, but I would admit that I still picked up a lot of fundamental knowledge from this book.

I've come across much of the same topics in another book, C# in Depth, but in Java SE 7 Programming Essentials, they were presented for beginners. Thus, the detailed explanation, which is easy to grasp.

I had to admit that the modifiers was one of the things that became clearer to me, and I am now more aware as to why a class or method is declared public, and not private, or if no modifier is used, what the default behavior is, etc. Very basic, right?

Inheritance and composition is another thing that I was refreshed on, and the use of the 'this' keyword, especially when using inheritance, where properties are also passed down.

Constructors were also discussed, and I learned how you can create your own constructor.

Then there is also the topic on interface, and when it becomes a limitation. Followed by enumeration.

But the one thing I like very much, which I have been looking for so long, is how he presented the acquisition of a business, which needed the merging, or enhancing of the acquired company's business system. Very simple, but that is what I have been looking for - creating your own, and integrating into an existing simple that is built differently - without breaking each other.

Indeed, doing software development is one easy task, but creating a code that is optimized and compact, easy to maintain, and is in all aspect of the highest standards - that is one tough goal, a hard target. But then again, how can you score if you don't have a goal?

Aim high, and hit the mark!

That's what I'm doing now. Patience, and I will hit the mark.

Till then...

25 August, 2014

Oracle XE, ODP.NET and Oracle 9i in the same Windows XP machine

English: The logo of Oracle Corporation de:Bil...
English: The logo of Oracle Corporation de:Bild:Oracle-Logo.svg he:תמונה:Oracle Logo.jpg (Photo credit: Wikipedia)
Saturday night, 23-Aug-2014


For a couple of weeks now, I have been figuring out how to make Oracle 9i and Oracle XE work in the same machine. For a long time, I have been running Oracle 9i and ODP.NET, designing, developing and maintaining applications using the Oracle RDBMS. Only lately when I started working in a new company that I am having restricted access to databases that I had to resort to some local DB, even on my old XP machine. I have the disc space to begin with.

And having some access on some Oracle dB means I had to also create and maintain a local dB that is Oracle-based. In comes Oracle XE.

That is when I started experimenting with Oracle Express Edition, and with 11g as the latest, and with ODP.NET version of 10.x.x, did not think of having a compatibility issue, even then, since I was doing all these in a Windows XP-based unit.

Then I got the problem. I mean, I don’t know how it happened, but for a moment, after initially installing oracle XE, I was getting both local dB and data warehouse dB (using TNS) to work. I was very happy. And as in all installs, I did a reboot. And if in most cases, a reboot would rebuild and repair and renew settings and realign once again everything – as new – something now doesn’t work. I either would get the DW dB to be working, and Oracle XE dB to be broken, or vice-versa.
I did many things, like tweaking the Path variables, the 3 .ora files, even the TNS_ADMIN variable and value, pointing either to the Oracle 9i directory, or the Oracle XE, and like I said, I would either get one or the other, but not both. And in most cases, I get the DW dB which is using TNS, to be the one working. Doing a PING to XE would result in error, but TNSPING to XE would give a positive result. But both PING and TNSPING to 127.0.0.1 would give both a positive result.

As in previous issues and problems, I did a lot of searching. And this becomes complicated, because I have to wait until I get home then I will be able to look up ORA-12154, ORA-12514, ORA-12528, etc., etc., because internet access is also restricted! Bummer!

There were some suggestions that focused on setting up, if not already, TNS_ADMIN variable in the system variables, and assigning its value to the Oracle XE …\network\admin path, and I tried this one, adding, removing, changing, then putting it back to Oracle 9i …\network\admin path, and still, I would either get one or the other, but not both. And still the same, I would usually be having the DW dB working, but not the Oracle XE dB.

I should mention that for each trial, I am either uninstalling Oracle XE, at least, or I would uninstall all of Oracle XE, ODP.NET and Oracle 9i, in sequence. And in reinstalling, it is also in the same order: Oracle XE, then ODP.NET, and finally, Oracle 9i. I believe it is common knowledge for all who have tried it, that for ODP.NET to work with Oracle 9i, the installation should be in that sequence. This is more or less something to do with the final value of Path in the system variables, and even in the default Home selection for Oracle.

Also, after each uninstallation, I would run CCleaner to remove invalid registry items, after a reboot. And after running CCleaner, another reboot, to really be sure that I am starting clean.

After many trials and errors, I made it to work. I did a reboot, and I checked, and it is still working. Another reboot, and it is still working. I run CCleaner, to once again remove invalid registry items, then a reboot, and yes, I confirm that both data warehouse dB using TNS and Oracle XE dB are both working.

Monday morning, 25-Aug, when I came to work, I booted up my PC, tested the 2 dBs, and they are working. I did a reboot, just to be really sure that I am not dreaming, and yes, both are working.

What did I do to make it work?
  1. I removed the TNS_ADMIN setting from the System Variables. So it is now the individual .ora files being looked up and evaluated when I do a connection to each dB. (I think).
  2. After the installation, I did not touch the .ora files, which means that whatever value that was created by the installers, then that was it. No tweaking or whatever.
  3. The ODP.NET …\network\admin folder does not contain any .ora file. That’s a fact. It is just the dll file anyway that is required by .NET applications. Nada mas.
The day is now closing, and I have done quite a number of reboots – I am just very, very curious if the working condition will be sustained throughout the day. And yes, even as the day is already closing, I still get both data warehouse dB using TNS, and the local dB, using Oracle XE. I guess some times, you just keep your hands off things, and they will work on their own. They don’t need our help. 

Sometimes.

Till then!

04 May, 2013

ORA-12154: The other uncommon cause, and the solution

Image representing Oracle Corporation as depic...
Image via CrunchBase
ORA-12154: It is not always due to the listener down, or something...
-----


04-May-2013

2 weeks ago, while I was preparing my arsenal of personal computers (now 9, with 1 laptop and 8 desktops) at work, one requirement is to be able to synchronize the TNS file across all the 9 computers.

This would need me to have a read/write priv to the Ora folder in the 9 PCs, and so I opened it up for me by sharing the folders. This, in turn, closed the folder access to everybody else, because I shared the folder only to me – I removed access for Everybody/Everyone. The priv then was full control.

That began the issue of all users of the web apps running in these computers, where ORA-12154 is being thrown. I didn’t see it, and I could just imagine their shock that suddenly, the application doesn’t work properly. Until one of the customer service personnel came over to ask something, and just remembered to check with me why the web apps aren’t working.

Thinspiration - Weight Loss Method

I quickly checked, and I got ORA-12154. Since that same day I got to sync all the code files and accessory files in all of the computers, I didn’t know where to start at first. I gathered my wits, and thought of checking the particular web apps having problem. Problem was there. Half a day passed, and the problem persisted. Then I thought of verifying the web apps from my laptop. It was working! So I got even more confused, believing that it was the file transfer that I run which caused the problem.

A few more check here and there on the web apps having problem, and still no luck. I then started to check on the other web apps and Windows apps using the same files and libraries, and to my surprise, they are all working!

What now?

At this point, I knew I had to break away from the pressure, so I called up the Oracle DBA, and asked him about ORA-12154, and since I can’t do desktop sharing on any of the affected computers (yes, all having problem, actually, and on the same web apps), he came over. He checked a few items, and he is also stuck. Told him all that I‘ve done so far, and I said the other Web and Windows apps are running, to which he checked with me, “And these are running under your account?”

I said “Yes.”

At that queue, he checked the Ora folder, looked at the sharing setup, and opened it to “Everybody”.

That PC worked. After that, he went on his way, trusting me to be able to manage the rest.

So there you are. ORA-12154 error. It is not always that the listener at the server machine is down, or whatever. For my case, it was the access privilege that got screwed up. Anybody running the web apps that uses Oracle client must have access to the installation folder, at least “Read” access.

Hope this helps anybody there running into the same problem, but is not due to the listener down or not running.

Till then!
Enhanced by Zemanta

02 December, 2011

The provider is not compatible with the version of Oracle client; ORA-03134

English: The logo of Oracle Corporation de:Bil...Image via Wikipedia02-Dec-2011


One of the final touches that I had to do on the new refurbished PC that I got is to make it into a local web server, an intranet application per se. And having found that in Windows 7, the way to go is publishing by a compiled site, I did just that.

I am one who would tend to make use of the different technologies and methodologies, just to be able to familiarize and not be tied to one; it’s for the good: when that singular method you lean on breaks, your whole system breaks, so having many sticks to lean on, you still are lifted up by the many others that remain standing and strong – when one breaks or falters.

Here’s what happened:

I copied over the codes, built the solution, and then published it. Since this is the second time around, I was going through all these things, including the creation of the folder, a breeze.

When I accessed the service from another PC, well, I got a 404 error.

I went to the IIS manager, and ticked all the services and features that I think are needed; of course, I haven’t memorized these sets, so I referenced the other PC that is already running the same web application.

That wasn’t enough. I still get a 404 error.

I remembered other things needed, so I didn’t hesitate downloading Web Platform Installer, where some other small, small services or features, not to mention some other service packs or applications, are offered.

I did that, and when the installation was finished, I did a reboot.

That brought the intranet application up and running!

Well, not all of it.

The section that runs queries using Oledb was okay. The other section that runs queries using Oracle client (ODP.NET) wasn’t. I got this error message:

“The provider is not compatible with the version of Oracle client”


Of course, the web being my primary source of information, I immediately launched Maxthon, which I prefer using to IE (a snail browser; Netscape is many times faster than IE), and searched on solutions to this problem at hand.

Again, many, many articles and discussions offered various steps to solve this problem, like copying over some dll files to the folder holding the exe, installing the ‘right’ and ‘compatible’ version of Oracle client, etc., etc. I could say the list is endless. I think I also saw some that suggested checking on the Oracle home definition, in various way and means, which I did by invoking Home Selector, and finally, through the registry editor.

And these didn’t help me. My problem isn’t solved. I actually did another comparison technique, that of the working PC and the non-working PC. They are the same.

But taking from some from the whole, I did what I think will help. I reinstalled ODP.NET, of course the version I am using is the same all over the computers that I manage. So there is no question of introducing an ‘incompatible’ or ‘incorrect’ version for this software.

Well, that fixed the problem on the particular section. BUT, it broke a number of other applications!
In particular, I got this error:ORA-03134. This is something about a newer Oracle client version accessing an older Oracle server version.

I’ve been through this one, but I don’t remember how I fixed it! My gracious me…

But I thought, since I fixed one by reinstalling, why don’t I do the same with this other?

And I did just that, reinstalling Oracle 9i client – which fixed ORA-03134.

I did a reboot, and after confirming that all the sections of my just-released web application are working, I retired – for the day.

Here’s a summary of what I was doing, what happened, and how problems are fixed, so far:

  1. Publish an intranet application on a local desktop PC running in Windows 7
  2. Copy the codes from another PC (already running the same web apps).
  3. Created the folders in the Program Files directory for the web apps destination.
  4. Built, and published to local folder (through compiled site method).
  5. Opened IIS manager (inetmgr), then added in the Virtual Directory (PC_Name >Sites > Default Web Site right click, then select Add Virtual Directory).
  6. Once the Virtual Directory is added, I right click on it, and then selected Convert to Application.
  7. That’s when error 404 was thrown out.
  8. Turned on additional windows features on IIS. Still got 404.
  9. Installed Web Platform Installer, followed by installing the service pack, and some auxiliary services and features.
  10. Reboot, and that’s when Web Apps was brought up, but section using Oracle client wasn’t working, with this error message: The provider is not compatible with the version of Oracle client.
  11. Reinstalled ODP.NET (the version I am using is ODT with ODAC 11.2.0.2.1)
  12. Fixed section using Oracle client for oracle connection, but created a problem for the others, specifically Oracle 9i client, with this error message: ORA-03134.
  13. Reinstalled Oracle 9i.
  14. The other programs were okay, and every section of the web apps works.
  15. Reboot, and crossed my fingers while waiting for the machine to come back up.
  16. A final check and review, and everything were working fine.
  17. And so I retired for the day, tired, but happy.



Till then!


Enhanced by Zemanta

18 July, 2011

ODP.NET and VS2010

Pro ODP.NET for Oracle Database 11g (Expert's Voice in Oracle)For the past couple of weeks, I have been struggling with the usage of ODP.NET 11g version, together with VS2010.

I currently have Oracle 8i installed on my machine, and this is running TOAD v9.xxx, and also PL/SQL Developer, with VS2005.

All things are working fine.

I have actually been trying out VS2008 and VS2010 Express editions for quite sometime, but I have never ventured into the use of ODP.NET 11g.

Then about a month ago, I was able to get the installer for VS2010 Premium from our IT folks, and that is when my nightmares began.

Database Normalization eBook


Conflict of (OraHome) Interests

I didn't know it, but right on top of my working environment, I installed immediately, without trying out the earlier versions (ODAC ver9, ver10), ODTwithODAC112021. Well, I was able to run VS2010 codes using ODP.NET, and I was actually able to note that it is fast. I managed to create a simple code that lets me use stored procedures, which I immediately progressed to REF_CURSOR, as is the offered advantage when using ODP.NET, which is able to fetch multiple rows and multiple columns data set, which can be easily accessed as per normal (hasRows, etc., etc.).

ODP.NET Developer's Guide: Oracle Database 10g Development with Visual Studio 2005 and the Oracle Data Provider for .NET: A practical guide for ... Oracle Developer Tools for Visual Studio 2005But that is in exchange for a non-functioning TOAD, which is now unable to access some 'older' systems. 8i, 9i, etc. The error messages I got, which when I googled out to see if anything can be of help, did not help my situation. Yes, there are a ton of articles that should help me out, but to my situation, no help from the web was of help.

I got these: ORA-12541, TNS no listener, ORA-31xxx something, something, xxx is no longer accessible xxx, etc.

The thing is, when I run into these problems, that is when I found out that there is the known problem of versioning issues with Oracle clients, where the Home is switched from here to there with each installation, or that even when it didn't, a new conflict arises between the different Ora versions.

So I uninstalled ODTwithODAC112021, but that didn't restore my system to its working condition.

Thus began my half-month experimentation - mind you, I am not able to work during these times!


When one fails, will the others succeed?

I now tried installing Oracle 9i, which installed correctly, but TOAD can't perform login. Uninstalled.

Pro .NET Oracle ProgrammingI tried back ODTwithODAC112021, which resulted to the error: "OCI version 11.2.0.1.0 product is not supported", and when I googled this error msg, I found that TOAD has to be upgraded to version 10. Money?

Uninstalled ODTwithODAC112021, but still TOAD can't do login.

I now tried installing ODAC92070, but the setup was terminated without any error msg at all. It just quit on me!

I now tried to install back Oracle 8i client, but this one also throws out an error msg now, and can't be installed anymore.

Have I cracked my PC's nervous system? It is so confused now!

I attempted installation of Oracle 9i client, and while it installed correctly, TOAD still can't run. Uninstalled.

At this time, I looked at ODAC101040, installed it, and voila! TOAD runs. But wait a minute, VS2010 now throws out some error. Version problem? Unfortunately, I didn't capture the error message details. Somehow it has got to do with some service that isn't running. However, I did check that  OracleMTSRecoveryService is running from the Services view. Uninstalled.

As I am getting tired now, and running out of options, I planned to just make VS2010 run, declare that this is more the important thing, and call it a day. I installed ODTwithODAC112021, but at this time, even this one now throws out an error during installation. I can't proceed to install it!

Pro .NET Oracle ProgrammingI find that this is due to my home being selected as DEFAULT_HOME1, which is the very first home that was created with my old configuration when Oracle 8i was installed.

I changed that to OraClient11g_home1, and I was able to install ODTwithODAC112021, and then I was able to run VS2010 okay, but not TOAD (at least, some newer systems I can connect to, but not all, esp those running on old servers).

I went to sleep.


A new day

I thought that I would be okay with what I now have, but I was wrong. I can't rest until everything works the same, as when I started, and yet I wanted to work with the latest versions. I repeated the whole exercise the whole day, again, but still ended up with either the VS2010 working, and TOAD not working, or the other way around.

Did I mention it took me half a month doing this? I did. A couple of days. But it is good that my boss never asked me on what I have produced within those 2 weeks while attempting to make things work on ODT.NET and VS2010.


Revo Uninstaller to the rescue (or so I thought)

Professional Visual Studio 2010 (Wrox Programmer to Programmer)After so many days doing install and uninstall actions, my system seems to have been corrupted. I can't even unstall the 8i, 9i clients completely, and also the ODAC 9, 10, and 11 versions. They remain in the system even after I have performed uninstallation. What's worse, my system doesn't work as before.

I have Revo on my system, so I went to 'Forced uninstall' mode, and I was glad I did. I cleaned up my system, even to the last bit of these Ora creatures - completely!

And right after the last clean-up, I'm not able to access internet, or even our intranet applications! I must have uninstalled some fundamental services when I did the clean-up! I did!

My TCP/IP was deleted together with the items when I did the forced uninstall!

So not only do I have a system that doesn't run TOAD, or VS2010. I now have a system that can't do network connections! And in a company that relies on networks for applications to run, my system has become useless altogether now!


A help from our User Support Team.

Visual Studio 2010 All-in-One For DummiesI quickly went to our User Support group, and I told him what happened. You see, I have other PCs at work that I used to google possible fixes when TCP/IP is broke, and I did all those things. Yes, there is help all over the web, but unfortunately, none of these, though helpful, helped my situation.

So I went over to the 'nut-and-bolt' guys, and I was advised to see if I can do it by system restore. So I grab that flicker of hope, immediately proceeded to do a system restore, and my PC was back! Now I only have those duplicates to deal with.

I now cautiously performed the uninstallation of the Oracle products. (You have to get burned before you become cautious and careful sometimes...) I checked, and I found that there was an article somewhere in the OracleForums, about manually uninstalling Oracle 8i, 9i, etc. I followed that to the letter after doing the OUI uninstallation actions. I edited the registry, removed the folders, delete the files in the Temp\ folder, emptied my Recycle bin, with the reboot after the registry edit and after emptying the bin.

At this point, I now have a 'clean' system.


Instant Client, ODAC92070 and ODAC112021 (XCopy version) - the three muskeeters

Microsoft Visual Studio 2010: A Beginner's GuideI was getting curious if Oracle Instant Client works, for me, I should say, since many do vouch for it. So as part of my curiosity, and with my exhausted energy that I can only do little and quickly at that, I now tested Instant Client, especially that the procedure is fast and simple.

Copy zip file, unzip, rename, define Path, and copy over my TNSNAMES.ORA, SQLNET.ORA and LISTENER.ORA. I was careful to put these in the correct folder.

Did my TOAD 9.xxx work? You bet it did!

However, as I have said, some older systems I still am not able to connect to. We're not done yet...

I now installed ODAC92070, taking note of any error messages that might get thrown during installation. Well, there was none.

Does TOAD still work? You bet it does!

And now, I am able to access the old Oracle server. Last hurdle, VS2010.

Visual Studio 2010 Professional UpgradeWith all hopes dashed with the failed attempts on ODTwithODAC112021, I switched to ODAC112021, which is basically the same as the former, but is just different in the manner of installation, I tried the XCOPY version.

Finally, the system variable TNS_ADMIN was set to the final folder/directory, and testing was done:

TOAD - it works!
VS2010 - it works!


Victory, at last!

Boy, I still got what I wanted, and although I didn't get it so easily, there is prize for the persistent and diligent.

Till then!

Enhanced by Zemanta