Isolated and layered runtime environment for multi-tenant databases
By establishing database nesting for each pluggable database and using the operating system namespace for resource isolation, the problem of how to improve security and isolation in multi-tenant container DBMS is solved, achieving higher security and resources Isolation effect.
Patent Information
- Application Number
- CN201980077483.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-10-19
- Filing Date
- 2019-10-18
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2039-10-18
AI Technical Summary
In multi-tenant container DBMS, how to provide custom operating system restrictions and settings for each database nest without using a separate virtual machine for improved security and isolation.
By establishing database nesting for each pluggable database and using the operating system namespace to isolate computer resources, limiting the access scope of database session processes, hierarchical isolation of database objects and system resources is achieved.
Achieve higher security and isolation, prevent malicious tenants from accessing other tenants' database processes and resources, and enhance the security of multi-tenant environments.
Smart Images

Figure CN113168406B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to isolating system resources for pluggable databases maintained within a CDB. More specifically, the present invention relates to single-node and multi-node database management systems that allow pluggable databases to be accessed through their own containerized database nesting even when multiple pluggable databases are maintained by a single CDB. Background Art
[0002] The approaches described in this section are approaches that could be pursued, but are not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any approach in this section qualifies as prior art merely by virtue of its inclusion in this section. Summary of the invention
[0003] A database management system (DBMS) manages databases. A DBMS may contain one or more database servers. A database includes database data and a database dictionary, which are stored on a persistent storage mechanism such as a collection of hard disks. Database data may be stored in one or more data containers. Each container contains records. The data in each record is organized into one or more fields. In a relational DBMS, data containers are called tables, records are called rows, and fields are called columns. In an object-oriented database, data containers are called object classes, records are called objects, and fields are called attributes. Other database architectures may use other terms.
[0004] A user interacts with the database server of a DBMS by submitting commands to the database server that cause the database server to perform operations on the data stored in the database. A user may be one or more applications running on a client computer that interacts with the database server. Multiple users may also be collectively referred to as users in this article.
[0005] Database commands may be in the form of database statements that conform to a database language. The database language used to express database commands is Structured Query Language (SQL). SQL has many different versions, some standard, some proprietary, and with a variety of extensions. Data Definition Language ("DDL") commands are issued to a database server to create or configure database objects, such as tables, views, or complex data types. SQL / XML is a common extension of SQL used when manipulating XML data in an object-relational database.
[0006] A client can issue a series of requests, such as requests to execute queries, to a DBMS by establishing a database session. A database session includes a specific connection to a database server established for a client, through which a client can issue a series of requests. A database session process executes in a database session and handles requests issued by a client through the database session. A database session can generate an execution plan for a query issued by a database session client and marshal slave processes to execute the execution plan.
[0007] A database server may maintain session state data about a database session. The session state data reflects the current state of the session and may include the identity of the user for whom the session was established, services used by the user, instances of object types, language and character set data, statistics about resource usage for the session, values of temporary variables generated by processes executing software in the session, storage of cursors, variables, and other information.
[0008] The database server includes multiple database processes. The database processes run under the control of the database server (i.e., can be created or terminated by the database server) and perform various database server functions. The database processes include processes running in a database session established for a client.
[0009] A database process is an execution unit. A database process can be an operating system process or an operating system thread or a user-defined execution context, such as a user thread or fiber. Database processes can also include "database server system" processes that provide services and / or execute functions on behalf of the entire database server. Such database server system processes include listeners, garbage collectors, log writers, and recovery processes.
[0010] A multi-node database management system consists of interconnected nodes, each of which runs a database server that shares access to the same database. Typically, the nodes are interconnected via a network and share access to shared storage to varying degrees, such as shared access to a collection of disk drives and data blocks stored thereon. The nodes in a multi-node database system may take the form of a group of computers (e.g., workstations, personal computers) interconnected via a network. Alternatively, the nodes may be nodes of a grid, which consists of nodes in the form of server blades interconnected to other server blades on a rack.
[0011] Each node in a multi-node database system hosts a database server. A server, such as a database server, is a combination of integrated software components and an allocation of computing resources, such as memory, nodes, and processes on the nodes for executing the integrated software components on processors, that are dedicated to performing specific functions on behalf of one or more clients.
[0012] Resources from multiple nodes in a multi-node database system can be allocated to software running a particular database server. Each combination of software and resource allocation from a node is a server referred to herein as a "server instance" or "instance." A database server can include multiple database instances, some or all of which run on separate computers including separate server blades.
[0013] The database dictionary may include multiple data structures that store database metadata. The database dictionary may, for example, include multiple files and tables. Portions of the data structures may be cached in the main memory of the database server.
[0014] When a database object is said to be defined by a database dictionary, the database dictionary contains metadata that defines the characteristics of the database object. For example, metadata in a database dictionary that defines a database table may specify the column names and data types of the columns, and one or more files or portions thereof that store the data for the table. Metadata in a database dictionary that defines a procedure may specify the name of the procedure, its parameters and return data type, and the data types of the parameters, and may include source code and its compiled version.
[0015] Database objects may be defined by a database dictionary, but metadata in the database dictionary itself may only partially specify characteristics of the database objects. Other characteristics may be defined by data structures that may not be considered part of the database dictionary. For example, a user-defined function implemented in a JAVA class may be defined in part by a database dictionary by specifying the name of the user-defined function and by specifying references to files containing the Java class source code (i.e., .java files) and the compiled version of the class (i.e., .class files).
[0016] Multi-tenant architecture
[0017] Container DBMS is a powerful mechanism for database consolidation. Container DBMS provides a high degree of computer resource sharing while also providing a high degree of isolation. Container DBMS is based on "containers". A container is a collection of schemas, objects, and related structures in a multi-tenant container database (CDB) that logically appears to be a separate database to the application. Within a CDB, each container has a unique ID and name. The root database and each pluggable database (PDB) are considered containers. A container DBMS can contain many PDBs. PDBs isolate data and operations so that from the user or application perspective, each PDB looks like a traditional non-CDB. Each PDB is defined by its own separate database dictionary, which defines the database objects within the PDB. Users can access PDBs within a container DBMS by establishing a database session for the PDB.
[0018] The container DBMS stores the system metadata required to manage all PDBs within the container DBMS. In some embodiments, the root database of the container DBMS stores data that is common between the PDBs of the container DBMS, such as definitions for common users and roles, shared tables, code packages, etc. The PDB contains a collection of user-created schemas, objects, and related structures, which logically appear to be separate databases for applications. Therefore, each PDB can potentially be used to store data related to different applications, such as one PDB dedicated to hosting human resources applications, and another PDB dedicated to hosting sales applications. However, since shared database resources are only stored once in the root database and linked by the database dictionary of the PDB, duplication of data is avoided compared to using a completely separate traditional database to host each application. In addition, since the PDB is essentially a self-contained database by itself, the PDB can be easily transferred between different CDBs for upgrade or load balancing purposes.
[0019] CDB enables amortization of computer resources ("resource amortization"). The computer resources required to provision and host a PDB are actually amortized across multiple PDBs within the CDB. This reduces the computer resources required for each PDB.
[0020] In a container DBMS, the database server system process is not dedicated to each PDB, but serves multiple PDBs within a CDB. Therefore, the overhead of the database server system process is amortized across multiple PDBs in a CDB.
[0021] The container DBMS provides isolation, at least to a certain extent. A database session established for a PDB can be limited to accessing or otherwise viewing database objects defined for the PDB by the PDB-specific database dictionary.
[0022] Container DBMS can implement various levels of isolation. While database objects can be isolated between database sessions of a PDB, various computing resources can be shared between database sessions of a PDB. Therefore, hosting multiple PDBs on the same database server enables the computing resources of the database server or instance to be shared between multiple PDBs.
[0023] With a multi-tenant architecture, servers within a single operating system instance are used to run multiple CDBs and PDBs. By using a single operating system instance, resources managed by the operating system can be shared, including compute resources, file systems, and network resources. However, sharing such resources among multiple tenants exposes vulnerabilities to malicious tenants. Processes belonging to one tenant can potentially access other tenant database processes, tamper with tenants' resources, and interfere with execution. This article describes techniques for isolating runtime environments in a multi-tenant container DBMS. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In the attached picture:
[0025] Figure 1 An example computer networking environment is illustrated upon which embodiments may be implemented.
[0026] Figure 2 is a diagram depicting a CDB according to an embodiment of the present invention.
[0027] Figure 3 An example diagram of a nested hierarchy of a database according to an embodiment of the present invention is illustrated.
[0028] Figure 4 An example structure of a database nested execution model according to an embodiment of the present invention is illustrated.
[0029] Figure 5 Depicts a process that includes operations performed to establish a database session for a pluggable database.
[0030] Figure 6 is a diagram depicting a software system upon which embodiments of the present invention may be implemented.
[0031] Figure 7 is a diagram depicting a computer system that may be used in embodiments of the present invention. DETAILED DESCRIPTION
[0032] In the following description, for the purpose of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. However, it will be apparent that the present invention can be practiced without these specific details. In other cases, well-known structures and devices are shown in block diagram form to avoid unnecessarily obscuring the present invention.
[0033] To provide increased security to tenants residing in a multi-tenant CDB architecture, database sessions for pluggable databases run within a "database nest". A database nest is a collection of operating system computer resources to which access is restricted for a database session of a particular database. When a database session process executing within a database session is restricted to a collection of operating system resources by a database nest, the database session is restricted to that collection of operating system resources. A database session process includes subordinate processes that are marshaled to execute queries issued within the database session.
[0034] Operating system computer resources are computer resources that are accessible via and / or managed by the operating system. Operating system computer resources include processes, memory, network resources, file systems, subdirectories therein, and the CPU.
[0035] According to an embodiment, a database nest is established for each pluggable database. Each database nest contains a separate set of computer resources. A database session of a pluggable database can access resources of the corresponding database nest of the pluggable database, but cannot access resources of the database nest of another pluggable database. In this way, operating system resources of tenants of a pluggable database are isolated from operating system computer resources of other tenants of other pluggable databases.
[0036] Multiple container DBMSs can be hosted on a database server and its operating system. Each container DBMS can be restricted to a corresponding separate database nest. The database sessions of each container DBMS and the PDBs therein are isolated from the database nest of the container DBMS and from the computer resources of the database nests of other container DBMSs. The database service processes of each container DBMS are also isolated to the corresponding database nest.
[0037] A PDB can be added to a container DBMS, which may require creating a database nest for the PDB. The database nest created for the new PDB is limited to the computer resources of the database nest of the container DBMS.
[0038] Hierarchical database nesting and isolation
[0039] In an embodiment, a container DBMS may include a hierarchy of PDBs of a type that uses what is referred to herein as an "application root." Similar to the root database of a container DBMS, an application root stores data and metadata that is shared between the member PDBs of the application root. An application root and its member PDBs are collectively referred to as an "application container." Common data and metadata used by an application may be stored in the application root, rather than separately in each member PDB. Application roots are further described herein.
[0040] An application root can have a database nest. A member PDB of an application root can also have a database nest, which is limited to the computer resources of the database nest of the application root.
[0041] The container DBMS, application roots, and their member PDBs form a hierarchy. The isolation between database objects in the container DBMS, application roots, and member PDBs mirrors this hierarchy. A database session for a given PDB contained within a given application root cannot access data objects in another application root or other member PDBs of another application root. Furthermore, a database session for a given PDB contained within a given application root cannot access data objects in member PDBs of the application root.
[0042] The database nesting established for the container DBMS, application root, and member PDBs also forms a database nesting hierarchy that mirrors the hierarchy of PDBs within the container DBMS. The isolation between computer resources provided by the database nesting hierarchy also mirrors the isolation hierarchy between database objects provided by the hierarchy between PDBs within the container DBMS.
[0043] Per PDB / Nested OS Configuration
[0044] Additionally, to further enable secure computing, having separate database nests makes it possible to have customized operating system restrictions and settings for each database nest without using separate virtual machines. For example, each database nest can have its own system call whitelist or blacklist that are only allowed for pluggable databases restricted by the corresponding database nest.
[0045] As previously mentioned, embodiments of the present invention are implemented within a container DBMS. Therefore, a brief description of the container DBMS is useful.
[0046] General operating environment
[0047] Figure 1 An example computer networking environment is illustrated upon which embodiments may be implemented. Figure 1 Only a specific number of each element is depicted, but a real environment may have many more (perhaps hundreds or thousands) Figure 1 Each element shown in .
[0048] exist Figure 1 In the present invention, database server 100 represents a combination of software and resources on one or more computing devices that are communicatively coupled to databases (CDB 103, CDB 104) and to each other and to database client 107 via network 106. Database server 100 runs an operating system instance. Examples of operating system instances are described below in "Software Overview". CDB 103 and CDB 104 are collectively referred to as "CDBs". Examples of computing devices on which a database server can be implemented are described below in "Hardware Overview".
[0049] In an embodiment, network 106 represents one or more local area networks, wide area networks, internetworks, or service provider networks. In some embodiments, network 106 represents the Internet.
[0050] In an embodiment, database client 107 represents a combination of software and resources on one or more computing devices that implement one or more applications that send commands to a database server to retrieve, modify, delete, or submit data stored by a CDB. Examples of computing devices on which a database server may be implemented are described below in "Hardware Overview".
[0051] CDB
[0052] Figure 2 The diagram illustrates an example structure for a general container DBMS according to an embodiment. For the sake of illustrating a clear example, the CDB 103 is described. Figure 2 , however, the description also applies to CDB 104.
[0053] CDB 103 includes multiple databases hosted and managed by database server 100. The databases include pluggable database PDA 220 and pluggable database PDB 230, as well as root database 210, which is associated with pluggable database PDA 230 and pluggable database PDB 230, as will be described in more detail below. In other embodiments, CDB 103 may include more than Figure 2 The number of pluggable databases depicted in the .
[0054] The pluggable database PDA 220 includes a database dictionary 221. The data of the database objects for the pluggable database PDA 220 are stored in a table space file 226.
[0055] The pluggable database PDB 230 includes a database dictionary 231. A tablespace file 236 stores data for database objects of the pluggable database PDB 230.
[0056] The database server 100 responsible for the CDB 103 can establish a database session for the root database 210 or any member pluggable database. The database dictionary of the PDB for which the database session is established determines the scope of commands issued by the database client 107 (e.g., which database(s) the command will be executed on), which permissions are checked, which database dictionaries will be used for the session, etc. A database session established for a PDB may be referred to herein as running within the PDB. A database session established for a root database is referred to herein as running with the CDB or a container DBMS of the CDB.
[0057] Root database
[0058] Root database 210 is a database used by database server 100 to globally manage CDB 103. An important function facilitated by root database 210 is to define pluggable databases within CDB 103. Similar to pluggable databases, root database 210 includes database dictionary 211. The database dictionary of the root database may be referred to herein as the root database dictionary. Database dictionary 211 contains metadata that defines various aspects of CDB 103 required to manage CDB 103 and the pluggable databases contained therein. The data of the database objects defined by database dictionary 211 is stored in tablespace files 216.
[0059] The database dictionary 211 defines the pluggable database in terms of CDB 103 or the characteristics of the pluggable database. The property PluggableDB is the name or label of the pluggable database.
[0060] The records in the database dictionary 211 define pluggable databases, and which database nest each pluggable database is assigned to. For example, one record in the database dictionary 211 defines a pluggable database PDA 220 and its database nest NEST A. Another record in the database dictionary 211 defines a pluggable database PDB 230 and its database nest NESTB. The pluggable databases and corresponding database nest assignments may also be stored in a dictionary storage file, such as PDA.DBIDC and PDB.DBIDC. The database dictionaries 221, 231 may also define which database nest each pluggable database is assigned to. In an embodiment, two or more pluggable databases may be assigned to a single database nest.
[0061] Pluggable database sessions
[0062] A user can access a PDB in CDB 103 by submitting a connection request that identifies the PDB. In response to receiving the request, database server 100 establishes a database session for the PDB. Establishing a database session for the PDB requires establishing the database dictionary of the PDB as the database dictionary of the database session. Once the PDB dictionary is established as the database dictionary of the PDB, access to the database objects of the PDB and to the public database objects of the root database will be isolated, as will be described in further detail. Establishing the PDB dictionary as the database dictionary of the database session may be referred to herein as attaching the database dictionary to the database session.
[0063] With respect to PDB objects in one or more PDBs of a CDB, database commands issued to a database session attached to a PDB dictionary can only access PDB objects defined by the PDB dictionary. Thus, access for a user of a database session may be restricted to access to PDB objects defined by the attached PDB dictionary, thereby isolating database access to PDB objects from access in the corresponding PDB. This isolation applies not only to end users but also to administrators of the PDB.
[0064] For example, in response to a connection request to access the pluggable database PDA 220, the database dictionary 221 is attached to the database session. Database commands issued in the database session are executed against the database dictionary 221. Access to pluggable database objects through data manipulation language (DML) commands issued in the database session is isolated to the pluggable database objects defined by the database dictionary 221. Isolation is achieved in the same manner by concurrently executing database sessions with the pluggable database PDA or pluggable database B.
[0065] Figure 3 An example diagram of a CDB is shown, which includes application roots, thereby forming a hierarchy of PDBs. Database hierarchy 302 depicts such a hierarchy. As shown, CDB 304 contains two direct children - application root 306 and application root 308. Each of application root 306 and application root 308 contains two direct children - application PDB 310, application PDB 213 and application PDB 314, application PDB 316, respectively. As described in relation to Figure 2 As discussed, each root database, such as application root 306 and application root 308, includes a database dictionary that defines the pluggable databases and to which database nest each pluggable database is assigned.
[0066] Nested database hierarchies
[0067] The database nesting hierarchy of database hierarchy 302 reflects the hierarchical structure of the database hierarchy. Parent CDB nest 322 contains application root nest 324 and application root nest 326 corresponding to application root 306 and application root 308, respectively. Each of parent application root nest 324 and application root nest 326 contains two direct children—application PDB nest 328, application PDB nest 330 and application PDB nest 332, application PDB nest 334, respectively. Each of application PDB nest 328, application PDB nest 330, application PDB nest 332, application PDB nest 334 is a database nest corresponding to application PDB 310, application PDB 312, application PDB 314, and application PDB 316, respectively, in the database hierarchy diagram.
[0068] The parent database nest contains the resources of any child database nests and descendant database nests. The computer resources of CDB nest 322 contain the computer resources of application root nest 324 and application root nest 326. Application root nest 324 contains the computer resources of application PDB nest 328 and application PDB nest 330.
[0069] Each database nest can be assigned its own set of process, file, memory, and system call limits. This system resource isolation can be achieved using the operating system namespace described below. A database session of a PDB running in a database nest cannot access processes and resources in another database nest of another PDB.
[0070] In addition, database nests employ a hierarchical privilege structure. Generally speaking, descendant database nests are completely isolated from other descendant database nests, while ancestor database nests are allowed privileges to any database nests inherited from the ancestor database nest. For example, database server processes and database sessions of the container DBMS of CDB 304 run within CDB nest 322. Because CDB nest 322 is the ancestor of application root nest 324, application root nest 326, application pdb nest 328, application pdb nest 330, application pdb nest 332, and application pdb nest 334, the database server processes and database sessions of the container DBMS have privileges to access all resources assigned to descendant database nests (such as application root nest 324, application root nest 326, application pdb nest 328, application pdb nest 330, application pdb nest 332, and application pdb nest 334).
[0071] In addition, a database session assigned application root 306 of nested application pdb nest 324 has privileges to access computer resources of application PDB nest 328 and application PDB nest 330, but does not have privileges to access computer resources of application root nest 326 and its descendants, application PDB nest 332 and application PDB nest 334. A database session assigned application PDB 310 of nested application pdb nest 328 does not have privileges to access computer resources of any other database nests of database nesting hierarchy 320.
[0072] Namespace
[0073] According to an embodiment, database nesting is achieved by using operating system namespaces. Operating systems such as Linux support isolation features such as namespaces. Namespaces are features supported by many operating systems (such as Linux) for isolating the operation of multiple processes from other processes running within the same computer system. An operating system kernel (such as Linux) provides the ability to programmatically create different types of "namespaces" (such as, "process identification" namespaces and "network" namespaces). For example, when creating a "process identification" or "PID" namespace, processes belonging to the namespace can only see other processes that have been created in the same namespace. Other operating systems also support isolation features, such as namespaces. Additional non-limiting examples of operating systems that include network isolation features (such as namespaces) are Solaris zones and Windows server containers.
[0074] Similarly, when you create a "network" namespace, processes belonging to that namespace can only see the network sockets, bound ports, interfaces, routing tables, etc. defined for that namespace. In effect, creating a namespace creates a network stack. Processes within a network namespace are limited to their own set of network sockets, bound ports, interfaces, routing tables, etc. defined for that namespace.
[0075] Network namespaces partition the use of a network—devices, addresses, ports, routes, firewall rules, etc.—into separate logical boxes, essentially virtualizing the network within a single running kernel instance. Each network namespace has its own network devices, IP addresses, TCP / UDP ports, and routing tables. Each network namespace can be configured with a unique routing table and / or firewall rules. As described herein, each network namespace provides a copy of the network stack.
[0076] Other processes outside of the network namespace cannot access these network resources or even know that these network resources exist. In addition, processes assigned to the namespace cannot monitor or view traffic related to another network namespace.
[0077] Operating systems such as Linux provide several other types of namespaces. For example, a mount namespace isolates a process from mounted filesystems. A mount namespace is the set of mounted filesystems that a process can access. This set may be different from a process running locally on the host or from a process running in another namespace, which may have its own set of mounted filesystems. A process inside a mount namespace can change its set of mounted filesystems without affecting processes running outside the namespace.
[0078] UTS namespaces allow a single system to appear to have different host names and domain names to different processes. UTS namespaces isolate host names from Network Information Service (NIS) domain names. Host names in a namespace can be changed without affecting the host name of the host itself. UTS namespaces can be used to isolate host names.
[0079] IPC namespaces isolate certain interprocess communication resources, such as Portable Operating System Interface (POSIX) message queues and System V interprocess communication (IPC) mechanisms. IPC namespaces isolate processes from System V-style interprocess communication. This prevents processes in different IPC namespaces from using, for example, the Shared Memory (SHM) family of functions to establish a range of shared memory between two processes. Instead, each process can use the same identifier for the shared memory region and create two such unique regions.
[0080] PID namespaces isolate the process ID number space, which means that processes in different PID namespaces can have the same PID. Using PID namespaces, a single process can have multiple PIDs associated with it, one for each namespace it belongs to. PID namespaces are nested, which means that when a new process is created, it will have a PID for each namespace from its current namespace up to the initial PID namespace. Therefore, the initial PID namespace is able to see all processes, although it will see processes with different PIDs from other namespaces. PID namespaces provide features such as suspending / resume a collection of processes in a container and migrating a container to a new host while the processes inside the container maintain the same PID.
[0081] User namespaces isolate user IDs and group IDs between the host and the container. User namespaces allow a process to have root privileges within the namespace without granting it access to processes outside the namespace. Additionally, user namespaces provide privilege isolation and user identity separation between multiple sets of processes. Similar to PID namespaces, user namespaces are nested, and each new user namespace is considered a child of the user namespace in which it was created. User namespaces contain mapping tables that translate user IDs from the container's point of view to the system's point of view. This allows, for example, the root user to have user ID 0 in a container, but actually be seen by the system as user ID 1,800,000 for ownership checks.
[0082] Database nested resources
[0083] A database nest can provide file system isolation, such as limiting the file system(s) that processes associated with a PDB can access. Namespaces can be used as a mechanism to achieve this isolation. For example, a database nest can be assigned its own mount namespace that limits the mounted file systems that processes running in the database nest can access.
[0084] Database nesting can provide inter-process communication isolation, such as isolating resources such as POSIX message queues and System V IPC mechanisms between processes.
[0085] The database nest may provide memory isolation, such as limiting which memory segments a process running in the database nest may access.
[0086] Database nesting can also provide system restrictions for executing system calls. For example, database nesting can prevent the execution of certain system calls, and can also only allow the execution of certain system calls.
[0087] Figure 4 The diagram illustrates an example structure of a database nested execution model according to an embodiment. For the sake of illustrating a clear example, the CDB 404 is described as follows: Figure 4 .
[0088] CDB nest 402 includes multiple databases hosted and managed by database server 100. The databases include CDB 404, pluggable database PDA 406, and pluggable database PDB 408. In other embodiments, CDB 103 may include more than Figure 4 However, due to inherent hardware limitations, some implementations may set an upper limit on the number of pluggable databases that CDB 103 can support.
[0089] Each database CDB 404, PDA 406, PDB 408 is contained by one or more database nests. For example, CDB 404 is contained by CDB nest 402, pluggable database PDA 406 is contained by PDA nest 410, and pluggable database PDB 408 is contained by PDB nest 412. In addition, CDB nest 402 contains pluggable database PDA 406 and pluggable database PDB 408 as related Figure 3 Part of a nested hierarchy of the database in question.
[0090] In each database nest CDB nest 402, PDA nest 410, PDB nest 412, various namespaces are used to restrict system resources and isolate them from the operating system 414. For example, CDB nest 402 restricts database processes 416, 418, 420 to exclusive access by CDB 404. PDA nest 410 restricts database processes 422, 424, 426, PDB file system 428, system limits 430, CPU 432, memory 434, and network 436 to exclusive access by pluggable database PDA 406 and any database associated with the parent nested CDB nest 402 (such as CDB 404). Similarly, the PDB nest restricts database processes 440, 442, 444, PDB file system 446, system limits 448, CPU 450, memory 452, and network 454 to exclusive access by pluggable database PDB 408 and any database associated with the parent nested CDB nest 402 (such as CDB 404).
[0091] As mentioned above Figure 3 As discussed, the hierarchical privilege structure restricts database processes running within pluggable database PDA 406 and pluggable database PDB 408 from accessing resources that are not isolated to their own corresponding assigned nests. In addition, because CDB nest 402 is an ancestor nest of PDA nest 410 and PDB nest 412, database processes running within pluggable database PDA 406 and pluggable database PDB 408 are restricted from accessing resources isolated to CDB nest 402. However, database processes running within CDB 404 are not restricted from accessing resources isolated by PDA nest 410 and PDB nest 412 because CDB nest 402 is a hierarchical ancestor of both PDA nest 410 and PDB nest 412, as described above with respect to Figure 3 discussed.
[0092] Creating a nested database
[0093] When a member PDB of a CDB or application container is created, a database nest of the PDB is created. A member PDB can be created by issuing DDL commands to the container DBMS. The created database nest restricts access to an appropriate subset of the resources of the parent database nest.
[0094] According to an embodiment, namespaces, attributes, and properties associated with database nesting features are captured as profiles that are persistently stored within the database nesting infrastructure. When a database nest is established, a default profile can be applied. The database administrator can customize the profile through database parameters and configuration files.
[0095] The database server may store a mapping that maps the CDB and each application root and each member PDB to a corresponding runtime profile. In an embodiment, a database dictionary may store each runtime profile and mapping. In addition, the name of the runtime profile for a particular CDB, application root, or PDB is stored in the corresponding database dictionary for the CDB, application root, or PDB.
[0096] Connecting to a nested database
[0097] Using operating system namespaces as described in the "Namespaces" section, system resources can be confined to database nests through one or more namespaces. Database nests can then be assigned or attached to one or more CDBs and / or PDBs.
[0098] A user can access a pluggable database by establishing a database session for the pluggable database on the DBMS that hosts the pluggable database. Before describing how to establish a database session for a pluggable database, it is useful to further describe the database session.
[0099] A database session includes a specific connection established for a client to a database server (such as a database instance) through which the client issues a series of requests (e.g., requests to execute database statements). A database server may maintain session state data about the session. The session state data reflects the current state of the database session and may include the identity of the user for whom the database session was established, the services used by the user, instances of object types, language and character set data, statistics about resource usage for the session, values of temporary variables generated by processes executing software in the database session, and storage for cursors and variables, among other information. If a database dictionary is attached to the database session, the session state of the database session includes one or more references or links required to access the attached database dictionary.
[0100] According to an embodiment, the connection manager is used to route client connection requests and assist in establishing a database session to a PDB, but does not establish a database session for a specific CBD or PDB. A user can submit a connection request for a specific PDB within a CDB. The connection manager receives the request and then routes it to a listener process in the PDB.
[0101] CDBMS spawns a "PDB listener" for each PDB, so that the operating system restricts the PDB listener to the database nest of such PDB. The operating system restricts any process spawned by the PDB listener to the database nest of such PDB. When the PDB listener spawns a new database process for a new database session, the database process can only access resources isolated by the database nest of the PDB.
[0102] Figure 5 Describes the procedures involved in establishing a database session for a pluggable database. Figure 5 At 502, a database server hosting a CDB receives a connection request and receives, along with the connection request, a parameter value including a database identifier. The database identifier may be any information that can be used to identify a database to which access is requested. In an embodiment, the database identifier may be a name of a pluggable database. In another embodiment, the database identifier may be a database service associated with the pluggable database.
[0103] At 504, it is determined that the database connection request is a request for a database session of a pluggable database. For example, this determination can be made by determining that a database identifier identifies the pluggable database PDA.
[0104] At 506, in response to determining that the database connection request is a request for a pluggable database, a database session for the pluggable database is established. Establishing the database session for the pluggable database includes attaching a database nest of the pluggable database. In the current example, the database dictionary 221, i.e., the database dictionary for the pluggable database PDA 220, is scanned to determine which database nest is mapped to the pluggable database PDA 220. The database nest mapped to the pluggable database PDA 220 is established as the database nest of the database session.
[0105] Establishing a database session for a user takes longer than Figure 3 Such operations include, but are not limited to, authentication of the user making the connection request and initialization of the session state.
[0106] Software Overview
[0107] Figure 6 Can be used to control Figure 7 6 is a block diagram of a basic software system 600 for the operation of a computing system 700. The software system 600 and its components, including their connections, relationships, and functions, are merely exemplary and are not meant to limit implementation of the example embodiment(s). Other software systems suitable for implementing the example embodiment(s) may have different components, including components with different connections, relationships, and functions.
[0108] Software system 600 is provided for directing the operation of computing system 700. Software system 600, which may be stored on system memory (RAM) 706 and fixed storage (eg, hard disk or flash memory) 710, includes a kernel or operating system (OS) 610.
[0109] The OS 610 manages low-level aspects of computer operation, including managing the execution of processes, memory allocation, file input and output (I / O), and device I / O. One or more applications, represented as 602A, 602B, 602C ... 602N, may be "loaded" (e.g., transferred from fixed storage 710 into memory 706) for execution by the system 600. Applications or other software intended for use on the computer system 700 may also be stored as a downloadable set of computer-executable instructions, for example, for downloading and installation from an Internet location (e.g., a Web server, app store, or other online service).
[0110] The software system 600 includes a graphical user interface (GUI) 615 for receiving user commands and data in a graphical (e.g., "click" or "touch gesture") manner. In turn, these inputs can be operated by the system 600 according to instructions from the operating system 610 and / or (one or more) applications 602. The GUI 615 is also used to display the results of operations from the OS 610 and (one or more) applications 602, and the user can provide additional input or terminate the session (e.g., log out).
[0111] The OS 610 may execute directly on the bare hardware 620 (e.g., processor(s) 704) of the computer system 700. Alternatively, a hypervisor or virtual machine monitor (VMM) 630 may be inserted between the bare hardware 620 and the OS 610. In this configuration, the VMM 630 acts as a software "buffer" or virtualization layer between the OS 610 and the bare hardware 620 of the computer system 700.
[0112] VMM 630 instantiates and runs one or more virtual machine instances ("guest machines"). Each guest machine includes a "guest" operating system (such as OS 610), and one or more applications (such as (one or more) applications 602) designed to execute on the guest operating system. VMM 630 presents a virtual operating platform to the guest operating system and manages the execution of the guest operating system.
[0113] In some cases, VMM 630 can allow a guest operating system to run as if it were running directly on bare hardware 620 of computer system 700. In these instances, the same version of the guest operating system that is configured to execute directly on bare hardware 620 can also execute on VMM 630 without modification or reconfiguration. In other words, VMM 630 can provide full hardware and CPU virtualization to guest operating systems in some cases.
[0114] In other cases, the guest operating system may be specially designed or configured to execute on VMM 630 to improve efficiency. In these instances, the guest operating system is "aware" that it is executing on a virtual machine monitor. In other words, VMM 630 may provide paravirtualization to the guest operating system in some cases.
[0115] A computer system process includes an assignment of hardware processor time, as well as an assignment of memory (physical and / or virtual), an assignment of memory for storing instructions executed by the hardware processor, for storing data generated by the execution of instructions by the hardware processor, and / or for storing hardware processor state (e.g., contents of registers) between assignments of hardware processor time when the computer system process is not running. A computer system process runs under the control of an operating system and may run under the control of other programs executing on the computer system.
[0116] Multiple threads can run in a process. Each thread also includes an allotment of hardware processing time, but shares access to the memory assigned to the process. When the threads are not running, the memory is used to store the contents of the processor between assignments. The term thread can also be used to refer to a computer system process when multiple threads are not running.
[0117] cloud computing
[0118] The term "cloud computing" is used generally herein to describe a computing model that enables on-demand access to a shared pool of computing resources, such as computer networks, servers, software applications, and services, and allows resources to be rapidly provisioned and released with minimal management effort or service provider interaction.
[0119] A cloud computing environment (sometimes referred to as a cloud environment or just a cloud) can be implemented in a variety of different ways to best suit different requirements. For example, in a public cloud environment, the underlying computing infrastructure is owned by an organization that makes its cloud services available to other organizations or the public. In contrast, a private cloud environment is generally intended for use by or within a single organization. A community cloud is intended to be shared by several organizations within a community; while a hybrid cloud includes two or more types of clouds (e.g., private, community, or public) bound together by data and application portability.
[0120] In general, the cloud computing model enables some of those responsibilities that might previously have been provided by an organization's own information technology department to instead be delivered as a service layer within a cloud environment for use by consumers (either inside or outside the organization, depending on the public / private nature of the cloud). Depending on the specific implementation, the precise definition of the components or features provided by or within each cloud service layer may vary, but common examples include: Software as a Service (SaaS), in which consumers use software applications running on a cloud infrastructure, while the SaaS provider manages or controls the underlying cloud infrastructure and applications. Platform as a Service (PaaS), in which consumers can use software programming languages and development tools supported by the supplier of the PaaS to develop, deploy, and otherwise control their own applications, while the PaaS provider manages or controls other aspects of the cloud environment (i.e., everything under the runtime execution environment). Infrastructure as a Service (IaaS), in which consumers can deploy and run arbitrary software applications, and / or provide processes, storage, networks, and other basic computing resources, while the IaaS provider manages or controls the underlying physical cloud infrastructure (i.e., everything below the operating system layer). Database as a Service (DBaaS), in which the consumer uses a database server or database management system running on a cloud infrastructure, while the DbaaS provider manages or controls the underlying cloud infrastructure, applications, and servers, including one or more database servers.
[0121] The above basic computer hardware and software and cloud computing environment are presented to illustrate the basic underlying computer components that can be used to implement the (one or more) example embodiments. However, the (one or more) example embodiments are not necessarily limited to any particular computing environment or computing device configuration. Alternatively, according to the present disclosure, the (one or more) example embodiments can be implemented in any type of system architecture or processing environment that a person skilled in the art will understand as being capable of supporting the features and functions of the (one or more) example embodiments presented herein.
[0122] Hardware Overview
[0123] According to one embodiment, the technology described herein is implemented by one or more special-purpose computing devices. The special-purpose computing device can be hard-wired to perform the present technology, or can include a digital electronic device that is permanently programmed to perform the present technology, such as one or more application-specific integrated circuits (ASICs) or field programmable gate arrays (FPGAs), or can include one or more general-purpose hardware processors that are programmed to perform the present technology according to program instructions in firmware, memory, other storage devices, or combinations. This special-purpose computing device can also combine customized hard-wired logic, ASICs or FPGAs with customized programming to implement the present technology. The special-purpose computing device can be a desktop computer system, a portable computer system, a handheld device, a networking device, or any other device that combines hard-wired and / or program logic to implement the technology.
[0124] For example, Figure 7 700 is a block diagram illustrating a computer system 700 upon which embodiments of the present invention may be implemented. Computer system 700 includes a bus 702 or other communication mechanism for communicating information and a hardware processor 704 coupled with bus 702 for processing information. Hardware processor 704 may be, for example, a general purpose microprocessor.
[0125] The computer system 700 also includes a main memory 706, such as a random access memory (RAM) or other dynamic storage device, coupled to the bus 702 for storing information and instructions to be executed by the processor 704. The main memory 706 may also be used to store temporary variables or other intermediate information during execution of instructions to be executed by the processor 704. Such instructions, when stored in a non-transitory storage medium accessible to the processor 704, cause the computer system 700 to become a special-purpose machine customized to perform the operations specified in the instructions.
[0126] Computer system 700 also includes a read only memory (ROM) 708 or other static storage device coupled to bus 702 for storing static information and instructions for processor 704. A storage device 710, such as a magnetic or optical disk, is provided and coupled to bus 702 for storing information and instructions.
[0127] The computer system 700 may be coupled via the bus 702 to a display 712, such as a cathode ray tube (CRT), for displaying information to a computer user. An input device 714, including alphanumeric and other keys, is coupled to the bus 702 for communicating information and command selections to the processor 704. Another type of user input device is a cursor control 716, such as a mouse, trackball, or cursor direction keys, for communicating direction information and command selections to the processor 704 and for controlling cursor movement on the display 712. Such input devices typically have two degrees of freedom in two axes, a first axis (e.g., x) and a second axis (e.g., y), to allow the device to specify a position in a plane.
[0128] The computer system 700 may implement the techniques described herein using custom hardwired logic, one or more ASICs or FPGAs, firmware, and / or program logic that, in combination with the computer system, makes the computer system 700 a special purpose machine or programs the computer system 700 to be a special purpose machine. According to one embodiment, the techniques herein are performed by the computer system 700 in response to the processor 704 executing one or more sequences of one or more instructions contained in the main memory 706. These instructions may be read into the main memory 706 from another storage medium, such as the storage device 710. Execution of the sequences of instructions contained in the main memory 706 causes the processor 704 to perform the process steps described herein. In alternative embodiments, hardwired circuitry may be used in place of or in combination with software instructions.
[0129] The term "storage medium" as used herein refers to any non-transitory medium that stores data and / or instructions that cause a machine to operate in a particular manner. Such storage media may include non-volatile media and / or volatile media. Non-volatile media include, for example, optical or magnetic disks, such as storage device 710. Volatile media include dynamic memory, such as main memory 706. Common forms of storage media include, for example, floppy disks, flexible disks, hard disks, solid-state drives, magnetic tapes or any other magnetic data storage media, CD-ROMs, any other optical data storage media, any physical media with a hole pattern, RAM, PROM and EPROM, FLASH-EPROM, NVRAM, any other memory chip, or cassette tape.
[0130] Storage media are distinct from but may be used in conjunction with transmission media. Transmission media participate in the transfer of information between storage media. For example, transmission media include coaxial cables, copper wire, and optical fiber, including the wires that comprise bus 702. Transmission media may also take the form of acoustic or light waves, such as those generated during radio wave and infrared data communications.
[0131] Various forms of media may be involved in carrying one or more sequences of one or more instructions to the processor 704 for execution. For example, the instructions may initially be carried on a disk or solid-state drive of a remote computer. The remote computer can load the instructions into its dynamic memory and send the instructions over a telephone line using a modem. A modem local to the computer system 700 can receive the data on the telephone line and use an infrared transmitter to convert the data to an infrared signal. An infrared detector can receive the data carried in the infrared signal and appropriate circuitry can place the data on the bus 702. The bus 702 carries the data to the main memory 706, from which the processor 704 retrieves and executes the instructions. The instructions received by the main memory 706 may optionally be stored on the storage device 710 before or after execution by the processor 704.
[0132] Computer system 700 also includes a communication interface 718 coupled to bus 702. Communication interface 718 provides bidirectional data communication coupled to network link 720, wherein network link 720 is connected to local network 722. For example, communication interface 718 can be an integrated services digital network (ISDN) card, a cable modem, a satellite modem, or a modem that provides data communication connection to a telephone line of a corresponding type. As another example, communication interface 718 can be a LAN card that provides data communication connection to a compatible local area network (LAN). Wireless links can also be implemented. In any such implementation, communication interface 718 sends and receives electrical signals, electromagnetic signals, or optical signals that carry digital data streams representing various types of information.
[0133] The network link 720 typically provides data communication to other data devices through one or more networks. For example, the network link 720 can provide a connection to a host computer 724 or to data equipment operated by an Internet Service Provider (ISP) 726 through a local network 722. The ISP 726, in turn, provides data communication services through the global packet data communication network now commonly referred to as the "Internet" 728. Both the local network 722 and the Internet 728 use electrical, electromagnetic, or optical signals that carry digital data streams. The signals through the various networks and the signals on the network link 720 and through the communication interface 718 are example forms of transmission media that carry the digital data to or from the computer system 700.
[0134] Computer system 700 can send messages and receive data, including program code, through the network(s), network link 720, and communication interface 718. In the Internet example, server 730 can transmit the requested code for an application program through Internet 728, ISP 726, local network 722, and communication interface 718.
[0135] The received code may be executed by processor 704 as it is received, and / or stored in storage device 710 or other non-volatile storage for later execution.
[0136] In the foregoing specification, embodiments have been described with reference to numerous specific details that vary from implementation to implementation. Therefore, the specification and drawings should be regarded as illustrative rather than restrictive. The sole and exclusive indicator of the scope of the invention, and what the applicants intend as the scope of the invention, is the literal and equivalent range of the set of claims issuing from this application, in the specific form in which such claims issue, including any subsequent corrections.
Claims
1. A method for isolating system resources of a pluggable database, comprising: a database server within an instance of an operating system hosting a first container database management system CDBMS comprising a first container database CDB and a second CDBMS comprising a second CDB, the first CDBMS being restricted to a first database nest and the second CDBMS being restricted to a second database nest, wherein the first database nest includes privileges to a first set of operating system computer resources of the operating system and the second database nest includes privileges to a second set of operating system computer resources of the operating system, wherein the first database nest is isolated from the second database nest; the database server assigning a first plurality of first pluggable database nests to a first plurality of first pluggable databases in the first CDB, wherein the first plurality of first pluggable database nests each provide a set of privileges for the first set of operating system computer resources of the first database nests, wherein the first plurality of first pluggable database nests are isolated from second database nests of the second CDB; the database server assigning a second plurality of second pluggable database nests to a second plurality of second pluggable databases in the second CDB, wherein the second plurality of second pluggable database nests each provide a set of privileges to the second set of operating system computer resources of the second database nests, wherein the second plurality of second pluggable database nests are isolated from the first database nest of the first CDB; wherein the first plurality of first pluggable databases include a first pluggable database and a second pluggable database; wherein the first plurality of first pluggable database nests comprises a first pluggable database nest for the first pluggable database and a second pluggable database nest for the second pluggable database; wherein the first pluggable database nest includes privileges to a first subset of the first set of operating system computer resources but does not include privileges to a second subset of the first set of operating system computer resources, wherein the second pluggable database nest includes privileges to the second subset of the first set of operating system computer resources but does not include privileges to the first subset of the first set of operating system computer resources, wherein the first pluggable database nest and the second pluggable database nest are isolated from the second database nest of the second CDB; receiving a first request for a first database session with the first pluggable database; In response to receiving the first request, establishing a first database session assigned to the first pluggable database nest; receiving a second request for a second database session with the second pluggable database; In response to receiving the second request, a second database session assigned to the second pluggable database nest is established.
2. The method of claim 1, wherein the first CDB comprises one or more database dictionaries defining each first pluggable database in the first plurality of first pluggable databases and a corresponding pluggable database nesting for each first pluggable database.
3. The method of claim 1, further comprising: In response to receiving a DDL command to create a specific pluggable database, a specific pluggable database nest is created for the specific pluggable database.
4. The method of claim 1, further comprising: The database server starts a listener process for a first pluggable database, wherein starting the listener process includes nested assigning of a first pluggable database of the first pluggable database to the listener process; The establishing of the first database session for the first pluggable database comprises: the listener process generates a database session process, thereby nesting and assigning the first pluggable database of the first pluggable database to the first database session for the first pluggable database.
5. The method of claim 1, wherein an operating system namespace is used to implement the first database nesting and the second database nesting.
6. The method of claim 1, wherein the first plurality of first pluggable databases comprises application containers; The application container includes common database objects accessible by the first database session and the second database session.
7. The method of claim 1, wherein the privileges on the first set of operating system computer resources include system restrictions for executing system calls.
8. The method of claim 1, wherein the operating system is Linux, Windows or Solaris.
9. One or more non-transitory computer-readable media storing instructions that, when executed by one or more processors, cause the method of any one of claims 1 to 8 to be performed.
10. A system for isolating system resources of a pluggable database, the system comprising one or more computing devices including components, implemented at least in part by computing hardware, the computing hardware being configured to implement the steps of any one of the methods recited in claims 1-8.
Citation Information
Patent Citations
Container database
CN104781809A
System and method for multitenant execution of os programs invoked from a multitenant middleware application
US20170116041A1