ODBC and Oracle!!! - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

crazypit
Posts: 9
Joined: Thu Jul 10, 2008 10:41 am

ODBC and Oracle!!!

Hello all,

I try for 2 days now to run a SQL Script against an Oracle database but everything i do just fails! The documentation is very weak on this subject. My last hope is this forum.

I use Oracle Instant Client as a part of my installation. Everything goes fine. The ODBC Driver is installed with the name "Oracle in instantclient11_1". I added a TNS_ADMIN environmental variable to point to the relevant folder. If i test the driver using a DSN, everything works ok. If i run AI, i always get a ORA-12560:TNS:Protocol Adapter Error.

Now, through AI i tested two options.
The first is to use directly the aforementioned ODBC Driver. So i make a new connection. The form there, is way underdocumented! What should i put in the field "Server"??? Is this the Local Service Name defined in the tnsnames.ora file to which my TNS_ADMIN variable points? Is this the Server Service Name??? Or maybe the Host of the database? The Port field i can understand if the Server points to Host... And what is the thing with the Database field for an Oracle DB??? (Not to mention the "Create Database if not exists check item....")

The second is to use a DSN that is defined using the aforementioned Driver. I tested a DSN using the Driver and took a note of all the required attributes that should be defined from the Registry. So i set a ServerName, a UserID, a Password. If i test the DSN when the error raises, everything is ok! Its present in my system, and the testing of connection is ok. Of course, the documentation mentions that i should put values for Server, Port and Database!!! Why should i need these values when the DSN requires the Local Service Name to connect????

Anyway, the thing is really a mess. There should be a complete tutorial for all major databases. Any help will be greatly appreciated....
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: ODBC and Oracle!!!

Hello,

is it perhaps possible to create a script that starts a scriptable ORACLE shell (like "mysql"(.exe) in case of MySQL) with all necessary parameters? You could then run that script as part of the installation.



Bye bye

clemens
crazypit
Posts: 9
Joined: Thu Jul 10, 2008 10:41 am

Re: ODBC and Oracle!!!

Can't do that. Instant Client installation does not have any consoles or command-line tools...
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: ODBC and Oracle!!!

crazypit wrote:Can't do that. Instant Client installation does not have any consoles or command-line tools...
Can you ship whatever necessary along with the installer perhaps (possibly as temporary files - if they are only needed at installation)?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: ODBC and Oracle!!!

Hi,
What should i put in the field "Server"???
In this field you need to specify the database server host name. Since you are using an Oracle SQL Server, you can set this field to OracleServer. Please note that this is mentioned in the Predefined SQL Connection article in the help.
what is the thing with the Database field for an Oracle DB??? (Not to mention the "Create Database if not exists check item....")
The "Database" field must be set to the name of the database you want to use in the connection. Also, the "Create database if it does not exist" option will make the installation create the database if it doesn't exist (so you can connect to it). Please note that the "Database" field is also explained in the help.
the documentation mentions that i should put values for Server, Port and Database!!! Why should i need these values when the DSN requires the Local Service Name to connect????
Please note that Advanced Installer doesn't use a DSN to connect. Therefore, the connection created by Advanced Installer requires some of the information you would put in a DSN and other information required to connect to the ODBC driver. Therefore, when you develop the installation package you need to make sure that you set correct parameters for the SQL connection.

Usually these parameters are set by the user through the "SQLConnectionDlg" dialog. This dialog contains edit boxes which are associated with installer properties. These properties can be used for the SQL connection instead of hard-coded values. In order to better understand this mechanism please see the SQL Script tutorial in the User Guide.

If you want to use your DSN for the connection, you can follow these steps:
- make sure that the information in the DSN is written in the registry (for example you can use a custom action)
- use searches to set installer properties to the values in the registry
- use these properties in the SQL connection

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
crazypit
Posts: 9
Joined: Thu Jul 10, 2008 10:41 am

Re: ODBC and Oracle!!!

1). The help file mentions to use "OracleServer" only when the target machine is also the host of the database...
2). "Database" in Oracle??? Sure! Oracle do not have "Databases"!! It has Users where all db objects belong to. So, i should put there what?? The User Name?? And the script will create the Oracle User??? I dont really think so!!! Have you ever REALLY used what you propose against an Oracle Database?
3). The documentation says: "Specify the name of the database you want to use.If the database doesn't exists you have the option to create it." Ok...For an Oracle database, this line is completely out of order...
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: ODBC and Oracle!!!

Hi,
The help file mentions to use "OracleServer" only when the target machine is also the host of the database...
Note that if the target machine is not the host, then the "Server" field should be set to the host name. Also, this field should contain the instance name.
"Database" in Oracle??? Sure! Oracle do not have "Databases"!!
Please note that the predefined SQL connection covers all possible SQL connections. Therefore, there are some fields which you may not use in your connection. For example, since you are connecting to an Oracle server the "Database" field can be empty.

Although I'm not sure if it will work, you can try to use your DSN as a data source in your project (the DSN can be added in the Files and Folders page). Note that the attributes in the DSN don't need to be specified in the SQL connection (except the username and the password).

Also, please make sure that the server is configured correctly and it can accept connections made by an installation. Perhaps you will find these links useful:
http://forums.oracle.com/forums/thread. ... dID=362448
http://dba.ipbhost.com/lofiversion/index.php/t2747.html
http://forums.oracle.com/forums/thread. ... &tstart=-1

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
crazypit
Posts: 9
Joined: Thu Jul 10, 2008 10:41 am

Re: ODBC and Oracle!!!

Hi,

The cornerstone of connecting to an Oracle database is the Service Name or Service ID. Without this value, there is no possibility to connect. Every seasoned Oracle user knows that. You also need a Host and a Port along with User - Password. The Service Name or Service ID along with the Host and the Port, can be configured in a special txt file called tnsnames.ora where a Local Service Name is created.

For what you said so far, the Service Name is not configured anywhere, neither by using ODBC Driver or ODBC DSN. Its no use to provide only Host, Port and User Credentials. Therefore, i dont expect for this to work.

Nevertheless, its easy to test a solution and finally provide a complete Tutorial for it. For now, the documentation and relative forms are completely useless for an Oracle connection. Until then, ill just use something else or wait...

Thanks for your concern.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: ODBC and Oracle!!!

Hi,

Usually the service name is specified through the instance name. Since the "Server" field allows you to specify the instance name, most likely you can create the connection (this depends on the way the server is configured). For example, the "Server" field can be set to:

Code: Select all

MyOracleServer.myInstance
Where "MyOracleServer" is the host name and "myInstance" is the name of the instance (service name). You can read more about this here:
http://www.codeproject.com/KB/database/ ... rings.aspx
http://www.sqlstrings.com/Oracle-connection-strings.htm
its easy to test a solution and finally provide a complete Tutorial for it.
I have added this documentation improvement on our TODO list and the tutorials will be available in a future version of Advanced Installer. Thank you for your suggestion.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”