How to access from one instance to another using molecule - mongodb

I'm trying to use ansible-mongodb-cluster scripts to create a mongodb cluster.
I've edited hosts in order to have just a primary and a slave.
I use molecule with vagrant to test it.
this is my molecule.yml
ansible:
playbook: 01_create_cluster.yml
verbose: vvv
inventory: hosts
vagrant:
platforms:
- name: centos
box: centos/7
providers:
- name: virtualbox
type: virtualbox
options:
memory: 512
cpus: 2
instances:
- name: mongo1
ansible_groups:
- mongo_servers
- mongod_primary
- mongod_slaves
interfaces:
- network_name: private_network
type: static
ip: 192.168.80.1
- name: mongo2
ansible_groups:
- mongo_servers
- mongod_primary
- mongod_slaves
interfaces:
- network_name: private_network
type: static
ip: 192.168.80.2
and this is hosts inventory ansible file:
[mongo_servers]
mongo1 mongod_port=27017
mongo2 mongod_port=27017
[mongod_primary]
mongo1 mongod_port=27017
[mongod_slaves]
mongo2 mongod_port=27017
the problem borns when, after primary is created and replication is activated on it, slave trying to connect to the primary:
"MongoDB shell version v3.4.4",
"connecting to: mongodb://mongo1:27017/",
"2017-05-25T15:38:51.399+0000 I NETWORK [thread1] getaddrinfo(\"mongo1\") failed: Name or service not known",
"2017-05-25T15:38:51.400+0000 E QUERY [thread1] Error: couldn't initialize connection to host mongo1, address is invalid :",
"connect#src/mongo/shell/mongo.js:237:13",
"#(connect):1:6"
it doesn't know mongo1 host.
Even if i add in /etc/hosts the relation
192.168.80.1 mongo1
it says me that Destination Net Unreachable
how can i solve and let every VM "see" the others in the network?
EDIT
ping goes in timeout and telnet too
EDIT2
This is traceroute
[vagrant#mongo2 ~]$ traceroute mongo1
traceroute to mongo1 (192.168.80.1), 30 hops max, 60 byte packets
1 gateway (10.0.2.2) 0.191 ms 0.111 ms 0.063 ms
2 192.168.93.254 (192.168.93.254) 0.614 ms 0.716 ms 0.710 ms
3 10.17.254.1 (10.17.254.1) 3.410 ms 3.366 ms 3.316 ms
4 93-57-16-193.ip162.fastwebnet.it (93.57.16.193) 5.409 ms 5.384 ms 5.340 ms
5 93-54-33-65.ip127.fastwebnet.it (93.54.33.65) 21.192 ms 21.135 ms 21.084 ms
6 10.2.7.101 (10.2.7.101) 10.390 ms 2.447 ms 2.318 ms
7 10.254.20.77 (10.254.20.77) 2.228 ms 10.254.20.73 (10.254.20.73) 2.171 ms 2.045 ms
8 * * *
9 * * *
10 * * *
11 * * *
12 * * *
13 * * *
14 * * *
15 * * *
16 * * *
17 * * *
18 * * *
19 * * *
20 * * *
21 * * *
22 * * *
23 * * *
24 * * *
25 * * *
26 * * *
27 * * *
28 * * *
29 * * *
30 * * *
[vagrant#mongo2 ~]$

I solved adding two other configuration to the molecule.yml:
interfaces:
- network_name: private_network
type: static
ip: 192.168.80.1
auto_config: true
options:
append_platform_to_hostname: no
auto_config: true
and
options:
append_platform_to_hostname: no
now if i ping the other vm, they reply successfully!

Related

Postgresql get the distinct values with another max value

I have a table with this values:
id - idProduction - historical - idVehicle - km
1 - 200 - 1 - 258 - 100
2 - 200 - 2 - 258 - 100
3 - 200 - 2 - 259 - 150
4 - 200 - 3 - 258 - 120
5 - 200 - 3 - 259 - 170
6 - 300 - 1 - 100 - 80
7 - 100 - 1 - 258 - 140
8 - 300 - 2 - 325 - 50
I need to get the values with the max historical, for all the distinct idProduction. In that case:
4 - 200 - 3 - 258 - 120
5 - 200 - 3 - 259 - 170
7 - 100 - 1 - 258 - 140
8 - 300 - 2 - 325 - 50
It my first work with postgresql, so I don't have to much idea on how to do it, does anyone can help me?
Thank you!
I think with that I can solve my problem, but I'm not sure... :
SELECT id, productions_vehicles.id_production, nu_task_number, id_historical, id_vehicle
FROM productions_vehicles
INNER JOIN
(SELECT id_production, MAX(id_historical) AS idHistorico
FROM productions_vehicles
GROUP BY id_production) topHistorico
ON productions_vehicles.id_production = topHistorico.id_production
AND productions_vehicles.id_historical = topHistorico.idHistorico;
You effectively need two requests, your solution looks good, you can also use the WITH clause to do the first request :
WITH topHistorico (
SELECT id_production, MAX(id_historical) SA idHistorico
FROM productions_vehicles
GROUP BY id_production)
SELECT id, pv.id_production, nu_task_number, id_historical, id_vehicle
FROM production_vehicles pv
INNER JOIN topHistorico th ON pv.id_production = th.id_production AND pv.id_historical = th.idHistorico
PostgreSQL: Documentation: 9.1: WITH Queries (Common Table Expressions)

Doing a refund on paypal using NVP/SOAP using powershell

I'm trying to perform a refund on Paypal developer account but I keep getting errors while trying to run this command via powershell:
$certpath="E:\AAAA\cert_key.pem"
curl -v -E $certpath -F content=C:\Users\AAA\Desktop\res.xml;type=text/xml" https://api.sandbox.paypal.com/2.0/
The Content of the XML are as below which i took from paypal developer site:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header>
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" SOAP-ENV:mustUnderstand="1">
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents">
<Username>username</Username>
<Password>password</Password>
<Subject/>
</Credentials>
</RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<RefundTransactionReq xmlns="urn:ebay:api:PayPalAPI">
<RefundTransactionRequest xsi:type="ns:RefundTransactionRequestType">
<Version xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="xsd:string">1.0</Version>
<TransactionID xsi:type="ebl:TransactionId">3P573784GG4876055</TransactionID>
<RefundType>Full</RefundType>
<Memo>Shell script FULL refund example</Memo>
</RefundTransactionRequest>
</RefundTransactionReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
But i keep getting below error:
curl : * timeout on name lookup is not supported
At line:2 char:1
+ curl -v -E $certpath -F "content=C:\Users\MICHELANGELO\Desktop\res.xml;type=text ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (* timeout on na...s not supported:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
* Trying 173.0.82.78...
* TCP_NODELAY set
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Connected to api.sandbox.paypal.com (173.0.82.78) port 443 (#0)
* schannel: SSL/TLS connection with api.sandbox.paypal.com port 443 (step 1/3)
* schannel: checking server certificate revocation
* schannel: sending initial handshake data: sending 173 bytes...
* schannel: sent initial handshake data: sent 173 bytes
* schannel: SSL/TLS connection with api.sandbox.paypal.com port 443 (step 2/3)
* schannel: failed to receive handshake, need more data
* schannel: SSL/TLS connection with api.sandbox.paypal.com port 443 (step 2/3)
* schannel: encrypted data buffer: offset 4071 length 4096
* schannel: a client certificate has been requested
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* schannel: SSL/TLS connection with api.sandbox.paypal.com port 443 (step 2/3)
* schannel: encrypted data buffer: offset 4071 length 5095
* schannel: sending next handshake data: sending 365 bytes...
* schannel: SSL/TLS connection with api.sandbox.paypal.com port 443 (step 2/3)
* schannel: encrypted data buffer: offset 91 length 5095
* schannel: SSL/TLS handshake complete
* schannel: SSL/TLS connection with api.sandbox.paypal.com port 443 (step 3/3)
> POST /2.0/ HTTP/1.1
> Host: api.sandbox.paypal.com
> User-Agent: curl/7.51.0
> Accept: */*
> Content-Length: 203
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------f4cd70d3c58d2816
>
0 203 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
* Done waiting for 100-continue
} [203 bytes data]
* schannel: client wants to read 16384 bytes
* schannel: encdata_buffer resized 17408
* schannel: encrypted data buffer: offset 0 length 17408
* schannel: Curl_read_plain returned CURLE_RECV_ERROR
* schannel: encrypted data buffer: offset 0 length 17408
* schannel: encrypted data buffer: offset 0 length 17408
* schannel: decrypted data buffer: offset 0 length 4096
* schannel: schannel_recv cleanup
* Curl_http_done: called premature == 1
100 203 0 0 100 203 0 92 0:00:02 0:00:02 --:--:-- 92
* Closing connection 0
* schannel: shutting down SSL/TLS connection with api.sandbox.paypal.com port 443
* Send failure: Connection was reset
* schannel: failed to send close msg: Failed sending data to the peer (bytes written: -1)
* schannel: clear security context handle
curl: (56) Send failure: Connection was reset
Any help would be really appreciated.

Specify arbitrary start and end times for cron job

For Quartz Cron, is it possible at all to specify a cronexpression that corresponds to:
Run every 6 minutes, starting from 9:12 AM until 5:37 PM.
I attempted to write the cronexpression 0 12-37/6 9-17 ? * * but this does only runs once an hour. I also understand that the cronexpression 0 /6 9-17 ? * * corresponds to Run every 6 minutes between the hours of 9 AM and 5 PM.
But is there any way to constrain the starting and ending minutes on that cronexpression? More generally, can I specify an arbitrary start and end time with the job in question running every n intervals of time?
You can do it with 3 cron strings:
0 12-59/6 9 * * *
0 /6 10-16 * * *
0 0-37/6 17 * * *
Give them all the same task to run.

Coffeescript: conditional value one-liner

Can this be turned into a snazzy one-liner?
thing = thing2 / 32 * 100 * 100
thing = 0 unless thing
Unfortunately coffeescript doesn't support ternary operator. But you can write:
#zoomGlobal = if #position.ratio then #position.ratio / 32 * 100 * 100 else 0
Or
#zoomGlobal = #position.ratio / 32 * 100 * 100 || #zoomGlobal
Here example
if you are confident that #position.ratio is always set as a number, you could just have:
#zoomGlobal = #position.ration / 32 * 100 * 100
soon you should be able to use the new ** operator
#zoomGlobal = #position.ration / 32 * 100 ** 2
if #position.ration might not exist then use what Ivan suggested:
#zoomGlobal = if #position.ratio then #position.ratio / 32 * 100 * 100 else 0
also, I can't see from your example what the context is but note that
10 / 2 * 2 * 2 == 20
while
10 / (2 * 2 * 2) == 1.25

ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach)

I created a Windows 2003 R2 Virtual Machine running on VirtualBox and I installed Oracle (10201_database_win32).
I assigned a static IP on the Virtual Ethernet too.
Everything worked great right after installation.
I listed(lsnrctl services) the services the listener knew right after installation and the result was:
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 15-JUL-2010 23:02
:19
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:39 refused:0 state:ready
LOCAL SERVER
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1002 state:ready
DISPATCHER <machine: ORACLE10GVM, pid: 760>
(ADDRESS=(PROTOCOL=tcp)(HOST=oracle10gvm)(PORT=1035))
Service "orcl_XPT" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:39 refused:0 state:ready
LOCAL SERVER
The command completed successfully
So I restarted and nothing was working anymore. I executed the same command and here is what I got:
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 16-JUL-2010 21:29:20
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
The command completed successfully
I unistalled/reinstalled 5-6 times and nothing. So I do not quite get what's the problem.
The services are all started and running as far as I checked.
I am out of ideas and time here.
Any suggestions? I checked numerous forums etc with no concrete answer or solution.
I hope someone can help!
Here is the listener.log file:
TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production on 15-JUL-2010 21:56:27
Copyright (c) 1991, 2005, Oracle. All rights reserved.
System parameter file is C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
Log messages written to C:\oracle\product\10.2.0\db_1\network\log\listener.log
Trace information written to C:\oracle\product\10.2.0\db_1\network\trace\listener.trc
Trace level is currently 0
Started with pid=372
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle10gvm)(PORT=1521)))
Listener completed notification to CRS on start
TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN CODE
15-JUL-2010 21:56:30 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=Administrator))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=169869568)) * status * 0
15-JUL-2010 21:56:35 * service_register * orcl * 0
15-JUL-2010 21:57:15 * service_update * orcl * 0
15-JUL-2010 21:57:17 * service_died * orcl * 12537
15-JUL-2010 21:57:19 * service_register * orcl * 0
15-JUL-2010 21:57:22 * service_update * orcl * 0
15-JUL-2010 21:57:25 * service_update * orcl * 0
15-JUL-2010 21:57:46 * service_update * orcl * 0
15-JUL-2010 21:57:55 * service_update * orcl * 0
15-JUL-2010 21:58:14 * service_update * orcl * 0
15-JUL-2010 21:58:17 * service_update * orcl * 0
15-JUL-2010 21:58:23 * service_update * orcl * 0
15-JUL-2010 21:58:26 * service_died * orcl * 12537
15-JUL-2010 21:58:28 * service_register * orcl * 0
15-JUL-2010 21:58:33 * service_update * orcl * 0
15-JUL-2010 21:58:36 * service_update * orcl * 0
15-JUL-2010 21:58:39 * service_update * orcl * 0
15-JUL-2010 21:58:45 * service_update * orcl * 0
15-JUL-2010 21:58:56 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1037)) * establish * orcl * 0
15-JUL-2010 21:58:57 * service_update * orcl * 0
15-JUL-2010 21:58:57 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1038)) * establish * orcl * 0
15-JUL-2010 21:58:57 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1039)) * establish * orcl * 0
15-JUL-2010 21:58:57 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1040)) * establish * orcl * 0
15-JUL-2010 21:59:00 * service_update * orcl * 0
15-JUL-2010 21:59:06 * service_update * orcl * 0
15-JUL-2010 21:59:39 * service_update * orcl * 0
15-JUL-2010 22:00:12 * service_update * orcl * 0
15-JUL-2010 22:00:20 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1046)) * establish * orcl * 0
15-JUL-2010 22:00:21 * service_update * orcl * 0
15-JUL-2010 22:00:23 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\bin\emagent.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1047)) * establish * orcl * 0
15-JUL-2010 22:00:25 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\bin\emagent.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1048)) * establish * orcl * 0
15-JUL-2010 22:00:26 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1050)) * establish * orcl * 0
15-JUL-2010 22:00:28 * ping * 0
15-JUL-2010 22:00:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:00:38 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1054)) * establish * orcl * 0
15-JUL-2010 22:00:39 * log_status * 0
15-JUL-2010 22:00:42 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=169869568)) * status * 0
15-JUL-2010 22:00:45 * service_update * orcl * 0
15-JUL-2010 22:01:08 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1068)) * establish * orcl * 0
15-JUL-2010 22:01:18 * service_update * orcl * 0
15-JUL-2010 22:01:51 * service_update * orcl * 0
15-JUL-2010 22:02:04 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=services)(ARGUMENTS=64)(SERVICE=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521))))(VERSION=169869568)) * services * 0
15-JUL-2010 22:02:05 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:05:28 * ping * 0
15-JUL-2010 22:05:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:05:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1102)) * establish * orcl * 0
15-JUL-2010 22:07:01 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1111)) * establish * orcl * 0
15-JUL-2010 22:07:02 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1112)) * establish * orcl * 0
15-JUL-2010 22:07:03 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1113)) * establish * orcl * 0
15-JUL-2010 22:07:03 * service_update * orcl * 0
15-JUL-2010 22:07:55 * service_update * orcl * 0
15-JUL-2010 22:08:58 * service_update * orcl * 0
15-JUL-2010 22:10:28 * ping * 0
15-JUL-2010 22:10:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:10:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1137)) * establish * orcl * 0
15-JUL-2010 22:11:31 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1141)) * establish * orcl * 0
15-JUL-2010 22:12:31 * service_update * orcl * 0
15-JUL-2010 22:12:56 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1150)) * establish * orcl * 0
15-JUL-2010 22:15:28 * ping * 0
15-JUL-2010 22:15:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:15:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1170)) * establish * orcl * 0
15-JUL-2010 22:16:07 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1173)) * establish * orcl * 0
15-JUL-2010 22:16:53 * service_update * orcl * 0
15-JUL-2010 22:17:04 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=services)(ARGUMENTS=64)(SERVICE=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521))))(VERSION=169869568)) * services * 0
15-JUL-2010 22:17:05 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:19:02 * service_update * orcl * 0
15-JUL-2010 22:20:20 * service_update * orcl * 0
15-JUL-2010 22:20:28 * ping * 0
15-JUL-2010 22:20:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:20:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1199)) * establish * orcl * 0
15-JUL-2010 22:21:14 * service_update * orcl * 0
15-JUL-2010 22:25:28 * ping * 0
15-JUL-2010 22:25:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:25:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1227)) * establish * orcl * 0
15-JUL-2010 22:26:33 * service_update * orcl * 0
15-JUL-2010 22:27:01 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1236)) * establish * orcl * 0
15-JUL-2010 22:27:03 * service_update * orcl * 0
15-JUL-2010 22:30:28 * ping * 0
15-JUL-2010 22:30:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:30:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1259)) * establish * orcl * 0
15-JUL-2010 22:31:07 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1262)) * establish * orcl * 0
15-JUL-2010 22:31:09 * service_update * orcl * 0
15-JUL-2010 22:32:05 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=services)(ARGUMENTS=64)(SERVICE=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521))))(VERSION=169869568)) * services * 0
15-JUL-2010 22:32:06 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:35:22 * service_update * orcl * 0
15-JUL-2010 22:35:28 * ping * 0
15-JUL-2010 22:35:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:35:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1288)) * establish * orcl * 0
15-JUL-2010 22:40:28 * ping * 0
15-JUL-2010 22:40:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:40:34 * service_update * orcl * 0
15-JUL-2010 22:40:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1316)) * establish * orcl * 0
15-JUL-2010 22:42:56 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1329)) * establish * orcl * 0
15-JUL-2010 22:44:56 * service_update * orcl * 0
15-JUL-2010 22:45:28 * ping * 0
15-JUL-2010 22:45:29 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:45:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1345)) * establish * orcl * 0
15-JUL-2010 22:46:08 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1348)) * establish * orcl * 0
15-JUL-2010 22:46:08 * service_update * orcl * 0
15-JUL-2010 22:47:05 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=services)(ARGUMENTS=64)(SERVICE=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521))))(VERSION=169869568)) * services * 0
15-JUL-2010 22:47:06 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:50:20 * service_update * orcl * 0
15-JUL-2010 22:50:28 * ping * 0
15-JUL-2010 22:50:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:50:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1376)) * establish * orcl * 0
15-JUL-2010 22:55:28 * ping * 0
15-JUL-2010 22:55:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:55:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1404)) * establish * orcl * 0
15-JUL-2010 22:55:39 * service_update * orcl * 0
15-JUL-2010 22:58:32 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1423)) * establish * orcl * 0
15-JUL-2010 22:58:32 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1424)) * establish * orcl * 0
15-JUL-2010 22:58:33 * service_update * orcl * 0
15-JUL-2010 22:58:36 * service_update * orcl * 0
15-JUL-2010 22:58:37 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1425)) * establish * orcl * 0
15-JUL-2010 22:58:37 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SID=orcl)(SERVER=DEDICATED)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1426)) * establish * orcl * 0
15-JUL-2010 22:58:37 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1427)) * establish * orcl * 0
15-JUL-2010 22:58:39 * service_update * orcl * 0
15-JUL-2010 22:59:09 * service_update * orcl * 0
15-JUL-2010 22:59:43 * service_update * orcl * 0
15-JUL-2010 23:00:26 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1439)) * establish * orcl * 0
15-JUL-2010 23:00:29 * ping * 0
15-JUL-2010 23:00:29 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 23:00:37 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1445)) * establish * orcl * 0
15-JUL-2010 23:01:07 * service_update * orcl * 0
15-JUL-2010 23:01:08 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1448)) * establish * orcl * 0
15-JUL-2010 23:02:04 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=services)(ARGUMENTS=64)(SERVICE=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521))))(VERSION=169869568)) * services * 0
15-JUL-2010 23:02:05 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 23:02:20 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=Administrator))(COMMAND=services)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=169869568)) * services * 0
15-JUL-2010 23:03:07 * service_update * orcl * 0
15-JUL-2010 23:03:07 * service_died * orcl * 12547
TNS-12547: TNS:lost contact
15-JUL-2010 23:03:08 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\bin\emagent.exe)(HOST=ORACLE10GVM)(USER=OraUser))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1459)) * establish * orcl * 12505
TNS-12505: TNS:listener does not currently know of SID given in connect descriptor
TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production on 15-JUL-2010 23:07:58
Copyright (c) 1991, 2005, Oracle. All rights reserved.
System parameter file is C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
Log messages written to C:\oracle\product\10.2.0\db_1\network\log\listener.log
Trace information written to C:\oracle\product\10.2.0\db_1\network\trace\listener.trc
Trace level is currently 0
Started with pid=1552
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle10gvm)(PORT=1521)))
Listener completed notification to CRS on start
TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN CODE
15-JUL-2010 23:08:17 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1030)) * establish * orcl * 12514
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor
15-JUL-2010 23:08:18 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1032)) * establish * orcl * 12514
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor
I have some vague recollections of Oracle databases needing a bit of fiddling when you reboot for the first time after installing the database. However, you haven't given us enough information to work on. To start with:
What code are you using to connect to the database?
It's not clear whether the database instance has been started. Can you connect to the database using sqlplus / as sysdba from within the VM?
What has been written to the listener.log file (in %ORACLE_HOME%\network\log) since the last reboot?
EDIT: I've now been able to come up with a scenario which generates the same error message you got. It looks to me like the database you're attempting to connect to has not been started up. The example I present below uses Oracle XE on Linux, but I don't think this makes a significant difference.
First, let us confirm that the database is shut down:
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jul 17 18:16:43 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
It's the text Connected to an idle instance that tells us that the database is shut down.
Using sqlplus / as sysdba connects us to the database as SYS without needing a password, but it only works on the same machine as the database itself. In your case, you'd need to run this inside the virtual machine. SYS has permission to start up and shut down the database, and to connect to it when it is shut down, but normal users don't have these permissions.
Now let us disconnect and try reconnecting as a normal user, one that does not have permission to startup/shutdown the database nor connect to it when it is down:
SQL> exit
Disconnected
$ sqlplus -L "user/pw#(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=XE)))"
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jul 17 18:16:47 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12505: TNS:listener does not currently know of SID given in connect
descriptor
SP2-0751: Unable to connect to Oracle. Exiting SQL*Plus
That's the error message you've been getting.
Now, let's start the database up:
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jul 17 18:17:00 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 805306368 bytes
Fixed Size 1261444 bytes
Variable Size 209715324 bytes
Database Buffers 591396864 bytes
Redo Buffers 2932736 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Now that the database is up, let's attempt to log in as a normal user:
$ sqlplus -L "user/pw#(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=XE)))"
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jul 17 18:17:11 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL>
We're in.
I hadn't seen an ORA-12505 error before because I don't normally connect to an Oracle database by entering the entire connection string on the command line. This is likely to be similar to how you are attempting to connect to the database. Usually, I either connect to a local database, or connect to a remote database by using a TNS name (these are listed in the tnsnames.ora file, in %ORACLE_HOME%\network\admin). In both of these cases you get a different error message if you attempt to connect to a database that has been shut down.
If the above doesn't help you (in particular, if the database has already been started, or you get errors starting up the database), please let us know.
EDIT 2: it seems the problems you were having were indeed because the database hadn't been started. It also appears that your database isn't configured to start up when the service starts. It is possible to get the database to start up when the service is started, and to shut down when the service is stopped. To do this, use the Oracle Administration Assistant for Windows, see here.
I Changed Sid Value to orcl, it works fine and connection established
You could try this.
In windows go to Administrative Tools->Services And see scroll down to where it says Oracle[instanceNameHere] and see if the listener and the service itself are running. You might have to start it. You can also set it to start automatically when you right-click on it and go to properties.
Give hibernate.connection.url as "jdbc:oracle:thin:#127.0.0.1:1521:xe" then you can solve above issue. Because oracle's default SID is "xe" so we should give like this. When I gave like this data has been inserted into DB without any SQL exceptions, it's my real time experience.
The following worked for me (Windows 7):
oradim -shutdown -sid enter_sid_here
oradim -startup -sid enter_sid_here
(with enter_sid_here replaced by the SID)
Start oracleserviceorcl service. (From services in Task Manager)
Set ORACLE_SID variable with orcl value. (In environment variables)