# Oracledb\_session

**URL:** <https://discourse.chef.io/t/oracledb-session/10908>\
**Category:** Chef InSpec\
**Created:** [May 16, 2017, 1:55pm UTC](https://discourse.chef.io/t/oracledb-session/10908 "2017-05-16T13:55:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhanukiran](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@Bhanukiran](https://discourse.chef.io/u/Bhanukiran)\
**Post date:** [May 16, 2017, 1:55pm UTC](https://discourse.chef.io/t/oracledb-session/10908/1 "2017-05-16T13:55:41Z")

</div>

I am trying the following code, but its not working for me. Inspec version 1.24.0. HELLODB database up & running.

tnsping HELLODB

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 16-MAY-2017 08:48:31

Copyright © 1997, 2013, Oracle. All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias  
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = xxxx)(PORT = 9101)) (CONNECT\_DATA = (SERVER = DEDICATED) (SERVICE\_NAME = HELLODB)))  
OK (10 msec)

describe oracledb\_session(user: ‘system’, pass: ‘test123’, sid: ‘HELLODB’, sqlplus\_bin: ‘/u00/app/oracle/product/11.2.0.4/database/bin/sqlplus’).query(‘SELECT NAME FROM v$database;’) do  
its(‘stdout’) { should eq(‘HELLODB’) }  
end  
end

I am getting following error.

```
× Command echo "SELECT NAME FROM v$database;" | /u00/app/oracle/product/11.2.0.4/database/bin/sqlplus -s system/test123@localhost/HELLODB stdout should eq "HELLODB"

 expected: "HELLODB"
      got: ""

 (compared using ==)

```

Please help me.

Thanks  
Bhanu

---

<div class="post-metadata">

**Author:** ![Bhanukiran](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@Bhanukiran](https://discourse.chef.io/u/Bhanukiran)\
**Post date:** [May 16, 2017, 2:57pm UTC](https://discourse.chef.io/t/oracledb-session/10908/2 "2017-05-16T14:57:56Z")

</div>

Its actually taking wrong connection string “localhost/HELLODB” instead of just “HELLODB”.  
I think its inspec code issue.

- Bhanu

---

<div class="post-metadata">

**Author:** ![adamleff](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/adamleff/32/1097_2.png) [@adamleff](https://discourse.chef.io/u/adamleff)\
**Post date:** [May 16, 2017, 8:40pm UTC](https://discourse.chef.io/t/oracledb-session/10908/3 "2017-05-16T20:40:37Z")

</div>

Hi Bhanu. I believe you posted about this same issue in the #inspec slack channel, to which you received a reply but we didn’t hear back from you.

This sounds like it may be a bug, so I’d like to ask that you log a GitHub issue for it and provide as much information as you can to assist in troubleshooting. You can find the link here: [https://github.com/chef/inspec/issues/new](https://github.com/chef/inspec/issues/new)

Thanks!  
~Adam

---

<div class="post-metadata">

**Author:** ![Bhanukiran](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@Bhanukiran](https://discourse.chef.io/u/Bhanukiran)\
**Post date:** [May 17, 2017, 10:18am UTC](https://discourse.chef.io/t/oracledb-session/10908/4 "2017-05-17T10:18:17Z")

</div>

Thanks Adam,

I raised issue.  
Ticket details: Inspec oracledb\_session resource not connecting to the database. #1821

Thanks  
Bhanu
