Oracle 10.2 Startup /Shutdown via JDBC [message #427990] |
Mon, 26 October 2009 12:17 |
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 #428263 is a reply to message #427998] |
Tue, 27 October 2009 11:28 |
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 |
|
Michel Cadot
Messages: 68729 Registered: March 2007 Location: Saint-Maur, France, https...
|
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
|
|
|