1、导入dmp文件
2、导出数据
exp system/manager@ORCL file=d:\daochu.dmp full=y
3、创建临时表空间
create temporary tablespace DCMS_temp
tempfile 'i:\oracle\DCMS_TEMP.dbf'
size 10240m
autoextend on
next 10240m maxsize 20480m
extent management local;
4、创建表空间
create tablespace ZHCG
logging
datafile 'd:\oracle\ZHCG.dbf'
size 10240m
autoextend on
next 10240m maxsize 20480m
extent management local;
5、创建用户
create user ZHCG identified by ZHCG default tablespace ZHCG temporary tablespace temp;
6、用户赋权限
grant connect,resource,dba to ZHCG;
7、ORA-12899错误
原因:数据库编码格式和导入文件不同
解决办法:修改数据库编码格式
按照下面给出的命令依次执行就可以了,
SQL>SHUTDOWN IMMEDIATE
SQL>STARTUP MOUNT
SQL>ALTER SYSTEM ENABLE RESTRICTED SESSION;
SQL>ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
SQL>ALTER SYSTEM SET AQ_TM_PROCESSES=0;
SQL>ALTER DATABASE OPEN;
SQL> ALTER DATABASE CHARACTER SET ZHS16GBK ;
ALTER DATABASE CHARACTER SET ZHS16GBK
*ERROR at line 1:
ORA-12712: new character set must be a superset of old character set
报字符集不兼容,此时下INTERNAL_USE指令不对字符集超集进行检查:
SQL>ALTER DATABASE CHARACTER SET INTERNAL_USE ZHS16GBK;
SQL>SHUTDOWN IMMEDIATE
SQL>STARTUP
这时候,这个ORA-12899就已经彻底解决了,就可以进行数据的导入了...
8、ORA-01041:内部错误,hostdef扩展名不存在
导致的原因:
- shutdown immediate;
- startup;
关闭数据库,再打开的时候。
解决办法
- 关掉当前的sqlplus窗口
- 打开cmd窗口,输入sqlplus /nolog
- conn sys/orcl as sysdba;
- startup; 即可
9、查看oracle数据库的编码
SQL> select * from nls_database_parameters where parameter ='NLS_CHARACTERSET';
PARAMETER
--------------------
VALUE
--------------------
NLS_CHARACTERSET
AL32UTF8