Home » Open Source » Programming Interfaces » Oracle 10.2 Startup /Shutdown via JDBC (Server 10.2.0.1.0, JDBC Driver 11.2.0.1.0, AIX 5.3 ML10)
Oracle 10.2 Startup /Shutdown via JDBC [message #427990] Mon, 26 October 2009 12:17 Go to next message
mjseaman
Messages: 2
Registered: October 2009
Junior Member
Hi,

I have been trying to get shutdown and startup via JDBC working. I am using the thin driver on the server machine. Shutdown works fine, but whenever I try to startup the database, I get the following error:

ORA-12514, TNS:listener does not currently know of service requested in connect descriptor

I know this is the normal response when the database is down.

Does startup require an 11.2 listener? I have tried using a standard URL and also using a connect string in listener format. Have you gotten startup to work with a 10.2 server?

Thanks,

Mark
Re: Oracle 10.2 Startup /Shutdown via JDBC [message #427998 is a reply to message #427990] Mon, 26 October 2009 13:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You have to do it locally.

Regards
Michel
Re: Oracle 10.2 Startup /Shutdown via JDBC [message #428263 is a reply to message #427998] Tue, 27 October 2009 11:28 Go to previous messageGo to next message
mjseaman
Messages: 2
Registered: October 2009
Junior Member
Hi,
Thanks for the response. What do you mean by "You have to do it locally"?

The JDBC Developer's Guide, 11g Release 2 shows it being done remotely (or at least through the jdbc thin driver with a listener connect string). Here is the code fragment from the book:

OracleDataSource ds = new OracleDataSource();
Properties prop = new Properties();
prop.setProperty("user","sys");
prop.setProperty("password","manager");
prop.setProperty("internal_logon","sysdba");
prop.setProperty("prelim_auth","true");
ds.setConnectionProperties(prop);
ds.setURL("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=XYZ.com)(PORT=1521))"
+ "(CONNECT_DATA=(SERVICE_NAME=rdbms.devplmt.XYZ.com)))");
OracleConnection conn = (OracleConnection)ds.getConnection();
conn.startup(OracleConnection.DatabaseStartupMode.NO_RESTRICTION);
conn.close();

Thanks,

Mark
Re: Oracle 10.2 Startup /Shutdown via JDBC [message #428280 is a reply to message #428263] Tue, 27 October 2009 13:34 Go to previous message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I mean you cannot use "@(description...", you have to be on the server and use ORACLE_SID. I don't know if it is possible in JDBC, I don't think so, I think if you don't provide machine and port, Oracle takes localhost and 1521 and try a loopback remote connection.

Regards
Michel
Previous Topic: ODBC config/connection string for Oracle RAC
Next Topic: ODBC log shows ORA error even though the procedure runs fine on the backend.
Goto Forum:
  


Current Time: Mon Dec 05 18:56:05 CST 2016

Total time taken to generate the page: 0.10289 seconds