US 7020655 B2
A database schema includes database classes that represent various database objects (e.g., tables, views, etc.) and user classes that represent users and roles of the database. The database schema also has permission classes that represent permissions of the users/roles with respect to the database objects. The permission classes are modeled in the database schema as associations between database classes and user classes.
1. One or more computer-readable media having computer-executable instructions for performing steps comprising:
creating a data structure in accordance with a schema, the schema defining at least one database class that represents a database object, at least one user class that represents a database user, and at least one permission class that represents permissions of the database user with respect to the database object, the permission class being modeled as an association between the database class and the user class; and
populating the data structure.
2. One or more computer-readable media as recited in
3. One or more computer-readable media as recited in
4. A computer comprising:
means for creating a data structure in accordance with a schema, the schema defining at least one database class that represents a database object, at least one user class that represents a database user 1 and at least one permission class that represents permissions of the database user with respect to The database object, the permission class being modeled as an association between the database class and the user class; and
means for populating the data structure.
5. A computer as recited in
6. A computer as recited in
This application is a continuation of U.S. patent application Ser. No. 09/789,329, filed Feb. 20, 2001, now U.S. Pat. No. 6,810,400, which claims priority to U.S. Provisional Application No. 60/249,495, filed Nov. 17, 2000.
This invention relates to databases, database management systems, and database management schemas.
Database management systems (DBMS) are core components of virtually every enterprise (e-business) application. The ability to effectively configure, monitor, and manage a DBMS is critical to the success of enterprise applications.
Most DBMSs are designed for compatibility with relational databases. A relational database comprises a plurality of tables. Each table has a plurality of data records (rows) and each table includes a definition of the fields (columns) that the records will contain. A relational database includes the specification of relationships between fields of different tables. A DBMS performs common management tasks such as creating databases, adding tables, replication management, data backup, etc.
The Desktop Management Task Force (DMTF) Common Information Model (CIM) is an approach to the management of systems, software, users, and networks that applies the basic structuring and conceptualization techniques of the object-oriented paradigm. More specifically, the purpose of CIM is to model various computer-related systems—both hardware and software. It is important to recognize that object-oriented modeling is different from object-oriented programming.
This type of modeling uses schemas to represent systems. A schema is an abstraction of something that exists in the real world. Generally, a schema comprises a collection of classes and associations.
A class models a set of objects that have similar properties and fulfill similar purposes. In a database management schema, for example, individual classes might define such things as files, users, tables, etc.
Classes follow a hierarchical structure. Classes can have subclasses, also referred to as specialization classes. The parent class of a subclass is referred to as a superclass or a generalization class. A class that does not have a superclass is referred to as a base class.
A typical schema might comprise a collection of different schemas, which in this case can also be referred to as subschemas. Such subschemas are often located in various different namespaces. A namespace is simply a way to logically group related data. Within a given namespace, all names are unique. Within the following disclosure, the terms “schema” and subschema are used interchangeably.
A subclass inherits properties of its superclass. All properties and methods of a superclass apply to the subclass.
It is conventional to represent a class by a rectangle containing the name of the class.
Classes contain instances that are collections of values that conform to the type established by the class. Instances are identified by keys that are unique within the class. In other words, no two instances in the same class in the same namespace may have the same values for all of their key values. The term “object” may be used to refer to either an instance or a class.
An association represents a relationship between two or more objects. More specifically, an association is a mechanism for providing an explicit mapping between classes. Associations can be within a namespace or across namespaces. Associations are conventionally shown as a line between two classes, as indicated by reference number 12 in
CIM schemas describe the gamut of managed elements: servers and desktops (operating systems, components, peripherals, and applications, all layers of the network (from Ethernet switches to IP and HTTP connections), and even end-users. Schema properties model the attributes that apply to objects, such as the type of printer or storage medium, RAM and CPU capacity, storage capacity, etc.
The discussion above gives a general overview of object-oriented modeling and CIM. Please refer to Winston Vumpus, John W. Sweitzer, Patrick Thompson, Andrea R. Westerinin, and Raymond C. Williams; Common Information Model, John Wiley & Sons, Inc., New York (2000) for further information regarding CIM. Also refer to Common Information Model (CIM) Specification, V2.0, Mar. 3, 1998, available from the Distributed Management Taskforce. DMTF has a number of other resources on its Internet web site.
A database schema described herein is an extension of the CIM core model. It has database classes that represent various database objects (e.g., tables, views, etc.) and user classes that represent users and roles of the database.
Unique to the database schema is a set of one or more permission classes that represent permissions of the users/roles with respect to the database objects. The permission classes are modeled in the database schema as associations between database object classes and user/role classes. By modeling the permissions as associations, the database schema effectively models methods of granting, denying, and revoking privileges. Additionally, the database schema provides a convenient way to query for users and roles that have permissions to utilize various database objects.
This disclosure addresses a database schema that is an extension schema of the Common Information Model (CIM) schema. In following discussion, the described database schema represents a relational database.
The database schema has a set of classes for various database objects (e.g., tables, views, databases, etc.), as well as classes for users and roles of the database. The database schema includes an abstract permission class that forms associations between the user or role classes and the database object classes. In this way, permissions for users and roles to use and access the database are established as associations between classes in the database schema.
Prior to describing the database schema, however, an exemplary computing environment is described to provide a context for implementing the schema.
Exemplary Computing Environment
Communication media typically embodies computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. By way of example, communication media includes wired media such as a wired network or direct-wired connection and wireless media such as acoustic, RF, infrared and other wireless media. Combinations of any of the above should also be included within the scope of computer readable media.
The computer 400 runs an operating system 420. The “Windows” brand of operating systems, available from Microsoft Corporation of Redmond, Wash., is one example of a suitable operating system. The computer 400 is also illustrated as running a database program 422, although this may be executed on a separate computer. The “Microsoft SQL Server” brand of database programs, also available from Microsoft Corporation, is an example of a suitable database program.
For illustration purposes, operating system 420 and database program 422 are shown as discrete blocks stored in the non-volatile memory 406, although it is recognized that such programs and components reside at various times in different storage components of the computer 400 and are executed by the processor 402. Generally, these software components are stored in non-volatile memory 406 and from there, are loaded at least partially into the volatile main memory 404 for execution on the processor 402.
The “Windows 2000” operating system includes a service known as “Windows Management Instrumentation” (WMI) 430. WMI is a management infrastructure for managing the operating system, applications, and computer hardware. It includes Microsoft's implementation of the Web-Based Enterprise Management (WBEM) initiative, an industry standard administered by the Distributed Management Task Force (DMTF). WMI provides an object-oriented way of monitoring, configuring and controlling systems, services, and applications on the Windows platform. WMI objects consist of classes and instances of classes. The WMI classes may be derived from standard classes defined in the Common Information Model (CIM). WMI provides services such as SQL query language support and programmable event notification.
To support CIM, WMI maintains a system management schema definition. In many cases, the schema definition is stored in the WMI repository. The schema contains a definition of the classes, along with the properties and methods of these classes. The classes in a schema may be declared in one or more namespaces.
In particular, the computer 400 supports a database schema 432 for use in WMI to represent manageable components of the SQL server database. Such managed objects include tables, files, configuration data, and other logical components. The database schema is located in its own namespace (e.g., root\MicrosoftSQLServer).
Exemplary Database Schema
It is noted that only pertinent classes and associations are illustrated. Other classes and associations (not shown) may also be included, but are not shown for ease of discussion. Furthermore, for discussion purposes, exemplary queries used in conjunction with the database schema are described in the context of Microsoft's SQL Server database software.
Database Object Superclass 500
The database object class 500 is an abstract class in that represents all database objects such as tables, columns, databases, and so forth. An “abstract” class is a base class for other classes to derive from, but is not populated with instances directly. As such, the database object class 500 is a superclass, and all other database classes are derived from this class. In
The database class 510 represents a database. In one exemplary implementation, the database class 510 represents an installation of Microsoft's SQL Server database software. The following queries can be used to enumerate all instances of a database in the Microsoft SQL Server installation named “MyServer\Instance2”:
Each database has various settings that are represented by a database setting class (not shown). Within the context of the exemplary SQL server database from Microsoft, the following queries can be used to obtain the settings of a fictitious “Northwind” database:
Each database has one or more tables or views, as represented by the table class 514 and the view class 518, respectively. The database properties include space available, status, version, and so forth.
The stored procedure class 512 represents stored procedures in the databases. Its properties include transact-SQL text, the type of stored procedure, etc.
Some database software, such as Microsoft's “SQL Server 2000”, supports user-defined functions and class 516 represents such functions. The user defined functions class 516 includes properties such as the text that defines the function, the name and status of the function and whether the function is defined by the system, etc.
User Object Superclass 502.
The user object class 502 models information pertaining to database users and roles. The user object class 502 is a superclass to two subclasses: a user subclass 520 and a role subclass 522. The user class 520 represents database users. Its properties include login name,. . . . The following query returns the login record used to authenticate a user:
The role class 522 represents the roles defined for a database installation. It is an abstract superclass from which two subclasses are derived: a server role subclass 530 and a database role subclass 532. The server role class 530 represents roles that are not constrained to a single database. Each server role is associated with one or more login objects (not shown) so that a user authenticated by login can assume the server role associated with the login. The following query yields the members of a server role class 530:
The database role class 532 represents all roles defined for a database installation. The members of the database role can be a database user or another database role.
Permission Class 504 as Associations
The permission class 504 is an association-type class that associates a user or a role with a database object, such as a table, view, and database. The properties of the association class 504 capture the privileges that have been granted or denied to the user or role. Its properties represent the privilege type granted by the existence of the association and a Boolean indicating whether the privilege is currently active or not.
Various permission associations are derived from the permission class. In
The permission associations between the database object classes 510–518 and the user class 520 include a user-database permission association 540, a user-stored procedure permission association 542, a user-table permission association 544, a user-user defined function permission association 546, and a user-view permission association 548. These permission associations represent permissions that users have for various database objects. For instance, the user-database permission association 540 represents the permissions that users have for the database and the user-table permission association 544 represents the permissions that users have for various tables.
The permission associations between the database object classes 510–518 and the role class 532 include a database role-database permission association 550, a database role-stored procedure permission association 552, a database role-table permission association 554, a database role-user defined function permission association 556, and a database role-view permission association 558. These permission associations represent permissions that database roles have for the database objects.
Each permission association is a class that has its own properties.
Accordingly, by modeling the privileges as associations, the database schema 432 effectively models methods of granting, denying, and revoking privileges. For example, the database role-table permission association 554 represents the permissions that a database role has for a table. In the context of the Microsoft “SQL” database, creating an instance of the database role-table permission association 554 with the privilege type property set to a certain value and the granted property set to “true” effectively grants privileges to the database role for accessing the table.
Additionally, the database schema 432 formulates a convenient way to query for users and roles that have been granted privileges to utilize various database objects. Performing the following query, for example, returns the list of database roles with database privileges:
The results of the following query yields a list of permissions for the table object:
The name “[dbo].[categories]” is the name of a stored procedure.
The following query determines whether a particular user “User1” has permission to a database table object:
Accordingly, the permission class efficiently models the permissions for various database objects as well as facilitates convenient queries as to which privileges have been granted to whom and for which resource.
Although details of specific implementations and embodiments are described above, such details are intended to satisfy statutory disclosure obligations rather than to limit the scope of the following claims. Thus, the invention as defined by the claims is not limited to the specific features described above. Rather, the invention is claimed in any of its forms or modifications that fall within the proper scope of the appended claims.
Citations de brevets