Insights into debugging the DBD::ERROR: OCIServerAttach with Rose::DB 0.754

194 views
Skip to first unread message

llama

unread,
Sep 30, 2009, 3:30:47 AM9/30/09
to Rose::DB::Object
All,

I've been using Rose::DB 0.753 for the past month and have never faced
issues on my dev box.
My Dev machine had Perl 5.10.0 and Rose::DB 0.753, DBI 1.602,
DBD::Oracle 1.20

Now I'm deploying the new scripts to production setup and installed
perl 5.8.8, DBI 1.609, DBD::Oracle 1.23 and Rose::DB 0.754.

I have updated by Rose class with DB parameters, but I'm not able to
connect to the database.

I get the below error when I execute the Perl script:

DBI connect('sid=A2p300;host=A2p300.abc.com','fake!2',...) failed:
ORA-12541: TNS:no listener (DBD ERROR: OCIServerAttach) at /willows/
sac/software/perl/lib/site_perl/5.8.8/Rose/DB.pm line 898.

To confirm the above error, I wrote a simple script using DBI and
DBD::Oracle and was able to
successfully connect and insert data into the database. Looks like an
issue on the Rose::DB side or any other DBI/DBD modules ?


Below is the entry in tnsnames.ora for the database:

A2p300 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (COMMUNITY = A2p300)(PROTOCOL = TCP)(HOST =
A2p300.abc.com)(PORT = 7100))
)
(CONNECT_DATA =
(SID = A2p300)
(GLOBAL_NAME = A2p300.abc.com)
)
)


Below is by RDB class with connection parameters:

package ABC::RDBO::RDB;

use warnings;
use strict;
use base 'Rose::DB';

__PACKAGE__->use_private_registry;
__PACKAGE__->register_db(
domain => 'production',
type=> 'main',
driver => 'Oracle',
database => 'A2p300',
host => 'A2p300.abc.com',
username => 'fake!2',
password => 'fake!2',
port => 7100,
connect_options =>
{
FetchHashKeyName => 'NAME_lc',
RaiseError => 1,
AutoCommit => 1,
ChopBlanks => 1,
}

);

__PACKAGE__->default_domain('production');
__PACKAGE__->default_type('main');

1;


Please help me in fixing this issue, I have very much less time, to
set this up on our production servers.

Thank you for your help.

llama

unread,
Sep 30, 2009, 5:39:59 AM9/30/09
to Rose::DB::Object
On digging further, I have printed the options passed to $DBI->connect
(@_) on line 898 in perl/lib/site_perl/5.8.8/Rose/DB.pm and found that
the port number is not there in the "DSN".

I checked the sqlnet.log and found that the Rose modules are trying to
connect to default port of 5121 instead of the specified port of 7100.

I added "port=7100" to the $dsn part and I was able to connect to the
database.

Did I hit on a bug in Rose::DB ? Is there any elegant way to fix
this.?

Regards

llama

unread,
Sep 30, 2009, 6:01:57 AM9/30/09
to Rose::DB::Object
Finally I have added the dsn string along with the port to my RDB.pm
and it works with the below format.
However the port number with the earlier format (listed in first post)
doesn't work.

package ABC::RDBO::RDB;
use warnings;
use strict;
use base 'Rose::DB';
__PACKAGE__->use_private_registry;
__PACKAGE__->register_db(
domain => 'production',
type=> 'main',
driver => 'Oracle',
dsn => 'dbi:Oracle:sid=A2p300;host=A2p300.abc.com;port=7100',
username => 'fake!2',
password => 'fake!2',
connect_options =>
{
FetchHashKeyName => 'NAME_lc',
RaiseError => 1,
AutoCommit => 1,
ChopBlanks => 1,
}
);
__PACKAGE__->default_domain('production');
__PACKAGE__->default_type('main');
1;

Thanks

John Siracusa

unread,
Sep 30, 2009, 9:32:52 AM9/30/09
to rose-db...@googlegroups.com
On Wed, Sep 30, 2009 at 6:01 AM, llama <shob...@gmail.com> wrote:
> Finally I have added the dsn string  along with the port to my RDB.pm
> and it works with the below format.
> However the port number with the earlier format (listed in first post)
> doesn't work.

Good catch. This should be fixed now in SVN.

-John

Reply all
Reply to author
Forward
0 new messages