VMware® vFabric™Data Director 2.5 EVALUATION GUIDE Introduction ................................................................................................................................................. 2 Pre-­‐requisites for completing the basic and advanced scenarios ............................................................... 3 Basic Scenarios ............................................................................................................................................ 4 Install Data Director using Express Install ................................................................................................ 5 Create an Oracle and SQL Server template using the wizard. ................................................................. 6 Create Oracle and SQL Server Databases in Minutes .............................................................................. 6 Advanced Scenarios ................................................................................................................................... 10 Template and Resource Management .................................................................................................. 11 Database Lifecycle Management ........................................................................................................... 21 Restoring to a point-­‐in-­‐time .................................................................................................................. 23 Database-­‐as-­‐a-­‐Service ........................................................................................................................... 27 Database Patching ................................................................................................................................. 33 1 Introduction vFabric Data Director is a unified database-­‐as-­‐a-­‐service platform that enables database administrators and cloud service providers to virtualize and automate lifecycle management of heterogeneous databases. Data Director enables IT to reduce costs and improve operational efficiency. In this release, Data Director supports vPostgres, Oracle, SQL Server databases and Hadoop. The vFabric Data Director Evaluation Guide is designed to walk you through the various functionalities of the Data Director product. The guide describes scenarios and use cases that system administrators and DBAs encounter in the IT environment. Each scenario and use case comes with a work flow that shows how Data Director can be used to address key business and IT challenges. Following scenarios are covered in this evaluation guide: Basic Scenarios: •
•
•
Install Data Director using Express Setup Create an Oracle and SQL Server template using the wizard. Provision Oracle and SQL Server databases in minutes. Advanced Scenarios •
•
•
•
•
Build customized templates. Manage resources using Organizations. Automate routine lifecycle management tasks for Oracle. Enable self-­‐service and improve business SLA’s Patch Oracle database VM’s in minutes 2 Pre-­‐requisites for completing the basic and advanced scenarios To complete the basic and advanced exercises, the environment should meet the pre-­‐requisites as outlined in the vFabric Data Director Installation Guide. Additionally the following minimum cluster resource requirements apply for basic and advanced scenarios. Basic Scenario Advanced Scenario 2 ESXi servers, with 12 GB of RAM combined and 7000MHz of available CPU. 2 ESXi servers, with 32 GB of RAM combined and 7000MHz of available CPU. 250 GB of shared storage, configured as 2 datastores 500 GB of shared storage, configured as 2 or more datastores 1 + n* Gigabit Ethernet VLANs (where n can be = 0) 1 + n* Gigabit Ethernet VLANs (where n ≥ 1) 1 vCenter server (could be a Virtual Machine) 1 vCenter server (could be a Virtual Machine) 1 client machine for vSphere Client 1 client machine for vSphere Client 3 Basic Scenarios 4 Install Data Director using Express Install The installation of Data Director starts with downloading the Data Director vApp or OVA file from the download center. To download the Data Director vApp, follow the steps outlined below. •
•
•
•
•
Navigate to the vFabric Data Director product page at www.vmware.com Click on Download Trial. In the product evaluation page, you will be asked to login using your myvmware account. Click on License and Download tab. Download VMware-Data-Director-2.5.0.3390-906972_OVF10.ova file. Once you have downloaded the ova file, follow the steps in the vFabric Data Director Installation Guide. There are two setup options available in this release, Express and Advanced installation. For the purpose of this guide follow the steps to do the express installation. To download the installation guide, click on the Installation and Configuration tab in the product evaluation page and then click on the VMware vFabric Data Director Installation Guide link. Once you are done with the express install, you will have a running instance of Data Director. The next step is to login to Data Director using the administrator account that you created during setup. After you login you are taken to the System organization dashboard. If during setup, the Create Defaults option was checked, an organization named “Default” will be created. The next step is to create database templates that can be used to provision Oracle, SQL Server and vPostgres databases.
5 Create an Oracle and SQL Server template using the wizard. The template creation step starts with the creation of a base DBVM. You can create a base DBVM and install the operating system and database software required to create databases. For easy creation of the base DBVM, you can use the base VM creation wizard. Using this wizard, you can create an Oracle and SQL Server base DBVM from the ground up. The wizard automatically installs the operating system and database software as required by Data Director. You can also manually create the base DBVM if your environment requires specific customizations. In this exercise you will follow the steps below to create a SQL Server 2008 R2 base VM and Oracle 11G R2 base VM using the wizard. Before you can use the wizard, you should create an iso file for each of the databases and OS setup files and upload it to a datastore in the cluster. Data Director will use the setup files contained in the iso to install the OS and database. To launch the wizard and create the base DBVM, follow the steps below. You will have to repeat the steps to create each of the base DBVMs. Prerequisites Ensure there is adequate free space on the datastore. You will need approximately 13GB of free space per template. This is in addition to the space required to provision the databases from the template. Procedure 1. Log in to Data Director as a system administrator. 2. In the System tab, click Manage and Monitor. 3. Expand Templates and select Base DBVMs. 4. Click the plus (+) icon to start the Create Base DBVM wizard and enter the appropriate information. Option Description • Name Enter a unique name for the base DBVM. • Database type Select a database type, or select Empty to create a blank base DBVM. • Database version Select a version. • Installer ISO Type the path to the ISO file on the datastore in the cluster. The path must be of the form[datastore]folder/DB .iso. Ensure that the database version matches the database type you selected. • Operating system Select an operating system from the drop-­‐down menu of supported operating systems. • OS installer ISO Type the path to the IOS file on the datastore in the cluster. The path must be of the form[datastore]folder/OS.iso. • Data Director installs the OS, copies the Oracle or SQL Server files, installs the virtual machine tools and agents, and invokes Windows sysprep. The base DBVM appears in the Base DBVMs list with the status Creating. The process can take a few minutes. The status changes to Running when creation finishes. Create Oracle and SQL Server Databases in Minutes
Before Data Director can provision databases, you have to convert the base DBVM created in the previous step into a database template. 6 To convert the base DBVM into a template, you must be logged into Data Director Web Console as the system administrator. To convert a database VMs into a template, follow this procedure: 1. Click on Manage and Monitor and from the left pane select Base DBVM a. On the right pane, you will see the two VMs that were created in the previous step. 2. Right click on the vPostgres VM and select “Convert to Base DB Template”. 3. In the dialog, give a name and description for the template. When you name a template, specify a name that will help users easily recognize the template configuration. e.g. SQL Server 2008 R2-­‐
Win2008R2 or Oracle11gv11.0.2-­‐SUSEv2.0. 4. Leave the Save the source DBVM checked. 5. Click Ok. This will start the creation of the base template. 6. Click on the Base Database Template on the left pane. You will see the template listed and the status showing as Creating. 7. Expand the Task pane on the right to monitor the progress of the template creation in the task pane. 8. Repeat steps 3-­‐7 for the Oracle base database VM. On successful completion of the template creation, you will have created two base database templates that can be used for provisioning SQL Server and Oracle11g database instances. Enable template in the Default Organization Before a database can be provisioned using the templates, the organization administrator must enable the template in the resource bundle associate with the organization. In this exercise, we will use the Default organization created during the setup. To enable Base DB Templates for Resource Bundle, follow this procedure: 1. Login to Data Director Web Console as the administrator. 2. Click on Organization Settings tab, on the left pane, select Resource Bundles. 3. You will see the default resource bundle on the right pane. 7 4. Right click on default resource bundle and select Enable Base DB Templates in the dialog. You will see two templates listed. 5. Click on each of them and click the Enable button. Provision Oracle and SQL Server databases To provision a database, navigate to the specific organization. For this exercise, use the default organization. 1. Click on Manage and Monitor tab. 2. Click on Organizations on the left pane. 3. On the right pane, click on Default. First provision an Oracle database. To provision an Oracle database, login to the Data Director console as the administrator. Navigate to the Default organization, by clicking on the organization name. 1. Click the Manage & Monitor tab. 2. Click on the default database group on the left pane. 3. Click the Databases tab in the center pane. 4. Click the plus (+) icon to start the Create Database wizard. 5. In Creation Type, select Create New Database, and click Next. 6. In General, 1) Name and Description: Enter a name and, optionally, a description of the database. 2) Database Type: Select Oracle from the drop-­‐down menu. 3) Database Template: Select the Oracle template from the drop-­‐down menu. 4) Database Group: This should indicate Default. 5) Click next. 7. In Configuration, 1) Resource Template: Select Medium. 2) Storage Allocation: Select 5GB. 3) Parameter Group: Select the default group. 4) Backup Template: Choose Standard Auto Storage Management. 5) Point-­‐In-­‐Time Recovery storage allocation: Specify 5GB 6) Click Next. 8. In Administrator, 1) Owner Account: Enter an owner account for the database. This will be the SYSDBA account for the database. 2) Password: Enter and confirm the owner account password. 3) Click Next. 9. In Options, 1) Expiration: Select a date and time at which the database expires. Choose Stop Database as the default action. 2) Click next. 10. In Summary, Click Finish. The database creation will start; see the status in the task bar. Now provision the SQL Server instance. To provision a SQL Server instance, follow this procedure: Procedure 1. Navigate to the organization and to the database group in which to create the database. 8 2.
3.
4.
5.
Click the Manage & Monitor tab. Click the Databases tab. Click the plus (+) icon to start the Create Database wizard. Click Create new database, and provide the appropriate information. Option Description • Name and description Type the NETBIOS name for the Windows machine and, optionally, a description of the database. • Database type Select SQL Server. • Base DB template Select Template-­‐SQL Server from the drop-­‐down menu. • Database group Select a database group. • Resource template Select a resource template. • Data disk allocation Type a data storage allocation value for this database. The minimum is 1GB for SQL Server. • Parameter group Select a parameter group for the database or accept the default parameter group. • Domain To use Windows authentication, click Join machine to domain and type a domain name, user name, and password. • To use mixed authentication, click Do not join domain. • Administrator If you joined the machine to a domain, type a domain user name for the SQL Server administration. • If you did not join the machine to a domain, enter a password for the built-­‐in SQL Server Administrator (sa) account, and a password for the Local Windows Administrator. • Options Click No expiration, or click Expires on and select an expiration date and time and an action upon expiration. • Tags (Optional) Select one or more tags for this database. Use tags to filter the list of databases that you view in an organization's Databases tab. For example, you can tag all your customer relationship databases as CRM. • Confirm your selections, and click Finish. You have a running SQL Server instance. At this point you should have two running databases, one Oracle database and one SQL Server instance that is ready for use. 9 Advanced Scenarios 10 Template and Resource Management In this exercise, you will walk through the steps to manually create an Oracle template and also learn how to create organizations and allocate resources to organizations. The exercise consists of the following steps: 1.
2.
3.
4.
5.
6.
Download base database VM templates. Install Oracle in the base database VM. Convert the base database VM into a database template Create and allocate pooled resources Setup the organization and database groups Provision Oracle and vPostgres databases. Download base database VM templates VMware provides four base database VM templates, which you can download from the VMware download center. The base database VM (DBVM) templates are provided to make it easier for DBAs and system administrators to build custom database templates. The following templates are available for download: A. vFabric Data Director vPostgres 9.0 DBVM Template whose file name is VMware-­‐Data-­‐Director-­‐
SLES11-­‐vPostgres90-­‐Base-­‐DBVM-­‐<build#>.ova B. vFabric Data Director vPostgres 9.1 DBVM Template whose file name is VMware-­‐Data-­‐Director-­‐
SLES11-­‐vPostgres91-­‐Base-­‐DBVM-­‐<build#>.ova C. vFabric Data Director SUSE 11 DBVM Template whose file name is VMware-­‐Data-­‐Director-­‐
SLES11-­‐Base-­‐DBVM-­‐<build#>.ova D. vFabric Data Director Blank DBVM Template whose file name is VMware-­‐Data-­‐Director-­‐Blank-­‐
Base-­‐DBVM-­‐<build#>.ova In this exercise, we will use base DBVM B. and C. To prepare the base database VM, follow these steps: 1. Download the following files from VMware download center to a directory that can be accessed from the vSphere client. VMware-­‐Data-­‐Director-­‐SLES11-­‐vPostgres91-­‐Base-­‐DBVM-­‐<build#>.ova. This .ova file contains a VM with SUSE Linux 11 SP1 and vPostgres 9.1 installed. The VM There is no additional installations necessary to use this DBVM. VMware-­‐Data-­‐Director-­‐SLES11-­‐Base-­‐DBVM-­‐<build#>.ova 11 This .ova comes with the SUSE Linux and the Data Director components pre-­‐installed. The VM is pre-­‐configured with the appropriate disk layout that is required for a Data Director database VM. Before you can use this template you need to install the database software. 2. Deploy two OVA files that were downloaded in step 1 into the system resource pool. System resource pool was created in the cluster where the Data Director vApp was deployed. The resource pool was created during the express setup. To identify the resource pool, click on System Setting tab under System organization. Locate System Resource Bundle and on the right pane identify the name of the resource pool associated with the system resource bundle. In vCenter, this will be located under the resource pool where the Data Director vApp was deployed in the cluster. The OVA files have to be deployed one at a time. To deploy each file: 1) Go to the vSphere client, in the left pane click on the system resource pool. 2) Go to File-­‐>Deploy OVF Template, it opens the wizard. 3) In the Source page, click browse, select VMware-­‐Data-­‐Director-­‐SLES11-­‐vPostgres91-­‐
Base-­‐DBVM-­‐<build#>.ova, click ok, back to the wizard, click Next. 4) Click Next on OVF Template Detail page. 5) On the Name and Location page, provide a descriptive name for the template, click Next. 6) On the Storage page, pick a datastore with at least 100MB of free space. Click Next. 12 7) Leave the Disk Format at the default, select Thin Provision. Click Next. 8) In the Network Mapping page, choose the networks listed to networks that you configured when you installed Data Director, click Next. 9) In the Read to Complete page, click Finish. 10) The OVA will be deployed and under system resource pool you will see the VM deployed. 11) Repeat the steps above to deploy vFabric Data Director SUSE 11 base DBVM Template Now you will see two VM’s deployed in the system resource pool. Install Oracle in the SUSE base VM. 1) In vSphere client, choose the SUSE base VM under the system resource pool. 2) Power on the VM if you have not already done so. 3) Right click on the SUSE base VM, select Open Console. 4) In the console, login as the root user. The first time login password is displayed on top of the console. 5) Execute command "/opt/aurora/installation/install.sh [NFS_PATH] [Oracle_version]" -­‐ [NFS_PATH] is the path of the NFS server where the Oracle installation bits are located. -­‐ [Oracle_version] specify 11.0.2.0. -­‐ Install.sh is preinstalled in the SUSE base VM. It is executed to ensure that the Oracle binary files are installed on the correct disk. If you choose to do the install using your own scripts, first refer to the install.sh file and ensure the placement of files is done correctly. If not, conversion of the DBVM into a template will fail. 6) When the message "Oracle installation finished" is displayed, the SUSE base VM has the Oracle instance installed. At this point you have created two base database VMs with all the required software. The next step is to convert these base VMs into templates that Data Director can use to provision databases. Convert the base database VM into a database template Before Data Director can provision databases, you have to create base database templates. To convert the base VM into a template, you must be logged into Data Director Web Console as the system administrator. The Data Director System administrator manages the templates and also does the resource allocation. In this exercise, we will walk through the steps a database administrator takes to prepare the Data Director environment. To convert a database VMs into a template, follow this procedure: 9. Click on Manage and Monitor and from the left pane select Base DBVM a. On the right pane, you will see the two VMs that were created in the previous step. 13 10. Right click on the vPostgres VM and select “Convert to Base DB Template”. 11. In the dialog, give a name and description for the template. When you name a template, specify a name that will help users easily recognize the template configuration. e.g., vPostgresv.9.1-­‐
SUSE or Oracle11gv11.0.2-­‐SUSEv2.0. 12. Leave the Save the source DBVM checked. 13. Click Ok. This will start the creation of the base template. 14. Click on the Base Database Template on the left pane. You will see the template listed and the status showing as Creating. 15. Expand the Task pane on the right to monitor the progress of the template creation in the task pane. 16. Repeat steps 3-­‐7 for the Oracle base database VM. On successful completion of the template creation, you will have created two base database templates that can be used for provisioning vPostgres and Oracle11g database instances. You are ready now to create the pooled resources required to provision and run the databases. Create and allocate pooled resources In a typical organization, each database serves a production application or is used in the development or test environment. It is important that each of these databases is allocated the appropriate amount of resources which can guarantee the required performance. It is also critical that resource and security isolation is maintained between these databases. Data Director provides a hierarchical model that system administrators and DBAs can use to group databases and allocate resources. In Data Director, the system administrator can create multiple organizations. An organization is a unit of administration and a container for resources. For example the database can be grouped into production and development organizations. Each organization is allocated a certain amount of resources (CPU, memory, disk and network) using resource bundles. 14 Each organization is assigned an administrator, known as the organization administrator. The organization administrator has the ability to further divide the resources within the organization. For example, the production organization administrator can create one database group dedicated to Oracle databases and another for vPostgres. The Oracle group can be allocated more resources than the vPostgres group. The resources for the database groups can only be allocated from the pool that is assigned for the production organization. The diagram below shows an example of the organization and database group hierarchy we will use for the purpose of the activity guide scenarios. We will start by creating the production and development organizations. Creating Production and Development Organizations 1.
2.
3.
4.
You must be logged in to Data Director console as a system administrator With System tab selected, click Manage & Monitor. Click Organizations in the left pane. Click the plus (+) icon to create an organization, a wizard pops up with Create Organization screen. 5. In the Create Organization Wizard screen: 1) Name and Description, enter a name “Production” in the Name Organization box then give a description. Click Next. 2) Organization Administrator To create a new organization administrator user, perform the following tasks: I.
Click Create a new user. II.
Specify the user name, password, first and last name, and optionally, phone number. III.
Click Next. Or 15 I.
To use an existing user, perform the following tasks: II.
Click Choose an existing user. III.
Select the user from the list. IV.
Click Next. 3) Resource Bundles You can assign resource bundles at any time after creating the organization. I.
Click Assign resource bundles later and click Finish 4) Repeat the steps to create the development organization Creating Resource Pools for the Production and Development Organizations Each organization is allocated resources using a resource bundle. In this exercise, you will create one resource bundle for the production organization and another resource bundle for the development organization. NOTE: You can add additional resource bundles to an organization, if required. Before you can create a resource bundle, you need to create a corresponding resource pool in vCenter. For the production resource bundle, you can create a resource pool with the following allocation of CPU and memory: • CPU; 2 GMHZ (2000 MHZ) • Memory: 16 GB (16384 MB) For the development resource bundle, you can create a smaller resource pool with the following allocation of CPU and memory: • CPU; 1G MHZ (1000 MHZ) • Memory: 8 GB (8192 MB) To create the resource pool: 1. Open vSphere client, login to vCenter as a system administrator. 2. In the inventory tree in the left pane, right-­‐click the relevant cluster name and select New Resource Pool. The Create Resource Pool dialog appears. 3. Enter a Name for the resource pool. In this case name the resource pool ProductionRP 4. For both CPU Resources and Memory Resources: 1) Leave Shares as Normal 2) The Expandable Reservation checkbox may be checked or unchecked (Should indicate here why it doesn’t matter.) 3) Ensure the Unlimited checkbox is unchecked 4) Set the Reservation and Limit to equal values -­‐ For CPU specify 2000 MHz for both Reservation and Limit -­‐ For memory specify 16384 MB for both Reservation and Limit 5. Click OK to confirm. After a few seconds, the new resource pool appears under the relevant cluster. 6. Repeat these steps to create another resource pool named DevelopmentRP. For CPU specify 1000MHZ and Memory specify 8192 MB 16 At this point you have created resource pools in the cluster called ProductionRP and DevelopmentRP . You can now create the resource bundles. Creating Resource Bundles for Production and Development Organizations Every organization need at least one resource bundle and a resource bundle cannot be shared across organizations. In this case, you will create two resource bundles, one for Production and one for Development. NOTE: The exercise assumes that you have at least 500GB of storage available. If you get the error “Insufficient storage budget” during any of the operations, allocate more data or backup storage as needed. To create a Resource Bundle, follow the steps below 1. Log in to Data Director with system administrator privileges. 2. Select System, and click Manage & Monitor. 3. Click Resource Bundles in the left pane. 4. Click the plus (+) icon. 5. Specify the following information about the resource bundle in the wizard. 6. Wizard screen Action 1) Name and Description: Type ProductionRB and click Next. 2) CPU and Memory: Select the ProductionRP resource pool and click Next. 3) Storage: Click Edit to select a datastore, and allocate 50 GB to use with Data Director, i. Repeat the process for backup. Allocate 50 GB for backup storage. ii. Specify the default storage reservation. 4) Base DB Templates: click checkbox to select both vPostgres and Oracle template in the list. Client Next. 5) DB Access Networks: Select the networks that you want to have available to this resource bundle. These networks provide the public network for the organization's databases. Client Next. 6) Summary: click Finish. 7. Repeat the steps to create the Development resource bundle and use the following values 1) Type Name as DevelopmentRB. 2) Select DevelopmentRP resource pool for the CPU and Memory. 3) Allocate 25GB for storage and 25GB for backup. 4) Select both vPostgres and Oracle templates. Once two resource bundles are created, you need to assign the resource bundle to the corresponding organization Assign Resource Bundle to the Production and Development Organization To assign the resource bundle to the organization, do the following : 1. In Manage and Monitor tab, select Organizations. 2. On the center pane, highlight Production and right click on it. 3. Select Assign Resource Bundle option. 4. From the list, select ProductionRB and click OK. 5. Repeat the steps to assign DevelopmentRB resource bundle to the Development organization. 17 NOTE: At this point the System Administrator has completed all the tasks to setup the environment. Now the organization administrator needs to setup the organization to enable provisioning of databases. Setup the organization and database groups Before a database can be provisioned using the templates, the organization administrator must: • Enable the template in the organization. • Create database groups, as required. To enable Base DB Templates for Resource Bundle, follow this procedure: 6. Login to Data Director Web Console as the production Organization Administrator. You will now be in the production organization. -­‐ Note: A System Administrator, if given the role of organization administrator, can perform the following steps as well. 7. Click on Organization Settings tab, on the left pane, select Resource Bundles. 8. You will see the ProductionRB resource bundle on the right pane. 9. Right click on ProductionRB resource bundle and select Enable Base DB Templates in the dialog. You will see two templates listed. 10. Click on each of them and click the Enable button. Now you can create two database groups, named Orcl and vPG. Orcl will be used to provision Oracle databases and vPG will be used to provision vPostgres databases. To create Database Groups in the Production organization, follow this procedure: 1. Click the Manage & Monitor tab. 2. Click the Database Groups tab. 3. Click the plus (+) icon to create a database group. 4. Specify the following information in the Create Database Group wizard screen. 1) Name and Description: Type Orcl and click Next. 2) Resource Bundle: Select the ProductionRB resource bundle and click Next. 3) Resources: Specify the resources for this database group. 4) Network: Select the network from the drop-­‐down menu. 5) CPU & Memory: Leave the priority at the default value. 6) Storage: Specify at least 250GB for data and 150GB for backup. 7) Click Finish 8) Repeat these steps to create the vPG database group. -­‐ For Storage: specify at least 25GB for data and 25GB for backup. At this point you can provision databases using these templates. Provision Oracle and vPostgres databases First provision an Oracle database. To provision an Oracle database, login to the Data Director console as the production Organization Administrator. 11. Click the Manage & Monitor tab. 12. Click on the Orcl database group on the left pane. 13. Click the Databases tab in the center pane. 14. Click the plus (+) icon to start the Create Database wizard. 15. In Creation Type, select Create New Database, and click Next. 18 16. In General, 6) Name and Description: Enter a name and, optionally, a description of the database. 7) Database Type: Select Oracle from the drop-­‐down menu. 8) Database Template: Select the Oracle template from the drop-­‐down menu. 9) Database Group: This should indicate Orcl. 10) Click next. 17. In Configuration, 7) Resource Template: Select Medium. 8) Storage Allocation: Select 5GB. 9) Parameter Group: Select the default group. 10) Backup Template: Choose Standard Auto Storage Management. 11) Point-­‐In-­‐Time Recovery storage allocation: Specify 5GB 12) Click Next. 18. In Administrator, 4) Owner Account: Enter an owner account for the database. This will be the SYSDBA account for the database. 5) Password: Enter and confirm the owner account password. 6) Click Next. 19. In Options, 3) Expiration: Select a date and time at which the database expires. Choose Stop Database as the default action. 4) Click next. 20. In Summary, Click Finish. The database creation will start; see the status in the task bar. Now you can provision the vPostgres database. To provision a vPostgres database, follow this procedure: 1. Click the Manage & Monitor tab. 2. Click on the vPG database group on the left pane. 3. Click the Databases tab. 4. Click the plus (+) icon to start the Create Database wizard. 5. In Creation Type, select Create new Database, click Next. 6. In General, 1) Name and Description: Enter a name and optionally, a description of the database. 2) Database Type: Select vPostgres from the drop-­‐down menu. 3) Database Template: Select the vPostgres template from the drop-­‐down menu. 4) Database Group: This should indicate vPG. 5) Click Next. 7. In Configuration, 1) Resource Template: Select Tiny. 2) Storage Allocation: Select 5GB. 3) Parameter Group: Select the default group. 4) Backup Template: Choose Standard Auto Storage Management. 5) Point-­‐In-­‐Time Recovery storage allocation: Specify 5GB 6) Click Next. 8. In Administrator, 19 1) Owner Account: Enter an owner account for the database. This will be the SYSDBA account for the database. 2) Password: Enter and confirm the owner account password. 3) Click Next. 9. In Options, 1) Expiration: Select a date and time at which the database expires. Choose Stop Database as the default action. 2) Click Next. 10. In Summary, Click Finish. At this point you should have two running databases, one Oracle and one vPostgres that is ready for use. 20 Database Lifecycle Management Database lifecycle management consumes a majority of the DBA time. Most of the tasks are repetitive and involve complex procedures. Automating life cycle management tasks and using policies to manage them helps simplify management and drive operational efficiency. Here are some of the common use cases: 1.
2.
3.
4.
5.
Enable policies to ensure that database backups are taken as needed. Restore databases from backups reliably without requiring complex scripts and processes Restore databases to a point in time. Quickly create a storage-­‐efficient clone of a running database. Enforce policies during the cloning process to enable cleaning up the production database before a less privileged user gets access to the copy. 6. Save entire database states that can then be used for rollback or re-­‐provisioning. 7. Monitor the databases and exceptions at all levels from a single dashboard. 8. Enable exception-­‐based monitoring using alerts and notifications. In this exercise, you will learn how Data Director helps automate lifecycle management tasks like backup, cloning and restore among other things. 21 Using templates to automate backups The DBAs work just gets started after a database is provisioned. Depending on the criticality of the database the DBA needs to ensure backups are taken on a regular basis. Data Director simplifies this task by allowing DBAs to set backup policies on the database. The policies will ensure backups are taken automatically once the database is provisioned. This session will walk through how you can set backup policies and show how Data Director automates backup tasks. In this scenario, the database is a critical database and needs to be backed up automatically. It is also required that DBA can restore the database to a point-­‐in-­‐time. The backup policy is set when the database is provisioned. Let’s start by provisioning a new vPostgres database. 11.
12.
13.
14.
15.
16.
Click the Manage & Monitor tab. Click on the vPG database group on the left pane. Click the Databases tab. Click the plus (+) icon to start the Create Database wizard. In Creation Type, select Create Database, click Next. In General, enter the following information. a. Name and Description Enter a name and optionally, a description of the database. b. Database Type Select vPostgres from the drop-­‐down menu. c. Base DB Template Select the vPostgres template from the drop-­‐down menu. d. Database Group This should indicate vPostgres. e. Click Next 17. In Configuration, a. Resource Template Select Tiny. b. Data disc Allocation Select 5GB. c. Parameter group Select the default group. d. Backup Template Maximum. e. PITR disc allocation: Specify 5GB. f. Click Next. 18. In Administrator, a. Owner Account Enter an owner account for the database. b. Password Enter and confirm the owner account password. c. Click Next 19. In Options, a. Expiration Select a date and time when database expires. i. Select Stop Database as the default action. b. Leave others as default, click Next 20. In Summary, click Finish. The database creation will start; see the status in the task bar. Notice that once the database is running, a backup is automatically kicked off. 22 TASK: • Review the various backup template definitions. o To review the definitions, go to Organization Settings page. In the left-­‐pane, click Backup templates. On the center pane, right click on the backup templates and verify the settings. Refer to the administration guide for more details on the settings. • Review the backup setting for the template that was picked for this exercise. Locating Backups In the previous exercise, you used a backup template that automatically created backups. You can review the backups that have been taken. To locate the backup: 1. Right click on the database and click Open. 2. On the right-­‐pane, go to the Backup & Recovery tab. 3. Review the information in the tab a. You can see the list of backups that were taken. b. The timeline of the backup. c. The type of backups that are available etc. Manual Backups You can also take manual backups. 1. To take a manual backup a. On the right-­‐pane, right click on the database. b. Select Backup and Recovery –> Take Manual Backup i. Choose External Backup, click OK. 2. Once the backup is completed, go back to step 3 and review the information. 3. Take another manual backup. This time choose Snapshot as the Type. 4. Once the snapshot is completed, expand the time range slider to cover the entire time range. 5. Notice the various points at which backups were taken. Restoring to a point-­‐in-­‐time Point-­‐in-­‐time restore enables you to recover the database to a precise point in time in the past. With Data Director this task can be accomplished with a single click of the button. To do a point-­‐in-­‐time recovery: 1.
2.
3.
4.
5.
6.
Right click on the database and click Open. On the right-­‐pane, go to the Backup & Recovery tab. Review the timeline by expanding the slider to cover the entire time range. On the blue timeline at the top, locate the spot which you want to recover. Click at that spot. Verify the recovery point time in the dialog. Correct the time, if required. 23 7. Click Ok. 8. You will get a message “Database will be unavailable during recovery”. Click OK. Note: Alternatively, you can click on menu of “Backup & Recovery” to start same recovery from there. Once the recovery is complete and the database is running. Check the database to determine if the changes have been rolled back. Cloning a database A typical production database will have 4-­‐6 copies used by various teams. For a DBA this is a time consuming task due to a variety of reasons. o
o
o
Whenever a new copy of the database is required, the database has to be provisioned and this normally takes hours if not days. It is very hard to maintain compliance when there are multiple copies of databases in the environment. When cloning a sensitive database, DBAs need to ensure sensitive data is not passed on to less privileged users. Enforcing this is typically a manual operation. With Data Director you can clone a database within minutes and also set retention policies and post-­‐
clone scripts that will allow DBAs to enforce compliance. Cloning a database in Data Director is a very simple process. Let’s clone the Oracle database. To clone the Oracle Database: 1.
2.
3.
4.
5.
6.
7.
8.
9.
In the production organization, click the Manage & Monitor tab. On the left pane, click on the default database group On the right-­‐pane, highlight the Oracle database and right-­‐click on it Select Clone, it pops up Clone Database Wizard. In Clone Type, 1) Choose linked clone, 2) Leave others as default, click Next. In General, leave as defaults, click Next in Configuration, 1) Resource Template: Use Medium resource template. 2) Click Next In Options 1) Specify expiration settings. Choose a time when the clone will expire 2) Choose a short time period so that you can verify what happens after the clone expires. 3) For Action, select Stop Database. 4) Click Next In Summary, click Finish. 24 Enforcing Policies using Post-­‐Clone Script When cloning a sensitive database, DBAs need to ensure sensitive data is not passed on to less privileged users. This is typically a manual operation. Using Data Director you can set a policy that will ensure required actions are taken on the database when it is cloned. The post-­‐clone script works in the following manner: o
o
Clone administrator enables post-­‐clone script for a database. The script is executed automatically after the database is cloned. Let’s use an existing database to walk through how an administrator can enable post-­‐clone scripts. Before enabling post-­‐clone scripts, let’s create a few tables in the vPostgres database. 1.
2.
3.
4.
Click the Manage & Monitor tab. Click on the vPG Database Group on the left pane. Click the Databases tab. Right click on the vPostgres database that was provisioned at the beginning of the exercise and click open. 5. Click on the Console button on the top right corner, this will launch the console. 6. Click on Enter SQL button, it pops up SQL editor, create three tables. 1) Run below Create statements in the editor: Create table Customer(Cust_id int, Cust_Name varchar(50)); Create table Customer_Order(Cust_id int, Order_id int); Create table Customer_Payment(Cust_id int, Credit_Card_Number int); 2) Close the editor 3) Close the console. 7. Right click on the database and go to properties. 8. Choose Cloning tab, this is where you will set the cloning policy. Note: You can set a policy where you want to delete all the data in the credit card column and replace it will random numbers. In this example, we will set a policy that will delete the table whenever the database is cloned. 9. Set the policy: 1) Click the (+) sign under post-­‐clone scripts. 2) Type in a name without space: DropCreditCardTable. 3) In the SQL Script window type in DROP Table customer_payment; 25 4) Click Ok. 5) You will see the script listed. Choose that script as the default script from the drop down. 6) Click OK to close the properties window. 10. Now clone the database. To clone the database, repeat the steps above for cloning a database. 1) Give a new name for the database. 2) In Options, pick the scripts DropCreditCardTable. 3) Finish the wizard to start cloning. 11. Once the clone is created, right click on the clone and Connect to the clone 1) Click on the Console button. 2) Need to login database with owner account and password that previously specified during clone. 3) On the right pane, expand schema-­‐>Public and click on tables. 4) You will see the table customer_payment is deleted. NOTE: In this case, you were able to see the drop down list for the scripts. This is because you are logged in as the organization administrator. In the Database-­‐as-­‐a-­‐service exercise, you will login as a regular user and try the same step. You will notice that the default script option is greyed out and cannot be changed. 26 Database-­‐as-­‐a-­‐Service One of the key benefits of cloud computing is the ability to deliver technology needs of the business “as-­‐a-­‐service”. This model enables IT to maintain control and compliance over the environment and allows business users to access the services on-­‐demand. Database-­‐as-­‐a-­‐service enables IT to deliver database infrastructure and services to application developer’s on-­‐demand and provide better quality of service. Key use cases include: •
•
•
•
Provide developers with a self-­‐service portal they can use to provision the required database without IT intervention. Enable IT to quickly provide new database environments as the business needs change. Allow IT to define policies and enforce granular roles and security that enable them to control access to resources and tasks. Allow developers to backup, restore, save database states and develop and test applications against the provisioned databases. Prerequisites •
•
Sessions 1 and 2 have been completed IMPORTANT: Ensure the DevelopmentRB resource bundle has the required storage before you start the exercise. You need to allocate 100GB for data storage and 50GB for backup storage o To edit the resource bundle, login to the console as a system administrator. o Go to System-­‐>Manage and Monitor-­‐>Resource Bundle. o Right click on DevelopmentRB resource bundle and go to properties. o Edit the database storage allocation and change it to 100GB. § NOTE: If you do not have enough storage, delete the databases in the productionRB to free up storage o Edit the backup storage and change it to 50GB. Scenario Workflow The scenario consists of the following steps: 1. Setting up Database-­‐as-­‐a-­‐Service environment • We will walk you through the steps required to setup the DBaaS environment. The DBaaS environment is setup by the organization administrator. The steps include allocating resources, setting up roles and assigning users permissions. 2. Using the self-­‐service portal to deliver DBaaS a. In this step, you will login as one of the DBaaS user and walk through the experience of self-­‐service provisioning and database management. By the end of this session you will learn how to: 27 •
•
Setup a DBaaS environment that will enable IT to deliver database services to the business using self-­‐service. Use self-­‐service portal to deliver database services to end-­‐users. Setting up Database-­‐as-­‐a-­‐Service Environment In this exercise, you will setup the development organization for self-­‐service. The steps to setup the organization for self-­‐service will be done by the organization administrator. The administrator will perform the following steps: •
•
•
•
Enable templates in the organization Create one Database Group named ORCLDev Create a self-­‐service role o This role will allow users to: § Use resources allocated to just the ORCLDev database group § Provision Oracle database using the template § Backup the database § Restore the database to a point-­‐in-­‐time § Clone the database § Monitor statistics § Save database to a catalog § Provision database from the catalog Create a self-­‐service user and assign the user to the role Once these steps are completed, the self-­‐service user can login to the portal and perform the above tasks. Enable Templates in the Organization Organization administrator can choose which templates to enable for use within the organization. This allows administrator to provide a number of pre-­‐configured environments as required by the self-­‐service users. Before you can enable a template within the organization, system administrator should have already assigned the template to the organization resource bundle. This step was completed as part of the provisioning workflow. To enable the template within the organization: 8.
9.
10.
11.
12.
13.
14.
Log in to Data Director as the Organization Administrator for the development organization. Click on Organization Settings. On the left-­‐pane click on Resource bundles. On the right-­‐pane, right click on the resource bundle and click Enable DB templates. Select the Oracle template from the list and select Enable. Click Close. In the task pane on the right, you will see the progress. 28 15. Once the task is completed the template is ready for use within the organization. Create ORCLDev Database Group To create a database group, you have to be logged in as an organization administrator. If you have such a database group already, you can skip the section and reuse a database group. To create a database group: 1.
2.
3.
4.
5.
6.
Log in to Data Director as the Organization Administrator for the development organization Click the Manage & Monitor tab. Click the Database Groups tab. Click the plus (+) icon to create a database group. Specify the following information in the Create Database Group wizard. Do following steps in wizard: 9) Name and Description Type ORCLDev and click Next. 10) Resource Bundle Select the DevelopmentRB resource bundle and click Next. 11) Resources o Network Select the network from the drop-­‐down menu. o CPU & Memory Leave the priority at the default value. o Database Storage Specify at least 250GB for data o Backup storage:150GB for backup. o Click Finish. Next you will create the self-­‐service role. Create a Role To create a role, you have to be logged in as an organization administrator. 7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
Log in to Data Director as the Organization Administrator for the development organization. Click on Organization Settings. On the left-­‐pane, expand Users and Roles and click on Roles. On the right-­‐pane, click on the (+) sign to Create a Role. Type in a name – ORCLDevSelfServiceRole. Leave the status as Enable. Leave all the permissions unchecked in the Organization tab. Click on the Database Group tab. Click on Add and select the ORCLDev database group from the list. Select the permissions to the database group. 29 17. Click on the Templates tab. 18. Click on Add. 19. In the Resource Templates tab, select a. Medium and Large. 20. Click on the Backup Template tab, select a. Standard (Auto Storage Management). 21. Click Ok to back to main dialog, assign permissions to each template. 22. Confirm by clicking OK. At this point, the role has been successfully created. Next you will create a self-­‐service user and assign the user to this role. Create a Self-­‐Service User To create a self-­‐service user, you should be logged in as the organization administrator 1.
2.
3.
4.
Click on Organization Settings. On the left-­‐pane, expand Users and Roles and click on Users. On the right-­‐pane, click on the (+) sign to Create a User. In the dialog box, fill in the required fields under Credentials and Contact Information 1) For user name you have to use the following format. i. username@domain.com Note down the user name and password. 30 5. Under Permissions, select Grant roles now, click Edit 6. Select role ORCLSelfServiceRole. 7. Click Ok. Use Self-­‐Service Portal to Deliver Database Services to end-­‐users In this exercise, you will login as the self-­‐service user and perform the self-­‐service tasks. 1. Login as the self-­‐service user to the portal. Notice that the user has access only to the ORCLdev database group. 2. Test the following actions: a. Create an Oracle database. i. Pick any configuration of your choosing b. Create an external backup. c. Create a snapshot. d. Create a linked clone. e. Restore the database. i. NOTE: You can do point in time restore only if you choose the standard backup template f. Save the database state to the catalog. i. To save the database into a catalog, right click on the database and select Add to Catalog. ii. In the dialog box 1. Enter a new name or leave it at the default. 2. For Add action, select Clone source to catalog and choose linked clone. iii. Click Ok. iv. To see the catalog item, click on the organization name on the right pane, v. Go to the Catalog tab. g. Provision the database from the catalog. i. Once saved into the catalog, you can re-­‐provision the database. ii. To re-­‐provision the database, go to Catalog tab. iii. Select the database from the catalog. iv. Right-­‐click on the database and select Create database based on… 31 h. Edit Permission to the catalog database so that you can allow certain database service for only certain end users. 32 Database Patching One of the main challenges faced by IT today is maintaining patch compliance. Database sprawl, combined with the volume of patches that need to be applied, makes patching a time-­‐consuming and manual process. Patching a database environment and keeping it compliant involves understanding the current patch levels, testing the patches and updating the database server with the required patches. vFabric Data Director addresses this problem in two ways. Using vFabric Data Director, an administrator can control database sprawl using database templates. This helps create a standardized environment over which DBAs have control and visibility. Additionally, the patch management feature of Data Director helps to maintain compliance by helping DBAs to quickly identify non-­‐compliant servers and apply patches across multiple servers, using a single click. The patch management feature can be utilized to apply both OS and database patches. This session will walk you through the workflow for patching an existing database VM. Prerequisites •
•
•
Within the Production organization, the following templates have been enabled in the vPostgres database group. o vPostgres 9.0 o vPostgres 9.1 o NOTE: The Production organization and the vPostgres group within the organization were created in Activity Guide 1. A vPostgres 9.0 database has been created in the vPostgres group. An Oracle base DB template (e.g. Oracle 11.2.0.1) has been created and enabled in the Oracle group in the Production organization. vPostgres Update The scenario describes how to update or patch an existing vPostgres database. The patching workflow consists of the following steps: 7. Prepare and configure update path • In this step, administrators need to configure the relationship between two templates and describe how to update them. 8. Update and patch live database(s) a. In this exercise, you will login as one of the organization users and do the update for vPostgres. 33 Prepare and configure update path To configure the update path, follow the steps below: 16.
17.
18.
19.
Login to Data Director console as system administrator. Click “Manage and Monitor”. Expand “Templates”, Click “Base DB Templates”. Select template “vPostgres 9.1”. Right click “vPostgres 9.1” and open the property dialog. 1) The names shown here are sample names. Apply the settings to the vPostgres 9.1 template in your environment. 20. Choose “Update From” tab, Check “vPostgres 9.0”, click “OK”. Update and patch the live databases Once the update path has been setup by system administrator; the organization users can now update their existing databases. To do the update on live databases: 1.
2.
3.
4.
5.
Login to the Data Director console as an organization user Click “Manage & Monitor”. Expand “vPostgres” group. Right click on an existing vPostgres 9.0 database. Click “Update…” from the context menu. a. You can also multi-­‐select more than one database and click “Update…” from the context menu. This will update all the selected databases. 6. In the Update dialog: 34 a. Set “Update to:” to “vPostgres 9.1”. This is the name of the vPostgres 9.1 template. Choose the appropriate template in your environment. b. Select “Default” parameter group. c. Check “Keep existing values when possible”. d. Check “Take a snapshot backup before starting the upgrade”. e. Uncheck “Automatically cancel if update fails”. 7. Click “OK” to start the update process. The database will be unavailable during the update process. 8. In a few minutes, the database will be updated to the newer version. To check the database version, right click the database, click Properties, check Database version field shown in the Basic tab. It should display 9.1 now. Oracle Update The scenario describes how to apply patches to an Oracle database server. Patching an existing Oracle database consists of the following steps: 1. Prepare an Oracle template with patches • Before you can patch existing databases, system administrator needs to create a new Oracle template which includes the patches that need to be applied. 2. Configure update path • In this step, administrator needs to configure the relationship between two templates and describe how to update them. 3. Update and patch on live databases • In this step, you will login as an organization user and do the patch update for an existing Oracle database(s). Prepare an Oracle template with the required patches The first step in the patching process is to create an Oracle template with the required patches. To create a template with the required patches, a base database VM of the Oracle database that needs to be patched has to be available. To check if the base database VM for a provisioned database is available, follow the steps below: 1.
2.
3.
4.
5.
6.
Login to Data Director Console as an organization administrator. Select organization, choose Manage and Monitor. In left pane, select the name of database group. Select the database that has to be patched and right click on the database. Click on Properties. Check the name in the Base DB template text box. The name represents the template that was used to create the database. 35 Once you have identified the template, you need the corresponding database VM. To create a base database VM from an existing template: 1. Login to Data Director as system administrator. a. Click “Manage and Monitor” b. Expand “Templates”, click “Base DB Templates” c. Select the oracle template that was identified from the previous step, right click and select “Export to Base DBVM…”. d. Once the task is complete, click on Base DBVMs on the left pane. You will see the base database VM listed on the right pane. e. NOTE: Depending on the save option you chose when you converted the base database VM to a template, the base VM may already be available. The next step is to apply the patch to the base database VM. For this exercise, we will use PSU 12419378 as an example. To apply a patch, you will have to login to the base database VM console. Follow the steps below to apply PSU 12419378. 1. Connect to the Base DBVM console. You can either do this from vSphere client or other SSH terminals. 2. Download the PSU 12419378 package from Oracle website. 3. Upload p6880880_112000_Linux-­‐x86-­‐64.zip to /tmp directory in the database VM. 4. Upgrade opatch according to README.txt. 5. Apply PSU 12419378 according to README.html. IMPORTANT: Defer the steps in the section 'Patch Post-­‐Deinstallation Instructions'. 6. Create a post upgrade script in this DBVM. a. This file is located in /opt/aurora/agent2/plugin/vfdd_linux_oracle_11/upgrade_script. The directory upgrade_script needs to be created manually. And the script file should be named as postupgrade_script. b. Make the upgrade_script directory owner as oracle:oinstall with privilege 755, and the script file owner as oracle:oinstall with privilege 755. 7. The ‘Patch Post-­‐Deinstallation Instructions' of PSU guide provides details of the script that has to be executed. Copy the script into the postupgrade_script file. 8. in this example the following script has to be executed: #!/bin/bash sqlplus / as sysdba << EOF startup @$ORACLE_HOME/rdbms/admin/catbundle.sql psu apply quit EOF 9. At this point you have completed updating the base database VM with PSU 12419378. Once the base database VM has been prepared, the next step is to convert it into a database template. To convert the base database VM into a template: 1. Login to the Data Director console as a system administrator. 36 2. Right click on the updated base database VM. 3. Click on Convert to Base DB Template. 4. Make sure to check the Save the database VM checkbox and click OK. Once the template conversion is completed successfully, assign the template to the Organization that contains the database that needs patching. In this case you should assign the template to the Production organization. To assign the template to the Production organization, right click on the template and assign it to the resource bundle corresponding to the production organization. Once the database template has been assigned to the organization, enable the template in the organization. To enable the template: 1. Login to Data Director console as the production organization administrator. 2. Click on Manage and Monitor -­‐>Base DB Templates 3. Select the patched template and right click on it. 4. Click Enable on Resource Bundles. 5. In the dialog, select the template and click the Enable button. The template is now ready to be used for patching the database. Configure update path The steps to configure the update path are similar to what was described for vPostgres. In this case right click on the patched template and go to properties. In the Update From tab, select the template that was used to provision the existing database. Update and patch on live databases The steps to patch the Oracle database are same as the steps to patch the vPostgres database. 37