目录
YQPT测试:
1、创建表空间、用户、授权、directory目录
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 grant connect,dba,resource,public to C##orclqas; create directory exp_dir as 'D:\exp_dir'; grant read,write on directory exp_dir to public;
2、修改密码
alter user system identified by **** alter user sys identified by ****
3、导入用户数据
impdp C##orclqas/****@127.0.0.1/yqptorcl table_exists_action=truncate dumpfile=YQPT-20190917-FULL.dmpdp logfile=imp20190910-1.log directory=exp_dir schemas=C##orclqas
4、删除表空间
drop tablespace FAC_1001_TEMP including contents and DATAFILEs drop tablespace FAC_1004_TEMP including contents and DATAFILEs drop tablespace FAC_1086_TEMP including contents and DATAFILEs
5、FAC_1001_DATA表空间操作
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 temporary tablespace FAC_1001_TEMP tempfile '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; drop tablespace FAC_1001_TEMP including contents and DATAFILEs create user c##_1001 identified by "****" default tablespace FAC_1001_DATA temporary tablespace FAC_1001_TEMP profile DEFAULT; grant connect,dba,resource,public 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-20190917-FULL.dmpdp logfile=imp20190909-1001.log directory=exp_dir schemas=c##_1001
6、FAC_1004_DATA表空间操作
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 temporary tablespace FAC_1004_TEMP tempfile '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/A$ShangYqpt7@127.0.0.1/yqptorcl table_exists_action=truncate dumpfile=YQPT-20190909-FULL.dmpdp logfile=imp20190909-1004.log directory=exp_dir schemas=c##_1004
7、FAC_1086_DATA表空间操作
create tablespace FAC_1086_DATA datafile 'D:\app\FACData\FAC_1086\FAC_1086_DATA.DBF' size 4000M autoextend on next 500M maxsize unlimited logging extent management local autoallocate segment space management auto; create temporary tablespace FAC_1086_TEMP tempfile 'D:\app\FACData\FAC_1086\FAC_1086_TEMP.DBF' size 512M autoextend on next 100M maxsize unlimited --logging extent management local autoallocate segment space management auto; create user c##_1086 identified by "A$ShangYqpt7" default tablespace FAC_1086_DATA temporary tablespace TEMP profile DEFAULT; grant connect,dba,resource,public to c##_1086; grant read,write on directory exp_dir to public; impdp c##_1086/****@127.0.0.1/yqptorcl table_exists_action=truncate dumpfile=YQPT-20190917-FULL.dmpdp logfile=imp20190917-1086.log directory=exp_dir schemas=c##_1086
五、昆山塑业MES
1、创建目录
create directory backup_mes as '/data/backup'; GRANT READ,WRITE ON DIRECTORY backup_mes to MESPRD; GRANT READ,WRITE ON DIRECTORY backup_mes to system; create directory backup_mes as '/u01/expbackup'; GRANT READ,WRITE ON DIRECTORY backup_mes to mespro; GRANT READ,WRITE ON DIRECTORY backup_mes to system;
2、导入,导出命令
PRD导出: expdp system/****@127.0.0.1/kssyorclprd DIRECTORY=backup_mes DUMPFILE=KSSYMES20191009_full.dmpdp logfile=KSSYMES20191009_full.log full=y PRD导出: expdp MESPRD/*******@127.0.0.1/kssyorclprd DIRECTORY=backup_mes DUMPFILE=KSSYMES20191009_MESPRD.dmpdp logfile=KSSYMES20191009_MESPRD.log UAT导出: expdp system/**** DIRECTORY=backup_mes DUMPFILE=KSSYMES20191012_full.dmpdp logfile=KSSYMES20191012_full.log full=y
3、导入
(1)不同用户导入, PRD导入: impdp system/****@127.0.0.1/kssyorclprd dumpfile=KSSYMES20191012_full.dmpdp logfile=KSSYMES20191012_full_dmpdp.log DIRECTORY=backup_mes REMAP_SCHEMA=MESPRO:MESPRD EXCLUDE=USER (2)不同用户,不同表空间导入, PRD导入: impdp system/****@127.0.0.1/kssyorclprd dumpfile=KSSYMES20191012_full.dmpdp logfile=KSSYMES20191012_full_dmpdp.log DIRECTORY=backup_mes REMAP_SCHEMA=MESPRO:MESPRD REMAP_TABLESPACE=MESQAS_KSSY:MESPRD_TBSP EXCLUDE=USER
4、删除导出用户、表空间
drop user MESPRD cascade;
drop tablespace MESPRD_TBSP including contents and datafiles;
5、创建表空间、用户、用户授权、对象授权
CREATE tablespace MESPRD_TBSP logging DATAFILE'/data/u01/app/oracle/oradata/KSSYORCLPRD/datafile/MESPRD_01.dbf' size 10240m autoextend on next 1000m; create user mesprd identified by "****" default tablespace MESPRD_TBSP temporary tablespace TEMP profile DEFAULT; grant connect,dba,resource to mesprd; grant unlimited tablespace to mesprd with admin option;
文章评论