1

I am new to Azure.

We have created one small POC in which I need to select the VM name and Resource group name in which that VM is present. And then I need to mention the command which I need to execute and then click on execute button which will execute the command.

Now what I have done, I have created one script in linux in which I have given some ora2pg commands. So what is happening when I am trying to run that script directly on VM by passing some parameter, it is working fine without any error.

But same script when I am trying to run through that the POC which I created (by giving VM name, Resource group name and then passing the command which I want to execute) it is giving this error -

Enable succeeded: [stdout] Schema Name : OT Conversation of tables for OT schema started Conversation of views for OT schema started Conversation of package for OT schema started Conversation of sequence for OT schema started Conversation of type for OT schema started Conversation of trigger for OT schema started Conversation of function for OT schema started Conversation of procedure for OT schema started Successfully copied to OT_SCHEMA [stderr] install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.18.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 193. at (eval 14) line 3. Compilation failed in require at (eval 14) line 3. Perhaps a required shared library or dll isn't installed where expected at /usr/local/share/perl5/Ora2Pg.pm line 1660. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.18.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 193. at (eval 14) line 3. Compilation failed in require at (eval 14) line 3. Perhaps a required shared library or dll isn't installed where expected at /usr/local/share/perl5/Ora2Pg.pm line 1660. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.18.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 193. at (eval 14) line 3. Compilation failed in require at (eval 14) line 3. Perhaps a required shared library or dll isn't installed where expected at /usr/local/share/perl5/Ora2Pg.pm line 1660. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.18.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 193. at (eval 14) line 3. Compilation failed in require at (eval 14) line 3. Perhaps a required shared library or dll isn't installed where expected at /usr/local/share/perl5/Ora2Pg.pm line 1660. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.18.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 193. at (eval 14) line 3. Compilation failed in require at (eval 14) line 3. Perhaps a required shared library or dll isn't installed where expected at /usr/local/share/perl5/Ora2Pg.pm line 1660. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.18.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 193. at (eval 14) line 3. Compilation failed in require at (eval 14) line 3. Perhaps a required shared library or dll isn't installed where expected at /usr/local/share/perl5/Ora2Pg.pm line 1660. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.18.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 193. at (eval 14) line 3. Compilation failed in require at (eval 14) line 3. Perhaps a required shared library or dll isn't installed where expected at /usr/local/share/perl5/Ora2Pg.pm line 1660. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.18.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 193. at (eval 14) line 3. Compilation failed in require at (eval 14) line 3. Perhaps a required shared library or dll isn't installed where expected at /usr/local/share/perl5/Ora2Pg.pm line 1660.

Note - My Linux VM is in Azure and it is using Custom script for linux extension to run all the commands. I have moved my script to bin folder so that by passing only the name it will run the script.

I have mention following things in env path in linux -

export ORACLE_HOME=/usr/lib/oracle/18.3/client64
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$PATH:$ORACLE_HOME/bin:/usr/pgsql-12/bin/

My perl version is 5.26

As I said everything is working fine when I am trying to run from VM, but when I trying to run through my POC it is giving that issue.

Can anyone please help me with the issue like where I am lagging?!

Thanks in advance.

saurabh704
  • 63
  • 6
  • `Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' ` : Can you check if that file exists or not? – Håkon Hægland Oct 12 '20 at 15:12
  • Thank you @HåkonHægland for your reply. I think I have installed only oracle client thats why I dont have that file. But if thats not really the case then can u please help me out?! – saurabh704 Oct 12 '20 at 15:38
  • So when running the script from the VM it works fine? Then try to locate the file `Oracle.so` on the VM. Try run `perl -MDBD::Oracle -E'say $INC{"DBD/Oracle.pm"}'` – Håkon Hægland Oct 12 '20 at 15:41
  • Thank you @HåkonHægland for your reply. Yes when I am trying to run the script from from VM, its working fine. And I ran the command provided by you, after running I am getting something like this - /usr/local/lib64/perl5/DBD/Oracle.pm – saurabh704 Oct 12 '20 at 19:22
  • So then there is also a file `/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so` on the VM ? – Håkon Hægland Oct 12 '20 at 19:24
  • Yes @HåkonHægland , I am having that file. – saurabh704 Oct 13 '20 at 03:25
  • I am not familiar with Azure, so to clarify: when you are running the script with Azure it is using a different VM (than the one on which you have the `.so` file) ? – Håkon Hægland Oct 13 '20 at 09:49
  • No same VM it is using to run script. I tested with other small scripts in which I have given command to create file and it ran fine and created file also. – saurabh704 Oct 13 '20 at 15:22
  • Strange.. Does this script give an error: `perl -MDBD::Oracle -E'say $INC{"DBD/Oracle.pm"}'` when you run it with Azure ? – Håkon Hægland Oct 13 '20 at 15:25
  • No @HåkonHægland, I didnt got any error when I am running "perl -MDBD::Oracle -E'say $INC{"DBD/Oracle.pm"}' , from Azure. I am getting output as - "Enable succeeded: [stdout] /usr/local/lib64/perl5/DBD/Oracle.pm [stderr]" – saurabh704 Oct 13 '20 at 16:07
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/223001/discussion-between-hakon-haegland-and-saurabh704). – Håkon Hægland Oct 14 '20 at 06:09
  • Add an answer to display the solution if you solved the problem. – Charles Xu Oct 28 '20 at 07:53

0 Answers0