1.使用oracle用户登录,创建数据库用户,并赋予最高权限
#创建用户并赋予密码 -- 注意这里语句一定要加分号,不然不会生效
$ create user 用户名 identified by 密码;
#赋予最高权限(dba权限)
$ grant connect,resource,dba to abc;
2.建好生成dump文件目录,并赋予dba权限
$ mkdir -p /home/oracle/dump;
$ chown -R oracle:dba /home/oracle/dump;
3.创建资源路径
$ create or replace directory DUMPDATA as '/home/oracle/dump';
#赋予权限
$ grant read,write on directory DUMPDATA to ACPTUSER;
$ grant connect to ACPTUSER with admin option;
$ grant dba to ACPTUSER with admin option;
$ grant resource to ACPTUSER with admin option;
$ grant unlimited tablespace to ACPTUSER with admin option;
$ grant read,write on directory DUMPDATA to ACPTUSER;
4.导出dump文件
$ expdp 用户名/密码@oracle服务器ip/数据库名 directory=DUMPDATA dumpfile=20220808.dmp tables=要导出的表名 logfile=20220808.log compresion = all exclude=statistics;