Sql Advantage Error : Open Client is not configured correctly - sybase

I am trying to run the Sql Advantage editor but getting below mentioned error.
Internal failure while initializing the SQL Advantage.
Please check that Open Client is configured correctly.
Please check the SET command output in the attached screenshot.Also, I can see two folders in my system for OCS-12_5 and OCS-15_0. This may be causing this problem. I also tried to run a bat file with these commands but getting same error:
Bat file commands:
set SYBASE= C:\Sybase\OCS-12_5
set SYBASE_OCS=OCS-12_5
C:\Sybase\OCS-12_5\sqladv-12_5\sqladv.exe
Please suggest.

SQL Advantage is no longer supported with ASE 15.x
But you can probably still run it if you set your environment to 12.5 (it works for me). Put all the environment settings in a .bat file, and then (in the .bat file) kick off sqladv.exe.

Related

Setup psftp for use in SSIS

I am trying to sftp(SSH) transfer files from a remote server to a local directory in SSIS. I was recommended to use PSFTP.exe to conduct the transfer via a batch file. In debug mode, this works flawlessly, but when deployed to SSIS Catalog, the job stalls at the point to connect and transfer the files. I have no errors from SSIS. The job just freezes. The user set in the job is in the administrator's group. I am missing something. How do I troubleshoot?
Thank you.
Thanks to #Nick.McDermaid, I found out that adding the flag -batch and the key -hostkey aa:bb:cc:........ fixed my problem. for some reason, even though i have the RSA key approved via CMD line, the ssis package did not see the approval, forcing the acceptance. adding the hostkey flag solved the key issue, and the batch flag turned off the interactive setting.

How to put Open VPN process in an SSIS task control flow

I'm learning how to use SSIS to create auto scheduled tasks. Everything went smoothly until the security policy has changed. Before whenever I wanted to connect to database, I just type in IP address, username and password in SSIS connection manager. Now I need to open up OpenVPN first which is still a manual process. So I really would like to put this bit into an SSIS task flow.
I had a search on Stackoverflow and over some other websites. Here is a link in stackoverflow. This example gives the idea that we can use VBA to setup the link. However that example shows we need a VPN connection name and VPN username which I don't really have and don't know where to find. Everytime I just right click on a .ovpn file and choose start openvpn on this config file. Also when I open that .ovpn file there is no command indicating which is my connection name or user name. Here is what it looks like when I open it up (there is no -auth-user-pass thing in this file and I can use this file without having to specify it):
client
dev tun
proto udp
remote a website here 1111
resolv-retry infinite
nobind
persist-key
persist-tun
comp-lzo
verb 3
ca ca.crt
cert office.crt
key office.key
askpass login.txt
Is it possible to find my connection name and user name? If I don't need connection name and user name, can I still write up VBA to build up an auto connection process?
I also notice there is an execute process task in SSIS. Is it possible that I can make use of it (because in my understanding obviously I use openvpn.exe to execute a .ovpn file)?
Please correct me if I'm saying something wrong since I'm new to both VPN and SSIS. And much appreciate for whoever can help me with this.
I don't know anything about OpenVPN, but I ran into a similar problem a while back with a server that insisted on an SSH tunnel using PuTTY as the only allowed connection method.
People who put these policies in place never think of the impact on SSIS, especially for unattended processing.
The solution I found was:
Find the command-line equivalent to the PuTTy client (which is called plink)
Have the detailed documentation to hand, because this is really difficult.
Have the SSIS package start plink.exe, passing various parameters (Note: don't use the Execute Process task, as that waits for the process to exit: launch the process in a Script task, and get the handle of plink.exe's ProcessID).
After a wait, have another Script task in SSIS connect to the plink process' InputBuffer, "typing in" a password. Yes, insecure and clunky, though you can store SSIS project parameters encrypted (this obviously requires SSIS 2012 or later)
The SSIS package can now connect to the server and do data stuff, as if it was a normal server without stupid access requirements.
At the end of the package, kill the plink.exe process.
Bear in mind, also, that on unattended execution (e.g. when scheduled in a job), your package will be running in a different security context from the one you work in to develop the package (depending on the SSIS service settings). If your access to OpenVPN has any dependency on ActiveDirectory, you may have to set up another OpenVPN account for the SSIS service's Logon user.
If this sounds horrible, nightmarishly complicated and unstable, it's because it is. Really, the TL;DR version is: tell whoever administers the server that if they really want you to access it using SSIS, they should put some more sensible access policy in place.
After working with my IT colleague, I think I solve the problem. Here are my answer and opinion to this question, and please correct me if I am wrong.
I think opening a VPN automatically is a case by case issue. In this case I am still using Execute Process Task in SSIS. Inside the task editor, what we are executing is not openVPN.exe, it should be a batch file. In the batch file (.bat file) it contains the command of opening .ovpn file with OpenVPN.exe
The process below gives you more detailed info.
The command line is what I use in the batch file:
#echo off
CD /D "C:\Program Files\OpenVPN\config"
start openvpn client.ovpn
TIMEOUT /T 10
exit
In SSIS execute process task
Hopefully this is useful

SQL Server xcopy and xp_cmdshell file not found

