expdp 命令在 Oracle 数据库的 Ubuntu 服务器上给出错误

expdp command gives error on Ubuntu server for Oracle Database

我一直在尝试使用 Oracle 18c 中的 "expdp" 实用程序导出 oracle 数据转储。我在 ~/.bashrc 下设置了如下环境变量

export ORACLE_HOME=/home/ubuntu/oracle-database-xe-18c-1.0/opt/oracle/product/18c/dbhomeXE
export ORACLE_SID=ORCL
export ORACLE_BASE=/home/ubuntu/oracle-database-xe-18c-1.0/opt/oracle/product
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export TNS_ADMIN=$ORACLE_HOME/network/admin

当我在终端输入命令 "expdp" - 它一直说你的 ORACLE_HOME 没有设置

root@ip-172-30-xx-xxx:~# expdp
UDE-00013: Message 13 not found; No message file for product=RDBMS, facility=UDE
UDE-00019: You may need to set ORACLE_HOME to your Oracle software directory

我目前是 Oracle 数据库的新手。可能是什么问题?我是否也需要在其他地方设置环境变量?

请注意 Ubuntu 并不真正支持 Oracle XE:如果您真的想使用 Oracle,请在 Oracle Linux(免费提供)上安装它:您将永远看不到 Oracle 数据库 运行ning 在 Debian 或 Ubuntu 上的 real 生产中,您将需要使用 Oracle Linux 或 RedHat Linux 或 Suse Linux.

不要 运行 以 root 身份使用 Oracle 实用程序:您不需要这样做,在 Linux 上,在不需要时使用 root 帐户通常是一种不好的做法。使用非特权帐户 运行 Oracle 实用程序,如 SQL*Plus 或数据泵,并确保每个 shell 会话的 Oracle 设置为 运行:将它们放入 . bash_profile 正确的帐户应该足够了。

对于此特定错误消息,只需确保 ORACLE_HOME 设置正确:您的 .bashrc 可能尚未 运行.