1:若是要导入的用户下有空表,须要执行下面语句sql
select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0
查询出的数据拷出来,再次执行数据库
2:cmd进入命令,导出ide
-
导出用户全部的表到D盘:
exp aa/1234 file=D:\biao.dmp owner=aa;
-
-
导出用户aa中的表dept到D盘:
exp aa/1234 file=d:\dept.dmp tables=(dept);
-
-
导出用户aa中的表dept,emp到D盘:
exp aa/1234 file=d:\dept.dmp tables=(dept,emp);
3:删除原有用户ui
-
-
drop user aa cascade
4:建立用户spa
-
create user aa identified by 1234;(aa:用户名,1234:密码)
-
-
5:导入code
-
-
imp aa/
1234 file=d:\biao.dmp full=y
-
-
将用户aa中表dept中的数据导入到用户bb的dept表中:
-
imp bb/
1234 file=d:\dept.dmp tables=(dept) ignore=y full=y
总结:get
-
exp smart/smart file=D:\smart.dmp owner=smart;
-
-
create user smart identified by smart;
-
grant dba,connect to smart;
-
imp smart/smart file=d:\smart.dmp full=y;
===================================
select * from dba_users; 查看数据库里面全部用户,前提是你是有dba权限的账号,如sys,systemcmd
select * from all_users; 查看你能管理的全部用户!string
select * from user_users; 查看当前用户信息 !table