mysql和oracle的 user,schema,database怎么區分?


最開始的文件系統,只有一個文件夾,所有文件都扔進去,這個時候會有一個限制:文件不能有重復的命名,但后來文件系統發明了“文件夾嵌套”,只要不在同一個目錄下,“文件名”或者“文件夾名字”是可以使用同樣的名字的

數據庫都會做這樣的划分,根據最正宗的SQL標准,是這樣划分的:Cluster > Catalog > Schema > Table 

 

但並不是所有的“數據庫供應商”都按照這個標准,比如MySQL的show databases命令,卻發現infromation_schema都出來了,因為對於MySQL而言,“database 數據庫” 和 “schema 模式” 是同一件事,所以MySQL可以擁有很多個數據庫,但是對於Oracle,卻只有一個orcl數據庫。具體區分如下表

 

In MySQL:

  • server instance == not identified with catalog, just a set of databases
  • database == schema == catalog == a namespace within the server.
  • user == named account, who is can connect to server and use (but can not own - no concept of ownership) objects in one or more databases
  • to identify any object you need (database name + object name)

 

In Oracle:

  • server instance == database == catalog == all data managed by same execution engine
  • schema == namespace within database, identical to user account
  • user == schema owner == named account, identical to schema, who can connect to database, who owns the schema and use objects possibly in other schemas
  • to identify any object you need (schema name + object name)

 

詳細閱讀:

1.What's the difference between a catalog and a schema in a relational database?

2.Relationship between catalog, schema, user, and database instance


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM