Tuesday, September 29, 2009

"conn / as sysdba" on Windows

We can do the following when we want to connect to Oracle db using "conn / as sysdba" in *nix environment:


% sqlplus /nolog

% conn / as sysdba

Not a big deal. However, I got the following doing the same on Windows XP:


C:\>sqlplus /nolog

SQL*Plus: Release - Production on Tue Sep 29 16:08:51 2009

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

SQL> conn / as sysdba


ORA-12560: TNS:protocol adapter error

After going around for awhile, here is the solution: we need to start the corresponding Oracle services (OracleService) from Control Panel > Administrative Tools > Services. This service automatically starts the database in open state by default. If you want to start in other state, then you need to set ORA_ORCL_AUTOSTART registry value (\HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_orahome102) to FALSE. Here is the screenshot of the registry entry after I changed it:

And here we go again:


C:\>net start OracleServiceORCL

The OracleServiceORCL service is starting.

The OracleServiceORCL service was started successfully.

C:\>sqlplus /nolog

SQL*Plus: Release - Production on Tue Sep 29 16:38:20 2009

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

SQL> conn / as sysdba

Connected to an idle instance.

SQL> startup nomount

ORACLE instance started.

Total System Global Area 612368384 bytes

Fixed Size 1298168 bytes

Variable Size 289407240 bytes

Database Buffers 314572800 bytes

Redo Buffers 7090176 bytes

Notice that the listener is not even started!

Tuesday, August 07, 2007

Tune up your JDeveloper

JDeveloper is slow, or is it? I'm using Oracle JDeveloper 11g - Technical Preview (Studio Edition Version, and it was incredibly slow. Opening project, drawing database diagram, switching between application, etc are really testing my patient.

I'm using a pretty good notebook: Win XP, dual core processors, 2 GB RAM, and plenty of HD space. After a few searches here and there, the cause turns out not due to hardware or Oracle, but the setting on my graphic card, ATI.

Right mouse click on the Windows desktop and select ATI Catalyst Control Center. Select View > Advanced View to show advance settings. In the POWERPLAY menu, make sure your preferred settings are set to Optimal Performance. See the screenshot on the right.

Now my JDeveloper magically runs like a cheetah.... and my other Swing app as well (SQL Developer). This is apparently due to Swing bug 5095398.