crontab oracle problem in linux - database

I created an app which is need to run in linux started by crontab. An error happened when it tried to connect oracle database: it returned SQLO_INVALID_DB_HANDLE. But if started it manually everything is okay.
I bet there are no path-related mistakes here, because everything goes well except the connection to the Oracle database. Oracle8 functions are used in my code.
thanks

Oracle uses a couple of environment variables, like ORACLE_HOME, TNS_HOME, ORACLE_SID. They might be missing from your crontab environment.

Related

Vim dadbod configuring adapters

I'm trying to configure the plugin dadbod (https://github.com/tpope/vim-dadbod) and must confess I don't know vimscript well enough to comprehend the code :(
I'm stuck on configuring the database adapters. Irrespective of what URL I try, I just get the message
DB: no adapter for SQL Server.
I've also tried SQLite and Postgres with the same results.
In the WIKI, there's a statement: Supports a modern array of backends - which makes me think I haven't configured "the backend" perhaps? I have the jdbc SQL Server driver installed, and set a JAVA_HOME environment variable which works fine with DBeaver and with Azure Data Studio.
I haven't been able to find anything on the web about how to configure dadbod beyond the command structure. Am I missing something obvious about how the plugin works?
Your help greatly appreciated!
The vim-dadbod plugin was definitely not installed correctly. I did a clean install of Vim, then installed the package manager Vundle. Following Vundle's instructions I was able to install vim-dadbod.
I'll be posting a followup later, but the issue is no longer the plugin itself!

All the services of Oracle 18c aren't installing. couldn't connect to Sql plus

I tried almost all the articles there is on this error. But in my case the services aren't installed. So i can't change them. I had 10g installed before but i needed to use Oracle for python too so I removed that. And also i did reset my pc(keep my files) after that. But now i have tried multiple times to install Oracle 18c but not working.
I.e modifying listener and sqlplus sys/mypassword as sysdba or many more.
These are the screenshots.
This is very frustrating. Any suggestions? Also What is the alternative for homepage of 10g in 18c.
I also tried running setup.exe from zip folder directly. But no luck.
Your screen shots clearly show that the services are indeed installed, your assertion otherwise notwithstanding. You even have sqlplus waiting to do your bidding. But you invoke it incorrectly.
The protocol error (ora-12560) occurs when 1) you do not specify a connect string when you invoke sqlplus thus causing it to try to connect to a local database specified by the environment variable ORACLE_SID, and 2) the environment ORACLE_SID does not specify an actual local database.
Unfortunately, your screen shot does not show how you invoked sqlplus, thus losing important diagnostic info. Far better to start cmd.exe, invoke sqlplus, then copy the entire text and paste that into your question, with formatting. I leave it as an exercise for the student to research how to do those elementary tasks.

installing PostgreSQL on Cygwin as a service

I'm a novice trying to install Postgresql on Cygwin as a service. I have been following the steps listed in this URL: http://www.smartpixie.com/wiki/Tech/CygwinPostgreSQL.twiki.html
Everything was working fine until I got to the step where I had to create a user and a database for myself, in my /usr/sbin directory the "createuser" file exists but the "createdb" file does not. So, as suggested by the steps, I attempted to connect to the database as the SYSTEM user and then create the database/user roles later. However, I come across this error whenever I try to connect to the database.
$ psql -U SYSTEM postgres
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Any help is appreciated, thanks.
First, I would recommend against running PostgreSQL over Cygwin. There isn't a real use case I can see since there is now a native port and Cygwin ends up adding quite a bit of overhead to things like IPC calls. You won't get good performance out of it, and I can't actually think of any case where cygwin would be a better fit than mingw for c-language stored procedures. So please question whether this is really a requirement and explore other options first.
Now if you still need to do so, the process isn't easy, but is documented at http://www.postgresql.org/message-id/3DC76EA4.7090503#usa.net
Basically you have to install the ipc service first, then use cygrunsrv to create a Windows service for PostgreSQL dependent on it. Then you can run net start ipc-daemon and then net start postgresql

xampp apache wont start after oracle db 10g is installed. how to fix?

I've been doing php before but as usual,I used mysql as a database. So everything seems easy when using xampp.
Now, for some reason I am required to use Oracle as the database but after installing Oracle database 10g on my pc, I can't seem to start apache from the control panel at all! When I press start,instead of it being started it goes back to the stopped state. I tried making it a service and starting it from, it pops out an error.
What is making this conflict, I can use IIS to do this but I prefer xampp so I'm eager to make this thing work.
Does anyone know whats the conflict? Is it the port?
I know how to configure the oracle extension and all with php to get it to work, but I am just confused why apache can't be started when oracle db 10g is installed.
Hope someone can help me out.
I just had this problem with startup.pl not starting (according to the log files), so I went into xampp\apache\conf\httpd.conf and editted out this include line by putting a hash (or pound as it is called in the states) (#) in front of it:
Perl settings
Include "conf/extra/httpd-perl.conf"
it seems to work now and I have now got oracle and apache working on my machine.
Im not sure if there will be any problems later on because of removing the line, but I don't think I need to use anything perl related so hopefully it will be fine
Sounds like platform is Windows. Oracle has the habit to alter the PATH setting, system wide. There is also an Apache installation in the Oracle installation. Maybe you can tweak the Apache service to use the Oracle Apache installation. Otherwise, make sure that your Apache start service does not have ORACLE_HOME or sub-directories of ORACLE_HOME/bin in the PATH. The services that Oracle installs normally are not on the standard ports so it's not very likely that it is a port conflict.

Finding ODBC connection name

Situation:
I have a program written in VB6
The source code of the program is not available
It connects to a database using ODBC connection string.
The vendor setup a connection name to the database when the program was first installed 6 years ago
My machine crashed, all the settings are gone!
The program vendor is out of business. Even they don't have the source of the program now.
Question:
Can I find the ODBC connection name in anyway?
You can use Process Explorer to catch the connection string your program is trying to open. You can find almost everything a program is doing, and you can filter what information is captured/displayed.
I'm not sure I've understood. What exactly happens when you try to run the program? Is the problem that the ODBC connection string was lost because the settings were lost when your machine crashed?
If so I would try the following.
Look on a backup for the configuration file of the VB6 program. It may be an INI file.
Do you know what the database is? Is it an Access file (*.MDB), SQL Server, or what? You may be able to recreate the connection string from scratch. You might have problems if you need to supply a password.
Are you still in contact with anyone from the vendor? I'd have thought whoever originally wrote the program would be best able to help, and might be willing to do a couple of days consultancy.
Can't you use a decompiler?
You can probably run an ODBC trace and then look in the log file to see what the attempted name was. Run odbcad32.exe and go to the trace tab and turn it on. Run your app and then look in the log file (probably at the SQLConnect call).

Resources