exp kfsalary/a@218.76.22.161:61521/orcl file=D:\salary.dmp
---用PLSQL oracle import导入 不然报错
imp kfsalary/a@127.0.0.1:1521/orcl file=D:\salary.dmp full=y
--删除用户 连代表删
drop user ELEMENT cascade;
--查看用户
select * from dba_users ;
---删除表空间:
drop tablespace GRP including contents and datafiles CASCADE CONSTRAINTS;
--查看表空间地址
select * from dba_data_files;
--建表空间
create tablespace GRP datafile 'GRP.DBF'
size 5m autoextend on next 2m;
--建数据库用户
create user kfsalary identified by "a"
default tablespace GRP
temporary tablespace temp;
grant connect to kfsalary;
grant resource to kfsalary;
grant dba to kfsalary;
--用户导入导出目录
create or replace directory baoGRP as 'd:\work\oracledb';
Grant read,write on directory baoGRP to kfsalary;
SELECT privilege, directory_name, DIRECTORY_PATH FROM user_tab_privs t, all_directories d
WHERE t.table_name(+) = d.directory_name ORDER BY 2, 1;
--不导出空表的问题
select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0