-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do you connect to a Net Service instead of a SID? #131
Comments
If you have access to your
and then
Your connection should then just be
When you do not have access to tnsnames.ora modification, you can set
|
Oh, right, (Sorry for the basic questions, I'm an Oracle dilettante keeping Sqitch working on Oracle.) |
If you have the DBI->connect('dbi:oracle:sid=conn_name') |
Tonight I properly noticed this bit from the docs:
And now I feel like a right idiot. So I started modifying URI::oracle in URI::db to have it preferentially generate EZCONNECT URLs and fall back on DBI-style key/value pairs only when there are query parameters in the URL, figuring anyone needing to use a SID could put it in the query. But then I got to thinking: what if someone needs query params when connecting to a service name? Is that supported? Does this work? DBI->connect('dbi:Oracle://example.com:1522/pdb1:SERVER=POOLED') Doesn't seem like it would. A DBI->connect('dbi:Oracle:host=example.com:port=1522:service_name=pdb1:SERVER=POOLED') Does that make sense? |
Does DBD::Oracle support "Easy Connect Plus" syntax? https://download.oracle.com/ocomdocs/global/Oracle-Net-19c-Easy-Connect-Plus.pdf
|
That's what the docs say, and they show this example: $dbh = DBI->connect("dbi:Oracle://myhost:1522/ORCL",'username', 'password'); But I don't understand how it can work with other params, unless they're required to be passed in the options instead of the DSN? Something like $dbh = DBI->connect("dbi:Oracle://myhost:1522/ORCL",'username', 'password', {
ora_server => 'POOLED',
}); If all params aside from |
That is the (original) Easy Connect syntax without the additional 19c optional ?/& syntax. My DBD::Oracle VM is AWOL so I can't quickly check this newer syntax. |
I have often used a SID to connect, but apparently Oracle 12c and later added support for Net Services, which are also named, but not by
sid=$name
. I learned of this fact in this comment. Any pointers for how to connect using a net services name instead of a SID? Will be happy to contribute a documentation PR if appropriate.The text was updated successfully, but these errors were encountered: