“The NSManagedObjectModel represents each object type in your app’s data model,
the properties they can have, and the relationships between them. Other parts of the Core Data stack use the model to create objects, store properties and save data.

As mentioned earlier in the book, it can be helpful to think about NSManagedObjectModel as a database schema. If your Core Data stack uses SQLite under the hood, NSManagedObjectModel represents the schema for the database.

However, SQLite is only one of many persistent store types you can use in Core Data (more on this later), so it’s better to think of the managed object model in more general terms.”



百度 到的

A schema is a collection of database objects (used by a user.).

schema objects are the logical structures that directly refer to the database’s data.

A user is a name defined in the database that can connect to and access objects.

schemas and users help database administrators manage database security.

从定义中我们可以看出schema为数据库对象的集合,为了区分各个集合,我们需要给这个集合起个名字,这些名字就是我们在企业管理器的方案下看到的许多类似用户名的节点,这些类似用户名的节点其实就是一个schema,schema里面包含了各种对象如tables views sequences stored procedures synonyms indexes clusters and database links。



一个用户一般对应一个schema 该用户的schema名等于用户名,并作为该用户缺省schema。这也就是我们在企业管理器的方案下看到schema名都为数据库用户名的原因。oracle数据库中不能新创建一个schema,要想创建一个schema,只能通过创建一个用户的方法解决(oracle中虽然有create schema语句,但是它并不是用来创建一个schema的),在创建一个用户的同时为这个用户创建一个与用户名同名的schema并作为该用户的缺省schema。即schema的个数同user的个数相同,而且schema名字同user名字一一 对应并且相同,所以我们可以称schema为user的别名,虽然这样说并不准确,但是更容易理解一些。