当前位置:Gxlcms > 数据库问题 > (转)oracle中schema指的是什么?

(转)oracle中schema指的是什么?

时间:2021-07-01 10:21:17 帮助过:61人阅读

[sql] view plain copy print?
  1. SQL> Gruant dba to scott  
  2.   
  3. SQL> create table test(name char(10));  
  4. Table created.  
  5.   
  6. SQL> create table system.test(name char(10));  
  7. Table created.  
  8.   
  9. SQL> insert into test values(‘scott‘);   
  10. 1 row created.  
  11.   
  12. SQL> insert into system.test values(‘system‘);  
  13. 1 row created.  
  14.   
  15. SQL> commit;  
  16. Commit complete.  
  17.   
  18. SQL> conn system/manager  
  19. Connected.  
  20.   
  21. SQL> select * from test;  
  22. NAME  
  23. ----------  
  24. system  
  25.   
  26. SQL> ALTER SESSION SET CURRENT_SCHEMA = scott; --改变用户缺省schema名  
  27. Session altered.  
  28.   
  29. SQL> select * from test;  
  30. NAME  
  31. ----------  
  32. scott  
  33.   
  34. SQL> select owner ,table_name from dba_tables where table_name=upper(‘test‘);  
  35. OWNER TABLE_NAME  
  36. ------------------------------ ------------------------------  
  37. SCOTT TEST  
  38. SYSTEM TEST  


--上面这个查询就是我说将schema作为user的别名的依据。实际上在使用上,shcema与user完全一样,没有什么区别,在出现schema名的地方也可以出现user名。
 

(转)oracle中schema指的是什么?

标签:font   href   strong   cluster   link   sdn   区分   bsp   create   

人气教程排行