export user/password@orcl file=expdat.dmp log=expdat.log
EXP-00091: Exporting questionable statistics
引起此问题的原因是数据库字符集和操作系统的NLS_LANG不一致导致
处理方法:
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.AL32UTF8
设置操作系统的NLS_LANG值
vi ~/.bashrc
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
source
重新运行数据库导出命令
export user/password@orcl file=expdat.dmp log=expdat.log
导出
select * from dba_directories;
CREATE DIRECTORY dump_name AS 'F:\oracle\dump';
GRANT READ,WRITE ON DIRECTORY dump_name TO user_name;
expdp scott/tiger@oracle directory=dump_name dumpfile=scott.dmp schemas=scott
或者
expdp scott/tiger@oracle dumpfile=dump_name:scott_full.dump logfile=dump_name:scott.log schemas=scott
导入前清理
drop user user_name cascade;
ORA-01940: 无法删除当前连接的用户
方法一:
alter user user_name account lock;
select saddr,sid,serial#,paddr,username,status from v$session where username = 'user_name';
alter system kill session 'sid,serial#'; status=INACTIVE
方法二:PL/SQL 中打开Sessions管理,把Username的Kill
drop tablespace user_name including contents and datafiles;
drop tablespace user_name_tmp including contents and datafiles;
导入
CREATE TABLESPACE user_name DATAFILE 'user_name.dbf' SIZE 512M autoextend on;
CREATE temporary TABLESPACE user_name_tmp tempFILE 'user_name_tmp.dbf' SIZE 100M autoextend on;
CREATE USER user_name IDENTIFIED BY password_123 DEFAULT TABLESPACE user_name TEMPORARY TABLESPACE user_name_tmp;
GRANT DBA TO user_name WITH ADMIN OPTION;
ALTER USER user_name DEFAULT ROLE DBA;
select * from dba_directories;
GRANT READ,WRITE ON DIRECTORY dump_name TO user_name;
impdp user_name/password_123 DIRECTORY=DMPDIR DUMPFILE=expdp1207.dmp logfile=impdp1207.dmp SCHEMAS=user_name
欢迎转载,但请注明内容的来源或URL;
“[转]”篇章,必须保留原始来源且勿添加本blog指向。