Setting up database link from Oracle to Sybase - oracle

I know so little about Sybase that I don't even know whether database link is the correct term in Sybase. What I'm looking for is a way to communicate with Sybase over Oracle's heterogeneous services, commonly called a database link in Oracle (linked server if you speak SQL Server).
We are a primarily Oracle shop with a healthy dose of SQL Server, but zero Sybase experience. As you might guess, we have a piece of software that happens to run on Sybase, and we need to get information out of its database.
Professional services from the software vendor have not been helpful at all; frankly, we don't even know if they gave us the correct driver.
Our Oracle DBA is as sure as he can be (without knowing anything about Sybase) that he has everything set up correctly on the Oracle side.
When we try to run a query from Oracle to get data from Sybase, we get:
select * from call_request#sybase
*
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[SAP][ASE ODBC Driver][Adaptive Server Enterprise]Incorrect syntax near the
keyword 'where'.
{ZZZZZ,NativeErr = 156}
ORA-02063: preceding 3 lines from SYBASE
Complaining about syntax near "where" doesn't make much sense, since there is no predicate at all. And it doesn't help to add a dummy
where 1=1
We're completely unsure where to turn. What can we even check next? Where is the documentation for setting this sort of thing up? Any ideas what is wrong?

Related

Database note taker Oracle db

I'm trying to find a tool that will help me to build a documentation for a database.
I need to write comment on column / table and to have a summary of data flow that creates/modifies data and most important, at a conceptual level what data means. I'm also looking for a free tool
After a long search, I found out http://databasenotetaker.com/ which seems to be suitable for my purposes.
My database is Oracle.
From the documentation they say it potentially support every database but I can't connect to Oracle.
I don't know how to specify the driver in the connection window:
According to their documentation
**
Can Database Note Taker connect to other database platforms?
**
Yes and we will add support for other platforms in the future. So long as it's a relational database and there are freely available connectors, then Database Note Taker will be able to work with it. Out of the box you can connect to Microsoft Sql Server, and MySql via ODBC."
Out of the box you can't connect to Oracle, therefore you need a driver. Check with them to understand which driver they mean when they said "freely available connectors". Out-of-the-box in this context refers to the drivers that appear in the selection list.
My advice: Ask them which kind of driver do you need. If standard ODBC is ok, you must download the ODBC driver from Oracle.
https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html
Important Check whether this product supports 64 bits or it is 32, in order to select the right ODBC driver.

How to replicate existing OracleRDB ODBC connection in Oracle's SQL Developer application?

I am new to Oracle database in general, but I'm attempting to get Oracle's SQL Developer running on a workstation that has pre-configured System DSNs created for an OracleRDB database. I've confirmed the ODBC connections are working because I can use MS Access to connect and link to the tables. The "test" options within ODBC also succeed. Now I am trying to get a similar connection created using SQL Developer so I can see the column types and write queries in a more useful editor.
Here's what I have available when examining the ODBC connection properties:
Now I'm trying to create a duplicate connection in SQL Developer, but I'm at a loss for why things don't work. I first tried using the default SQL Developer installation, but couldn't get things working. Then I discovered there's an OracleRDB extension available, so I installed that, but I keep getting this error when attempting to use similar values:
As I stated, these ODBC connections were pre-configured on the workstation I'm using, so I don't know anything more than what is provided by the Oracle ODBC driver window.
Is there something obvious I'm not seeing or doing to replicate this connection in SQL Developer? Or perhaps something else I can do to debug this to learn more?
UPDATE
On the advice of one answer I'm trying to make the connection with JDBC, but having a hard time understanding what I'm doing wrong. Here's another screenshot with the connection parameters I have available, but with the server and database names changed:
With these values (the port came from my tnsnames.ora file), if I try to make a JDBC connection I keep getting the following error from SQL Developer:
One final attempt I did was to use the proper values in the Oracle RDB tab, and when I use them and click 'test' the Testing Connection dialog just spins and never seems to return:
So I apologize for the long post here, but I'm struggling because there's just something I am really not understanding about how this all works. I appreciate everyone who took the time to read this question.
Oracle SQL Developer is a Java Application. You'll need to get the JDBC Driver for RDB.
Once you have that, in the SQL Developer preferences, find the Third Party JDBC section, and then use that to add an entry and point to the JAR for what you just installed.
Step by step instructions here.
Working connection string for RDB Thin Driver:
RDB_DB_CONN_STR = "jdbc:rdbThin://node.myplace.com:1707/";
where node.myplace.com is the name of the OpenVMS node hosting the RDB Thin Driver, 1707 is the port number assigned to the RDB Thin Driver.

How to retrieve Oracle server collation in order to set up linked server

