Skip to Main Content
  • Questions
  • swingbench datagenerator connect string

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Aijaz.

Asked: April 06, 2017 - 9:31 am UTC

Last updated: April 07, 2017 - 5:25 am UTC

Version: 12c

Viewed 1000+ times

You Asked

I need to use [swingbench][1] to quantify performance of a given host. However since I am pretty new to Databases as such cannot get the [datagenerator][2] program to connect to an Oracle DB instance that has been "opened" on the host.

After installing Oracle 12c on the host (and creating a DB along with it), I am starting the DB as such

For the very first time, I was facing issues starting the DB since the initialization file was not present. So I had to create a 'pfile' from an existing 'spfile' which I found present at $ORACLE_HOME

<
SQL> CREATE PFILE = full path to init.ora FROM SPFILE = full path to existing spfile.ora;
>

After that I start the DB which '*mounts*' and '*opens*' the database.
<
SQL> startup
ORACLE instance started.

Total System Global Area 2421825536 bytes
Fixed Size 2291232 bytes
Variable Size 654313952 bytes
Database Buffers 1744830464 bytes
Redo Buffers 20389888 bytes
Database mounted.
Database opened.
>
The relevant details from my DB are:
<
SQL> SELECT sys_context('USERENV', 'SID') FROM DUAL;

SYS_CONTEXT('USERENV','SID')
--------------------------------------------------------------------------------
355

SQL>
SQL> select sys_context('userenv','instance_name') from dual;

SYS_CONTEXT('USERENV','INSTANCE_NAME')
--------------------------------------------------------------------------------
db1

SQL> select sys_context('userenv', 'server_host') from dual;

SYS_CONTEXT('USERENV','SERVER_HOST')
--------------------------------------------------------------------------------
oracle_12c
>
My hostname is:
<
oracle_12c.localdomain
>
Now when I try to test the connection from the datagenerator to this database (P.S. from the same host on which the DB is installed), I always get an error. I've tried using both the *service-name* (or is it called the *instance name*??) as well as the SID methods of connection as described [here][3]. SO on trying using the 'thin style service name syntax' my connect string is:
<
//oracle_12c.localdomain:1521/db1
>
My error is an IO error saying connection couldn't be established without giving out much.

I've tried the 'thin style SID syntax' like so:
<
//oracle_12c.localdomain:1521:355
>
which gives me a similar error without telling much.

The exact error is "Can't connect using parameters supplied : IO Error : Network adapter couldn't establish the connection"

With these details could anyone help me craft a proper connect string to use with datagenerator? Also is there a file on which I can `tail -f` on the host that will point me where exactly it is failing?

ALso I presume that the `listener` does NOT come into the picture for locally originating requests?? Is that true? So does it mean that `listerner.ora` need not be configured for such requests?

[1]: http://dominicgiles.com/swingbench.html
[2]: http://dominicgiles.com/datagenerator.html
[3]: http://stackoverflow.com/questions/4832056/java-jdbc-how-to-connect-to-oracle-using-service-name-instead-of-sid

and Connor said...

I'm not a jdbc expert, but I think you'll need a listener.

Run "netca" (or from Windows, Net Config Assistant).

Get a listener running on port 1521 (the default). The database will automatically register with it.

Then //oracle_12c.localdomain:1521/db1 should work ok.

Is this answer out of date? If it is, please let us know via a Comment