I read other help posts but I keep getting file not found on the the network. The path is on the network on a fileshare and I'm using RDP to remote to my own machine that connects to the SQL Server database.
I'm using xcopy command with xp_cmdshell. I can't use just "copy" because I get an access denied error so I'm using Xcopy in this format:
echo f|xcopy /i "\\fileserver\file\excelfile1.xls" \\fileserver\file\newdirectory\excelfile1.xls"
I have tried almost everything and read other posts but this is still not working. I do have parameters for the directory and files, etc. but I actually have it hard-coded in the dos command it's still not working.
Any ideas would be great.
If you get an "access denied" with copy, you'll get the very same error with xcopy too. It offers more options, but won't let you bypass the OS security at will, both are still bound to the permissions of the user account that runs them, like every other software.
There are two options:
Use sp_xp_cmdshell_proxy_account to specify a different user for all xp_cmdshell operations (as suggested by Bacon Bits). This user must have enough permissions to both origin and target files.
Give those permissions to the account that runs the SQL Server service, so that it can access the files directly.
Thank you everyone for responding. This is the first time I've used this forum.
I found out the files were named .XLS but actually in .TXT delimited format. So I renamed them through SSIS with a ForEach Loop and processed them from there.
I tried to XCOPY from command line with new permissions that that didn't work. I was getting an extension hardening error and that is why, XLS to TXT wasn't liking it.

print to PDF using xp_cmdshell

We are trying to use TSQL on SQL 2012 and OS 2012 to print PDF file from a specific directory using variables based on a lookup that populates these variables. The command we have works on SQL 2005 and 2003 datacenter OS. During our upgrade this now does not want to work. I am fairly sure we are just dealing with a syntax issue that is OS related but SQL is not saying what is the issue.
Here is the base query --
EXEC master.sys.xp_cmdshell '"C:\Program Files (x86)\Foxit Software\Foxit Reader\Foxit Reader.exe /t" \\jde9appb\d$\JDEdwards\E910\PrintQueue\R5509108_TV0001_4970_PDF.pdf \\VMPS08\INF2808P'
The above runs in the OS 2003 and SQL 2005 but when we try it in OS 2012 and SQL 2012 it just spins. We have turned of UAC and verified that the execute user has all the necessary rights to the command shell and command shell is enabled. This has to be done thru a TSQL script since this is part a stored proc that gets called by the custom application. Also the foixut reader is the default application to read PDF files. The switch you see above is the silient mode to print directly to a queue.
Help help. This has been a real tough one to figure out.
I have actually gotten it to say Failure to initialize the printer by messing with the Syntax, but this is as far as I have gone. I even loaded the printer I am going to to make sure the system is trying to use the proper driver.
For some reason the double backslash is not showing correctly. Here is the fixed query that I need some help with please.
EXEC master.sys.xp_cmdshell '"C:\Program Files (x86)\Foxit Software\Foxit Reader\Foxit Reader.exe /t" \\jde9appb\d$\JDEdwards\E910\PrintQueue\R5509108_TV0001_4970_PDF.pdf \\VMPS08\INF2808P'
We faced the exact same issue. We found it was caused by the network printers, though created for the user, not being available to the background process. Creating the printers locally, thus bypassing the print server solved the issue.

Calling Powershell script via SQL Server agent job - start-transcript doesn't get output

There's a question on this already (here). But I'm hoping that because I'm using PowerShell 2, and SQL Server 2008, that I might get different answers if I ask again.
Basically, I have a SQL Server Agent job, which runs a cmd script like so:
powershell "&D:\SQL\Job\JobDir\Upload.ps1 (various arguments including log file name)"
When it runs start-transcript, the file is created, but nothing except a header is written to the file. However, when I run on the command line, everything is logged properly.
I've already got lots of logic to manage old log files in the powershell script, and don't want to just use the default logging that SQL Server Agent provides.
To write out info, I use invoke-sqlcmd with the verbose flag, and also write-message and write-error.
Thanks for any pointers!
Sylvia
start-transcript creates a text file
it is likely that the permissions under which the agent job is running does not have permissions to create the text file where powershell wants to create it
Permissions were not an issue for me. I think there's ways of manipulating the output from powershell very exactly, with all the different output streams (error, verbose, etc), but instead of getting into those details, I just used the default logging that SQL Server agent provides for each job step. It works okay. I still use the logic that I wrote to manage and archive log files in my script, I can do that even though the log file itself is generated by SQL Server.
I believe that start-transcript does not work when a console was not started (e.g. in a service): outputs are not generated and that would explain why the file is empty.
See start-transcript causes script to fail in a background job
As already stated above the Start-Transcript will create a file in the location specified (as long as agent has permission to create files there). However nothing will be streamed to the transcript file because technically no console window is running.
When running a powershell file through the SQL agent (pre-2012) like
C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe C:\myscript.ps1 "SOMEPARAMETER"
I just use the SQL Agent's native Output File option in the SQL steps advanced properties like
C:\LOGGING\myfile_$(ESCAPE_SQUOTE(STRTDT))_$(ESCAPE_SQUOTE(STRTTM)).txt and skip powershell's transcript ability.
Include Write-Host where necessary. Write-Host "rn" will create new line appropriately.
Also include things like -Verbose where allowed and try / catch with error output and the file will record appropriately.

Resources