2

I'm trying to migrate an oracle database to postgresql, I run the ora2pg command and i get these errors:

root@ubuntu:~# ora2pg

DBI connect('host=localhost;sid=XE;port=1521','HR',...) 
failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) env var or PATH (Windows) 
and or NLS settings, permissions, etc. at /usr/local/share/perl/5.24.1/Ora2Pg.pm 
line 1491.
FATAL: -1 ... ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) env var or PATH 
(Windows) and or NLS settings, permissions, etc.
Aborting export...

This step is important to start the migration of the database knowing that I configured ORACLE_HOME variable such as LD_LIBRARY_PATH.

Khadhri Hamza
  • 330
  • 4
  • 16
  • That error message tells you to check more than just environment variables, etc. – ta.speot.is Oct 17 '17 at 01:05
  • 1
    Please don't include photographs of errors, those aren't searchable, include the text of the error message to your question. I know it's tedious to have to retype it out, but it makes things easier for everyone, including yourself. – Eric Leschinski Oct 17 '17 at 01:10
  • @EricLeschinski It looks like that can just be copied and pasted. It appears to be cropped from a screenshot of a graphical terminal. *Khadhri Hamza*: If you select text in the a terminal window, you can then middle-click to paste the selection. Or you can copy it with Ctrl+Shift+C (because Ctrl+C is special in a terminal) or by right-clicking and clicking Copy, and then you can paste it with Ctrl+V as usual. When you **[edit]** your question, you can paste in what you copied, then select that text you pasted and press Ctrl+K (or click the **{}** button) to format it so it will be readable. – Eliah Kagan Oct 17 '17 at 01:21
  • 1
    Eri you are right but i want u to know that it's my first time that i publish something here, well i'm still learning and thanks for mentioning that to me.. – Khadhri Hamza Oct 17 '17 at 01:23
  • Check the `NLS_LANG` environment variable. Example `NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252` or `NLS_LANG=AMERICAN_AMERICA.UTF8` – Dmitry Demin Oct 17 '17 at 01:56
  • what your `echo $ORACLE_HOME`?.. – Vao Tsun Oct 17 '17 at 07:34
  • @Vao Tsun: root@ubuntu:~# echo $ORACLE_HOME /u01/app/oracle/product/11.2.0/xe – Khadhri Hamza Oct 17 '17 at 10:35
  • hm, and what's `sed '1491,1499!d' /usr/local/share/perl/5.24.1/Ora2Pg.pm` ?.. – Vao Tsun Oct 17 '17 at 10:41
  • @Dmitry Demin: AMERICAN_AMERICA.AL32UTF8 – Khadhri Hamza Oct 17 '17 at 10:46
  • @Vao Tsun: 'AutoInactiveDestroy_=> 1, } ); # Check for connection failure if (!$dbh) { $self->logit("FATAL: $DBI::err ... $DBI::errstr\n", 0, 1); }' – Khadhri Hamza Oct 17 '17 at 10:47
  • right - and what si in oracle instance logs?.. basically it cant `OCIEnvNlsCreate`, but the reason is not clear from your quotes - check server side - is oracle running at all?.. – Vao Tsun Oct 17 '17 at 10:50
  • @Vao Tsun: ' oracle-xe.service - LSB: _Oracle 11g Express Edition_ Loaded: loaded (/etc/init.d/oracle-xe; generated; vendor preset: enabled) Active: **active (running)** ' – Khadhri Hamza Oct 17 '17 at 11:26
  • and logs?.. any erros?.. – Vao Tsun Oct 17 '17 at 11:28
  • @Vao Tsun: could u please show me the full path of the log file ? – Khadhri Hamza Oct 17 '17 at 11:31
  • `lsnrctl status instance_name` to show listener logs - check em first as you cant CONNECT I believe – Vao Tsun Oct 17 '17 at 11:44
  • @vao tsun: `root@ubuntu:~# lsnrctl status xe ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production Start Date 17-OCT-2017 03:32:04 Uptime 0 days 1 hr. 18 min. 28 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Default Service XE ` – Khadhri Hamza Oct 17 '17 at 11:54
  • @vao: Listener Parameter File `/u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/ubuntu/listener/alert/log.xml The command completed successfully` – Khadhri Hamza Oct 17 '17 at 11:59
  • so check the /u01/app/oracle/diag/tnslsnr/ubuntu/listener/alert/log.xml?.. – Vao Tsun Oct 17 '17 at 12:12
  • @vao: no errors :/ – Khadhri Hamza Oct 17 '17 at 12:17

0 Answers0