error while discovering SAP ASE 15.7 on AIX 7.1

  • 0
  • 2
  • Problem
  • Updated 3 years ago
  • In Progress
Hi,
I want to test Express demo with one enviroment on AIX 7.1 with SAP ASE 15.7 SP134. When I try to discover SAP ASE I received this error:

Failed to discover environment variable $SYBASE on host "XXX.XXX.XXX.81"Make sure that environment variable $SYBASE is set for user "sybase" on the host.

I have checked and Aix User have enviroment variables on .profile.

Is it possible?

Thanks.
Javier.
Photo of Javier Barthe

Javier Barthe

  • 360 Points 250 badge 2x thumb
  • confused

Posted 3 years ago

  • 0
  • 2
Photo of Neal Stack

Neal Stack, Official Rep

  • 2,592 Points 2k badge 2x thumb
Hello Javier,

What shell does your user default to (echo $SHELL)? You may need to export SYBASE in .bashrc or .bash_profile .

Also check to see if $SYBASE/SYBASE.env exists. Further on in the discovery process, Delphix incorrectly sources this file (after sourcing $SYBASE/SYBASE.sh). If SYBASE.env changes any environment variables to point to an incorrect/different location it can cause problems for discovery.

Thanks,
  Neal
Photo of Javier Barthe

Javier Barthe

  • 360 Points 250 badge 2x thumb
Hi Neal,

I ́m using /usr/bin/ksh as user shell, I have SYBASE.sh execution inside .profile, .bashrc does not exist.

Thanks.
Javier.
Photo of Timothy Ackerman

Timothy Ackerman

  • 162 Points 100 badge 2x thumb
It looks like you are using 'sybase' as your environment user for discovery.  When you login as sybase, what is the output of env.  Is $SYBASE correct?
Photo of Javier Barthe

Javier Barthe

  • 360 Points 250 badge 2x thumb
Yes I ́m using sybase and when I login $SYBASE contains instalation root directory.
Photo of Neal Stack

Neal Stack, Official Rep

  • 2,592 Points 2k badge 2x thumb
Hello,

So the easiest path forward for you might be to change the shell for the "delphix_os" user specified during discovery to be bash and set the variable in the ".bashrc" file.

We have seen one other case where discovery fails with ksh and the research found:
  • ~/.profile is only read by login shells.
  • ~/.kshrc is only executed for interactive shells.


So neither the .profile nor the .kshrc will be executed by the Delphix ssh commands which do not login and use a non-interactive shell.

We don't require that the user use the bash shell just that the variable be set during a non-interactive login.

Can you switch to a bash shell for this user?

Thanks,
  Neal
Photo of Javier Barthe

Javier Barthe

  • 360 Points 250 badge 2x thumb
Hi,

I have set bash shell for the user sybase but I ́m still getting the same error message.

When I login by ssh AIX executes .profile so I copy it with .bashrc name but no luck at all.

I don ́t have the delphix_os user I just using sybase, that ́s ok or is it necessary to create the delphix_os user at aix?

Thanks.
Javier.
Photo of Neal Stack

Neal Stack, Official Rep

  • 2,592 Points 2k badge 2x thumb
Hi Javier,

Yes, you should be able to use the user "sybase". If you have a second server that you could try to connect to the server you are trying to discover with Delphix via ssh, you should be able to test whether the variable is being set:

$ ssh sybase@nstacksolase2.dcenter.delphix.com env | grep SYBASE
Password: 
SYBASE_JRE6_64=/opt/sybase/shared/JRE-6_0_24
SYBASE_JRE6_32=/opt/sybase/shared/JRE-6_0_24
SYBASE_JRE6=/opt/sybase/shared/JRE-6_0_24
SYBASE_OCS=OCS-15_0
SYBASE=/opt/sybase
SYBASE_JRE_RTDS=/opt/sybase/shared/JRE-6_0_24
SYBASE_WS=WS-15_0
SYBASE_ASE=ASE-15_0

Can you try this? If this doesn't show the variables set, that is the reason for the error message. I would need to see your .bashrc and SYBASE.sh files. Maybe we could do a WebEx to troubleshoot.

Thanks,
  Neal
Photo of Javier Barthe

Javier Barthe

  • 360 Points 250 badge 2x thumb
Hi neal,

This is the ouput:

