oracle操作.txt 905 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. 查看所有表(plsql此用户登录后)//查此用户下
  2. select table_name from user_tables;
  3. //统计所有表
  4. select count(table_name) from user_tables;
  5. --删除表空间
  6. DROP TABLESPACE bjhts INCLUDING CONTENTS AND DATAFILES;
  7. DROP TABLESPACE bjhts_temp INCLUDING CONTENTS AND DATAFILES;
  8. --删除用户
  9. drop user bjhts cascade
  10. --创建表空间
  11. create temporary tablespace bjhts_temp
  12. tempfile 'D:\oracle\tablespace\bjhts_temp.dbf'
  13. size 1024m
  14. autoextend on
  15. next 1024m maxsize 2048m
  16. extent management local;
  17. create tablespace bjhts
  18. logging
  19. datafile 'D:\oracle\tablespace\bjhts.dbf'
  20. size 1024m
  21. autoextend on
  22. next 1024m maxsize 10240m
  23. extent management local;
  24. --创建用户(用户在表空间下)
  25. create user bjhts identified by bjhts
  26. default tablespace bjhts
  27. temporary tablespace bjhts_temp;
  28. grant connect,resource,dba to bjhts;
  29. --执行命令导入dmp
  30. imp userid=用户名/密码@orcl file=d:\xxx.dmp full=y