[oracle@edustu4~]$ expdp orctstu/testpd2015@PD1directory=dir_dump_t1 schemas=orctstu dumpfile=TEST2_PD_20150518.dmp
Export:Release 11.2.0.1.0 - Production on Mon May 18 17:06:42 2015
Copyright(c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connectedto: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bitProduction
Withthe Partitioning, OLAP, Data Mining and Real Application Testing options
Starting"ORCTSTU"."SYS_EXPORT_SCHEMA_02": orctstu/********@PD1 directory=dir_dump_t1schemas=orctstu dumpfile=TEST2_PD_20150518.dmp
Estimatein progress using BLOCKS method...
Processingobject type SCHEMA_EXPORT/TABLE/TABLE_DATA
Totalestimation using BLOCKS method: 7.483 GB
Processingobject type SCHEMA_EXPORT/USER
Processingobject type SCHEMA_EXPORT/SYSTEM_GRANT
.....................................................
Processingobject type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
.. exported "ORCTSTU"."RES_APPROVE_CONTENT" 44.01 MB 350923 rows
.. exported "ORCTSTU"."RECEIPT_BILL" 569.3 MB 2064823 rows
.....................................................
.. exported "ORCTSTU"."ZS_PLAN_LEAVE_MESSAGE" 0 KB 0 rows
.. exported "ORCTSTU"."ZS_PLAN_MESSAGE" 0 KB 0 rows
Mastertable "ORCTSTU"."SYS_EXPORT_SCHEMA_02" successfullyloaded/unloaded
******************************************************************************
Dumpfile set for ORCTSTU.SYS_EXPORT_SCHEMA_02 is:
/home/oracle/expdpimpdp/TEST2_PD_20150518.dmp
Job"ORCTSTU"."SYS_EXPORT_SCHEMA_02" successfully completed at17:11:13
[oracle@edustu4~]$
9,开始使用import导入数据
9.1 清理旧数据
删除用户
drop user orctstu cascade;
删除表空间
drop tablespace orctstu including contents anddatafiles;
然后重启oracle
shutdown immediate
startup
查看磁盘空间,已经释放出来了
[oracle@edustu4 expdpimpdp]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 57G 21G 34G 38% /
tmpfs 12G 2.1G 10G 18% /dev/shm
/dev/sda1 194M 32M 153M 18% /boot
/dev/mapper/vg001-lv001
63G 12G 49G 20% /home/oradata
df:`/root/.gvfs': Permission denied
[oracle@edustu4expdpimpdp]$
9.2开始建立新用户
重新创建用户
createtablespace ORCTSTU
logging
datafile'/home/oradata/powerdes/orctstu01.dbf'
size50m
autoextendon
next50m
extentmanagement local;
CREATEUSER orctstu PROFILE "DEFAULT" IDENTIFIED BY "testpd2015" DEFAULT TABLESPACE ORCTSTU ACCOUNTUNLOCK;
GRANTconnect,resource TO orctstu;
grantdba to orctstu;
SQL>create tablespace ORCTSTU
logging
datafile'/home/oradata/powerdes/orctstu01.dbf'
size50m
autoextendon
next50m
extentmanagement local; 2 3 4 5 6 7
Tablespacecreated.
SQL>
SQL>CREATE USER orctstu PROFILE "DEFAULT" IDENTIFIED BY "testpd2015"DEFAULT TABLESPACE ORCTSTU ACCOUNT UNLOCK;
Usercreated.
SQL>GRANT connect,resource TO orctstu;
Grantsucceeded.
SQL>grant dba to orctstu;
Grantsucceeded.
SQL>
9.3 开始导入备份的数据
导入命令:
impdporctstu/testpd2015@PD1 directory=dir_dump_t1 dumpfile=TEST2_PD_20150518.dmpnologfile=y
导入过程如下:
......
Processingobject type SCHEMA_EXPORT/EVENT/TRIGGER
ORA-39082:Object type TRIGGER:"ORCTSTU"."LOGON_DENIED_TO_ALERT" createdwith compilation warnings
ORA-39082:Object type TRIGGER:"ORCTSTU"."LOGON_DENIED_TO_ALERT"created with compilation warnings
Processingobject type SCHEMA_EXPORT/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
Processingobject typeSCHEMA_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
Processingobject type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processingobject type SCHEMA_EXPORT/JOB
Processingobject type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
Job"ORCTSTU"."SYS_IMPORT_FULL_01" completed with 45 error(s)at 20:36:08
[oracle@edustu4admin]$
PS:impdp导入的时候,是从最大的表开始导入的,先导入数据,最后重建索引,导入各种其它objects。
10,报错记录
SQL> drop user orctstu cascade;
drop user orctstu cascade
*
ERROR at line 1:
ORA-04098: trigger 'ORCTSTU.LOGON_DENIED_TO_ALERT'is invalid and failed
re-validation
ORA-01940: cannot drop a user that iscurrently connected
SQL>
解决办法:直接lsnrctl stop;然后重新执行drop user操作