# su - sybase
-bash-4.2$ env | grep SYBASE
SYBASE_OCS=OCS-15_0
SYBASE=/sybase
SYBASE_JRE_RTDS=/sybase/shared/SAPJRE-7_1_027_64BIT
SYBASE_WS=WS-15_0
SYBASE_ASE=ASE-15_0

I do not have JRE variables in comparison with your output.

Thanks.
Javier
Photo of Neal Stack

Neal Stack, Official Rep

  • 2,592 Points 2k badge 2x thumb
Hi Javier,

"su - sybase" is going to be an interactive login. I would like to see the output from the "ssh" command I illustrated. The "SYBASE" environment variable is the only one we care about.

Thanks,
  Neal
Photo of Javier Barthe

Javier Barthe

  • 360 Points 250 badge 2x thumb
I execute command from another server to this one but no output:

sybase@TST(/home/sybase)$ ssh sybase@xxx.xxx.xxx.81 env | grep SYBASE
sybase@xxx.xxx.xxx.81's password:
sybase@TST(/home/sybase)$
Photo of Neal Stack

Neal Stack, Official Rep

  • 2,592 Points 2k badge 2x thumb
Hi Javier,

So that is exactly the problem we have to fix. If we get that to work, the Delphix discovery will work.

If you login interactively as "sybase", can you post the output from:

* echo $SHELL
* grep SYBASE .bashrc
* grep SYBASE $SYBASE/SYBASE.sh

Thanks,
  Neal
Photo of Javier Barthe

Javier Barthe

  • 360 Points 250 badge 2x thumb
Neal,

-bash-4.2$ echo $SHELL/bin/bash
-bash-4.2$ grep SYBASE .bashrc
SYBASE=/sybase
export SYBASE
./sybase/SYBASE.sh
-bash-4.2$ grep SYBASE $SYBASE/SYBASE.sh
SYBASE_OCS="OCS-15_0"
export SYBASE_OCS
SYBASE="/sybase"
export SYBASE
SYBASE_ASE="ASE-15_0"
export SYBASE_ASE
SYBASE_JRE_RTDS="/sybase/shared/SAPJRE-7_1_027_64BIT"
export SYBASE_JRE_RTDS
SYBASE_WS="WS-15_0"
export SYBASE_WS
-bash-4.2$

Thanks.
Javier
Photo of Neal Stack

Neal Stack, Official Rep

  • 2,592 Points 2k badge 2x thumb
Hi Javier,

I would expect the "SYBASE=/sybase" and followed by "export SYBASE" to work.

The "./sybase/SYBASE.sh" should actually be ". /sybase/SYBASE.sh" (dot followed by a space and then the path to the script). Try changing that and see if it works.

If not, I could do a WebEx later today.

Thanks,
  Neal
Photo of Javier Barthe

Javier Barthe

  • 360 Points 250 badge 2x thumb
Neal,

The export its after SYBASE=/sybase and there is not space between . and / in the execution.

Any other way of doing this by console and get more information about?

Thanks.
Javier.
Photo of Neal Stack

Neal Stack, Official Rep

  • 2,592 Points 2k badge 2x thumb
Hello Javier,

If there is a space between the . and the /sybase/SYBASE.sh it should be setting the environment variables and you should see this by using the "ssh" test I mentioned earlier. This is actually what Delphix does during the first steps of discovery. It makes a ssh connection to the ASE server and gets the SYBASE environment variable.

I may need to see the complete ".bashrc" to see if there is something else affecting this.

I should be available in about an hour if you would like to troubleshoot via a WebEx.

Thanks,
  Neal
Photo of Javier Barthe

Javier Barthe

  • 360 Points 250 badge 2x thumb
-bash-4.2$ cat .bashrc
PATH=$PATH:/sybase/ASE15_0/bin
export PATH

SYBASE=/sybase
export SYBASE

./sybase/SYBASE.sh
Photo of Neal Stack

Neal Stack, Official Rep

  • 2,592 Points 2k badge 2x thumb
Hello,

As far as I can tell, it looks correct but it is too difficult to troubleshoot from this forum.

Thanks,
  Neal
Photo of Javier Barthe

Javier Barthe

  • 360 Points 250 badge 2x thumb
Neal,

Finally I could solve the problem adding SYBASE enviroment variables to .ssh/enviroment file.

But the enviroment is not shown on enviroments lists when I want ot add a database on add dsource however is it shown on enviroments.

Snapshot attached.

