切记先不要执行第一句drop,先执行第二句select(可以先不加条件,因为目录名称可能不是DATA_BACKUP),看看DATA_BACKUP有没有,如果没有,按第三句sql create创建一个存放文件的目录,然后按后续的sql授权这个目录:
注:要在sys账号下使用如下sql(可在sqlplus下执行)。
--前提directory=DATA_BACKUP创建
drop directory DATA_BACKUP;
select * from dba_directories where directory_name='DATA_BACKUP';
create directory data_backup as 'D:\expdp';
grant read,write on directory data_backup to YILI_NEIMENG_HOHHO_DB;
grant read,write on directory data_backup to sys;
grant read,write on directory data_backup to system;
--exp导出
expdp sys/12345678 as sysdba dumpfile=ttbeerDB_20241107.dmp directory=DATA_BACKUP full=y logfile=ttbeerDB_20241107.log
--imp导入
impdp sys/12345678 as sysdba directory=DATA_BACKUP dumpfile=ttbeerDB_20241107.dmp full=y logfile=ttbeerDB_20241107.log
标签:backup,DATA,备份,ttbeerDB,directory,20241107,Oracle,BACKUP,数据库 From: https://www.cnblogs.com/long2050/p/18670906