After searching here and on the web, I finally decided to post the question. I am running an SQL 2000 server, and linked an Oracle 9i server. Everything works fine when I run queries, and even updates and inserts from and to the Oracle Linked server (using both Microsoft OLE DB driver and Oracle OLE DB driver) using the OPENQUERY approach.
The problem is that, in order to clean code a bit, I want to use four part names in my queries. I am doing this also when querying other SQL linked servers.
But when I run the queries against Oracle using four part names I get this error: ( I am translating the error message from spanish. Probably the original message in english id different)
ERROR: OLE DB 'MSDAORA' returned an invalid column definition.
Error Code: 7318
Digging a bit, I learned that this is probably related to nos having the right collation name set in the linked server properties.
Now... I am not an Oracle expert, so I need to find out what collation is the schema I connect to using in Oracle (apps... yes, I know, I know... )
So, the plain question is... How do I find out what collation Oracle is using? I have access to the Oracle server via Toad... is there any query I can run in order to find this out?
Thanks!
I think you're looking for the NLS settings, which you can find from these views:
V$NLS_PARAMETERS — "Current values"
NLS_DATABASE_PARAMETERS — What the database was created with.
NLS_INSTANCE_PARAMETERS — From changes by ALTER SYSTEM
NLS_SESSION_PARAMETERS — Combined, plus ALTER SESSION
V$PARAMETER — System parameters, where a lot of this is changed (contains all kinds of stuff)
The documentation is rather lacking here (or, quite likely, I couldn't find the right document), but this should get you what you want.
You will probably have to log in as SYSDBA to read some of these views.

SQL Plus and www.apex.oracle.com

Does the SQL syntax differ in any way for SQL Plus and apex.oracle.com
From this article I can assume that it doesn't, but I want to be sure. Is SQL Plus only an environment that is able to connect to an Oracle server ?
I'm asking this because I just started learning Oracle's SQL syntax and I don't have access to my faculty's server from home. The only solution I found so far is Apex since I'm not planning to install a server on my laptop.
Is SQL Plus only an environment that
is able to connect to an Oracle server?
Yes, SQL*Plus is not very useful unless you can connect to an Oracle database server.
I'm asking this because I just started
learning Oracle's SQL syntax and I
don't have access to my faculty's
server from home. The only solution I
found so far is Apex since I'm not
planning to install a server on my
laptop.
If you cannot connect to your faculty's database server from home, you have no choice but to install your own server somewhere. Apex only runs on an Oracle database server.
However, it's not too difficult nowadays, as long as you follow the installation instructions carefully.
Another option is to get a free account at apex.oracle.com. You'll be able to use Apex's SQL interface. I don't think you can connect to it using SQL Developer, though.
Alternatively, you can start up a simple pre-prepared Apex instance on Amazon's EC2. With this option, if you open the relevant port (1521) you'll be able to connect to it using SQL Developer.
The SQL commands are identical. They are all passed directly to the database engine for execution.
SQL*Plus has a bunch of extra commands (mostly for formatting output, but also stuff like dealing with variables and database startup/shutdown).
[Very old versions of SQL*Plus from the Oracle 7 era don't recognize the MERGE command as SQL and would refuse to do anything with it. But I'd hope those versions are all dead and buried by now.]
SQLPlus commands are to manage the SQLPLus environment and have really nothing to do with SQL. They are mostly for formatting output or taking in data that is used with SQL to send to the server.
SQLPlus is a proprietary Oracle product for connecting to Oracle server and issuiung commands. It is being replaced (officially) by SQL Developer.
I strongly suggest you download the free SQL Developer program from oracle:
http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
it's a great tool for working with sql, pretty easy to get started (install, create a new db connection and start typing sql_ plus does fill in for columns once it know the tablenames.
Also, it can run most sqlplus commands if you want to format output, etc.
A nice visual intro to the oracle schema and useful if you want to write plsql.

How do I browse databases on an Oracle Server?

So I'm coming from a position as a SQL Server developer who has written a little bit of PL/SQL way back in the mists of time but effectively knows nothing.
I've got a laptop, it's running Oracle. There is a database on the laptop which I need to have a look at and neither I, nor anyone else I can speak to, knows what it's called.
I have a couple of logins including one which alleges to be an Admin login.
What's the easiest way to browse the databases on the server and then connect to one?
I suspect that my assumptions about relationships between servers, users and databases from SQL Server are leading me astray but right now I can't get past idea that the client tools Oracle ships are someone's idea of a joke but I'm really not finding it that funny.
I'm pretty sure that it's version 9.2 that's running.
Happy to provide more information but right now I don't know where to start.
If this is windows look in the services. Each database will have a separate service. By default these are named OracleServiceDATABASENAME.
You may be able to connect with just this information on the default port 1521.
If that does not work open the properties of that service you can find the location of the oracle home. The default place to keep your connection information in the ORACLEHOME\network\admin\tnsnames.ora . Using the database name you can find your connect information in this file.
If this is linux/unix look in the /etc/oratab file. This should have the database name and oracle home listed. The default location of the tnsnames.ora file is the same as on windows.
Once you have this information you can use any of the tools mentioned above to connect to the database.
I don't know what qualifies as "easiest" in your book. I'm moderately fond of Aqua Data Studio (www.aquafold.com); it's nice & visual & pretty & all. It's also Not Cheap, but might be worth a 2-week evaluation to see if it does anything helpful for you. I'm not an expert on this, and I joined an Oracle-based group from a SQL Server background; that's the tool they were using at the time, and I've found it extremely usable. But that's just me. Good luck.
Check out Oracle SQL Developer. (It's free)
I'm not a SQL Server expert, but there are differences in terminology.
An Oracle "Instance" is a single entity of the Oracle software. A database is the actual logical data that the instance serves. You may have multiple instances of the Oracle database software running against one database (This is considered a RAC setup); or just one instance running against one database.
I'm assuming what you mean by database here is actually the different schemas/users/tablespaces/procedures etc. that you have within an Oracle database. In that case, Oracle SQL Developer should do the job nicely.
If you are able to utilize Enterprise Manager (this is a licensed option), it provides this functionality as well, though it is more cumbersome than SQL Developer IMHO. EM does provide many other tools for providing a general overview of your Oracle instance health, alerts, and many things used to help tune the performance of your Oracle instance.
In Windows, the following command lists running database services:
net start | findstr -i ora
In Unix/Linux, grepping for the Oracle SMON process will give you the names of running databases:
ps -ef | grep smon

Resources