目录
YQPT脚本创建:
1、数据导出:
(1)按全库导出:
expdp system/****@127.0.0.1/yqptorcl DIRECTORY=backup_YQPT DUMPFILE=YQPT-20190909-full.dmpdp logfile=YQPT-20190909_dmpdp-full.log FULL=y
(2)按用户导出:
expdp C##orclqas/****@127.0.0.1/yqptorcl DIRECTORY=backup_YQPT DUMPFILE=YQPT-20190909-C##orclqas.dmpdp logfile=YQPT-20190909-2_dmpdp-full.log
2、创建表空间、用户
create tablespace DJPT_DATA01 datafile 'D:\app\oracle\oradata\yqptorcl\DJPT_DATA01.DBF' size 4000M autoextend on next 500M maxsize unlimited logging extent management local autoallocate segment space management auto;
create user c##orclqas identified by "****" default tablespace DJPT_DATA01 temporary tablespace TEMP profile DEFAULT;
ORA-65048:在可插入数据库PDBORCL中处理当前DDL语句时出错 ORA-00959:表空间‘DJPT_DATA01’不存在 (注:开始一直提示这个错误,我就纳闷,后来重启下Oracle服务之后,就不会报这个错了)
3、授权连接
grant connect,dba,resource to C##orclqas;
4、创建目录
create directory exp_dir as 'D:\exp_dir';
5、授权目录
grant read,write on directory exp_dir to public;
6、导入用户:
(1)、用impdp sys用户
impdp system/****@127.0.0.1/yqptorcl table_exists_action=truncate dumpfile=YQPT-20190909-FULL.dmpdp logfile=imp20190909-2.log directory=exp_dir schemas=C##orclqas
(2)、用impdp 当前用户
impdp C##orclqas/****@127.0.0.1/yqptorcl dumpfile=YQPT-20190907.DMPDP logfile=imp20190909-4.log directory=exp_dir
以上两种方式都有18个错误。
7、导入其他用户
用户C##1001
create tablespace FAC_1001_DATA datafile 'D:\app\FACData\FAC_1001\FAC_1001_DATA.DBF' size 4000M autoextend on next 500M maxsize unlimited logging extent management local autoallocate segment space management auto; create tablespace FAC_1001_TEMP datafile 'D:\app\FACData\FAC_1001\FAC_1001_TEMP.DBF' size 512M autoextend on next 100M maxsize unlimited logging extent management local autoallocate segment space management auto; create user c##_1001 identified by "A$ShangYqpt7" default tablespace FC_1001_DATA temporary tablespace TEMP profile DEFAULT; grant connect,dba,resource,pulic to c##_1001; grant read,write on directory exp_dir to public; impdp c##_1001/****@127.0.0.1/yqptorcl table_exists_action=truncate dumpfile=YQPT-20190909-FULL.dmpdp logfile=imp20190909-1001.log directory=exp_dir schemas=c##_1001
用户:C##1004
create tablespace FAC_1004_DATA datafile 'D:\app\FACData\FAC_1004\FAC_1004_DATA.DBF' size 4000M autoextend on next 500M maxsize unlimited logging extent management local autoallocate segment space management auto; create tablespace FAC_1004_TEMP datafile 'D:\app\FACData\FAC_1004\FAC_1004_TEMP.DBF' size 512M autoextend on next 100M maxsize unlimited logging extent management local autoallocate segment space management auto; create user c##_1004 identified by "****" default tablespace FAC_1004_DATA temporary tablespace TEMP profile DEFAULT; grant connect,dba,resource,public to c##_1004; grant read,write on directory exp_dir to public; impdp c##_1004/****@127.0.0.1/yqptorcl table_exists_action=truncate dumpfile=YQPT-20190909-FULL.dmpdp logfile=imp20190909-1004.log directory=exp_dir schemas=c##_1004
文章评论