Thanks.
Javier.
Photo of Neal Stack

Neal Stack, Official Rep

  • 2,592 Points 2k badge 2x thumb
Hi Javier,

Good news!

So the general process of environment discovery follows this sequence of events:
  • Get the $SYBASE environment variable by looking for the environment variable in the user’s list of environment variables (the user as specified in the OS Username of the Add Environment dialogue).
  • Get the path to the isql binary looking under $SYBASE
  • List the running instances using ps (see get_ase_instances.sh in the toolkit directory for details).
  • For each instance:
    • Get the list of ports by running isql and querying the syslisteners table (see get_ase_instance_ports.sh for details).
    • Connect via JDBC using the port retrieved from syslisteners and the host/IP entered in the environment definition screen. After successfully connecting, retrieve @@servername. Use the first port that works where @@servername is the same as the value from ps.
    • Discover the list of user databases for each instance by querying sysdatabases (excluding the system databases 'master', 'model', 'sybsystemdb', ‘sybsystemprocs' and ‘tempdb').
So if the database user that was specified in the "Add Environment" dialogue box does not have permission to query "syslisteners" or "sysdatabases" for a given ASE instance, that database will not be added to the environment.

I can't tell from the screen shot but if you are on the "Environments" screen in the top right corner, there is a circular databases icon. If you click on it, does it show any ASE instances discovered but maybe it isn't listing the user databases?

You can try running these two scripts manually (the scripts will appear to hang at which point you will need to enter the database user's :

$ cd /the_delphix_toolkit_directory/
$ find . -name get_ase_instances.sh
$ sh ./get_ase_instances.sh
<ASE password>
/export/home/sybase/toolkit/Delphix_COMMON_564d3b4d_136a_7af6_cc70_c377235272ed_sybase_host/scripts/bin/dlpx_pfexec: sudo: not found
SRC_157_4K,  sybase

$ sh ./get_ase_instance_ports.sh SRC_157_4K sa $SYBASE/$SYBASE_OCS/bin/isql $SYBASE
<ASE password>
Password: nstacksolase2.dcenter.delphix.com 5000

Thanks,
  Neal
Photo of Javier Barthe

Javier Barthe

  • 360 Points 250 badge 2x thumb
Neal,

Only these scripts available:

-bash-4.2$ pwd
/home/sybase/Delphix/Delphix_COMMON_e4c77b52_4130_4b46_a87b_64ea31ff742f_sybase_host/scripts/ase
-bash-4.2$ ls -ltr
total 24
-rw-rw-r--    1 sybase   sybase         1747 Nov 05 18:52 get_next_backup.sh
-rw-rw-r--    1 sybase   sybase         1810 Nov 05 18:52 get_bs_errorlog.sh
-rw-rw-r--    1 sybase   sybase         2100 Nov 05 18:52 get_ase_instance_ports.sh

No get_ase_instances.sh.

Thanks.
Javier.
Photo of Neal Stack

Neal Stack, Official Rep

  • 2,592 Points 2k badge 2x thumb
Hello,

Hmmm...They may have changed the process a little in the most recent version. The database user you provided during environment discover has permission to query "syslisteners" and "sysdatabases"?

If so, I'll need to look at the support bundle to understand why it didn't discover the databases. You can upload here following the instructions here:
https://support.delphix.com/hc/en-us/articles/201655216-Best-Practice-Uploading-Support-Logs

Let me know the name of the file and I will look at it tomorrow morning.

Thanks,
  Neal
Photo of Javier Barthe

Javier Barthe

  • 360 Points 250 badge 2x thumb
Neal,

Yes, the user I provided to Delphix was "sa".

I cannot transfer files may be security reasons, but I could download it. Can I send you by mail or another way? 15MB size.

Thanks.
Javier.
Photo of Javier Barthe

Javier Barthe

  • 360 Points 250 badge 2x thumb
Finally I could transfer it.
Thanks.
javier.
Photo of Neal Stack

Neal Stack, Official Rep

  • 2,592 Points 2k badge 2x thumb
Hi Javier,

What is the name of the file you uploaded? There are a lot of files and unless the file is associated with a case number, it is difficult for me to tell which one is yours.

Thanks,
  Neal
Photo of Javier Barthe

Javier Barthe

  • 360 Points 250 badge 2x thumb
Neal,

I have uploaded again with number 11223.

Thanks.
Javier.