views:

307

answers:

3

I am setting up a VM to try to duplicate our production environment so I can do deployment tests. The VM is VMWare Server running Windows Server 2003 with Oracle 10g. I am connecting to oracle through a tnsnames connection identifier.

I got it up and running once, copied the VM files and thought everything was peachy. But now am encountering some problems trying to get oracle running on the backup that I made. That being said, it is entirely possible that I made some change to either this or the working VM that I either didn't notice or forgot about so I don't think this is necessarily a virtualization issue.

I'm no oracle guy, and we don't have much of a dba so I'm kind of up the creek here. Here's my problem:

  • When I start up the machine I can do lsnrctl services and see that the service housing my application database has 1 instance running. When I try to connect through sqlplus however I get ORA-01033: Oracle initialization or shutdown in progress
  • If I wait for a while I see the service disappear from the lsnrctl services list, obviously I can't connect with sqlplus then (ORA-12514)
  • If I go to the windows services management mmc console I can see that the windows service which should house that oracle instance is indeed still running.
  • I can restart the windows service. At this point I can once more see it under lsnrctl services but again, trying to connect to it through sqlplus results in ORA-01033. After a while it shuts down and goes away.
  • Attempting at any point to sqlplus "/ as sysdba" results in ORA-12560: TNS:protocol adapter error
  • Nothing of any use gets written to the Windows Event Log

Any ideas as to what could cause this? Any hints on what I can try next?

Update: In the spirit of stackoverflow let's keep this open in case someone comes by later looking for advice but in my case a full uninstall/install of oracle and re-import of the database was the most expedient solution.

+1  A: 

Did you run "alter database open" after you created the control file?

See http://www.dba-oracle.com/t_ora_01033_initialization_shutdown_progress.htm

Or perhaps you have a corrupted file?

See http://basmv.blogspot.com/2007/10/oracle-ora-01033-error.html

There seems to be a plethora of issues that people have worked through similar to yours. Just google "ORA-01033."

Nathan
ok thanks a lot, I'll keep trying
George Mauer
+1  A: 

I too had strange problems running Oracle 10g (10.2, I think) in Windows Server 2003 R2 under a VM (Virtual PC in my case). For whatever reason, Oracle would never finish starting the database until I opened up one of the local Oracle Management tools. I believe it was the Database Configuration Assistant.

If I chose the configure option for my existing database, the DB would successfully start. From that point on, I would tell my VM to save and exit rather than shutting down the image.

I never did figure out what caused the problem in the first place...

R. Bemrose
I take it that this didn't solve your problem, though?
R. Bemrose
Nope, complete rebuild of oracle did though
George Mauer
+1  A: 

Oracle on windows is a bit weird.

Not only does the oracle_home needs to be properly set/selected, the version of oracle needs to be the same and the oracle entry in the window's registry be valid. If they are not all correct you will not be able to connect into the db with sqlplus "/ as sysdba".

Aside from that go to the location where the alert.log for the database is kept. Look in the alert log file and see if the where in the startup process the database is at and if it even got fully started. If it did not get fully open then it needs to be open.

Since you can't log into the database as sysdba that will be a challenge. Resolve the sysdba login issue so you can log into the instance locally as sysdba and then you can resolve the issue of bringing the database online. The best thing to do is to install the exact version of oracle on the new vm as on the original server, create the same oracle service as on the prod server on the vm, shutdown the prod server cleanly, copy all database files from the prod server to your vm into the exact location as they existed, don't forget the spfile. Start the service on their respective machine and see if it works. Prod should not be affected so it should restart fine. On the vm take a look at the alert log for errors and correct them.

If all else fails use Rman to duplicate your prod to vm and that should work.

MichaelN
Thanks a lot, great advice for next time I run into connectivity issues. For now an uninstall/reinstall served me fine
George Mauer