OpenEdge 11.5 Table Partitioning Workshop

Similar documents
Enhance Database Performance and Scalability

abstract 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.

FIMS V You will need to know all of the following items before customizing the script and setting up the schedule.

Horizontal Table Partitioning

ABL Code Performance Workshop: Take 3. You don't know *beep* about indexes

MYOB Advanced Business

Online Demo Guide. Barracuda PST Enterprise. Introduction (Start of Demo) Logging into the PST Enterprise

Progress OpenEdge. > Getting Started. in the Amazon Cloud.

Dump & Load: More than just a few Proutil Commands Paul Koufalis, White Star Software

SC-T35/SC-T45/SC-T46/SC-T47 ViewSonic Device Manager User Guide

Administrator s Guide

SafeConsole On-Prem Install Guide

Develop Content SoftChalk Create

Virtual CD TS 1 Introduction... 3

Getting Started With the Cisco PAM Desktop Software

Wavelink Avalanche Site Edition Java Console User Guide. Version 5.3

MCITP CURRICULUM Windows 7

INSTALL GUIDE BIOVIA INSIGHT 2016

Microsoft Windows Servers 2012 & 2016 Families

Introduction to IBM Rational HATS For IBM System i (5250)

Perceptive Nolij Web. Administrator Guide. Version: 6.8.x

Guided exercise 1: Setting up your development environment

Installation Guide for Demo Site Using VMware Image

Migrate From Version 2.2 to Version 3.1 Guide

Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services

Install and upgrade Qlik Sense. Qlik Sense 3.0 Copyright QlikTech International AB. All rights reserved.

Exercises. Cacti Installation and Configuration

Exercises. Cacti Installation and Configuration

QuickStart Guide for Managing Computers. Version

ControlPoint. Advanced Installation Guide. September 07,

EML10 Best Practces for Implementing Deployment Solution Hands-On Lab

IS L02-MIGRATING TO SEP 12.1

INSTALL GUIDE BIOVIA INSIGHT 2.6

SafeConsole On-Prem Install Guide. version DataLocker Inc. July, SafeConsole. Reference for SafeConsole OnPrem

Lesson 9 Transcript: Backup and Recovery

Contents Using the Primavera Cloud Service Administrator's Guide... 9 Web Browser Setup Tasks... 10

BitDefender Enterprise Manager. Startup guide

Vector Issue Tracker and License Manager - Administrator s Guide. Configuring and Maintaining Vector Issue Tracker and License Manager

Wavelink Avalanche Mobility Center Java Console User Guide. Version 5.2

Plan Sponsor Security Quick Reference

TELEVISION. WiFi Plans. Interactive Guide and DVR (Digital Video Recorder) Manual. WiFi ARVIG arvig.net/wifitv. Delivered by Arvig

Attix5 Pro Storage Platform Console

QuickStart Guide for Managing Computers. Version 9.73

DocAve 6 Lotus Notes Migrator

UP L12: Still on SEP 11? Let us show you how to simplify migration to SEP.

QuickStart Guide for Managing Computers. Version 9.32

Backup everything to cloud / local storage. CloudBacko Home. Essential steps to get started

McAfee Management for Optimized Virtual Environments AntiVirus 4.5.0

This guide details the deployment and initial configuration necessary to maximize the value of JetAdvantage Insights.

HandHeld Dolphin 7400 Client User Guide. Version 4.0. Revised

EMS DESKTOP CLIENT Installation Guide

TELEVISION. WiFi Plans. Interactive Guide and DVR (Digital Video Recorder) Manual for the Amazon Fire TV Stick. WiFi ARVIG arvig.

Demo Lab Guide vworkspace

IT Essentials v6.0 Windows 10 Software Labs

Installation of Cisco Business Edition 6000H/M

Building reports using the Web Intelligence HTML Report Panel

EMC SourceOne for File Systems

EPiServer Installation Instructions

Lab - Remote Desktop in Windows 7 and Vista

Installation Guide for Pulse on Windows Server 2012

Collage II Tips and Tricks

QuickStart Guide for Managing Computers. Version

ADMINISTRATOR S GUIDE

GX-V. Quick Start Guide. VMware vsphere / vsphere Hypervisor. Before You Begin SUMMARY OF TASKS WORKSHEET

EnterpriseLink Benefits

K2 ServerSave Installation and User Guide

TELEVISION. WiFi Plans. Interactive Guide and DVR (Digital Video Recorder) Manual for the Amazon Fire TV Stick. WiFi ARVIG arvig.

Extended Search Administration

UOB Offline Data Input Software (ODIS)

Parallels Helm Initial Setup Guide REVISION 1.0

Make Your Computer Get Along With the MLS - 7 Easy Steps - (with pictures!)

What you will need. 1 P a g e

Google Drive: Access and organize your files

docalpha Installation Guide

DocAve 6 Lotus Notes Migrator

Service Manager. Installation and Deployment Guide

STEP 1: PREPARE FOR DATA MIGRATION 1. Right-click the desktop and choose New > Folder. a. Type For Transferring and press Enter to name the folder.

Macintosh OS X Tips. Mail Tips

DSS Professional FAQ. Ver:

Avalanche Remote Control User Guide. Version 4.1

VMware Identity Manager Cloud Deployment. Modified on 01 OCT 2017 VMware Identity Manager

Active Directory Services with Windows Server

VMware Identity Manager Cloud Deployment. DEC 2017 VMware AirWatch 9.2 VMware Identity Manager

Installation Guide. Cimatron Site Manager 2.0 Release Note

Table of Contents. VMware AirWatch: Technology Partner Integration


Version Installation Guide. 1 Bocada Installation Guide

Sage SQL Gateway Installation and Reference Guide

BackupAgent Service Provider Deployment Guide

AvePoint Governance Automation 2. Release Notes

SOCE Wordpress User Guide

Lab 1: Accessing the Linux Operating System Spring 2009

PARTNER ACS R6.0 PC Administration Getting Started

Table of Contents HOL-1757-MBL-6

CREATING CUSTOMER MAILING LABELS

OU EDUCATE TRAINING MANUAL

VMware Mirage Web Manager Guide

User s Manual. Version 5

Easy Time Control Training Manual

Course CLD221x: Enabling Office 365 Clients

Transcription:

OpenEdge 11.5 Table Partitioning Workshop Page 1 of 45

Table of Contents Preface... 3 Setting up your environment... 5 Preparing database for table partitioning... 7 Creating partition policy (LIST partition)... 15 BONUS LAB... 27 Creating partition policy (RANGE partition)... 28 BONUS LAB... 36 DB tools to manage table partitions... 38 Backup your DB online... 38 Indexbuild online for partitions... 38 Merging partitions... 39 Enable READ ONLY Partition... 41 Page 2 of 45

Preface This guide is designed to quickly introduce you to the basics of OpenEdge Horizontal Table Partition. We ll only cover some of the core functionality in this guide HOW TO USE THIS GUIDE This guide is designed to flow from one lesson to the next, with each lesson building on the previous. This lesson will start with basic OpenEdge database storage area definition; how to move your existing database from Storage area I to Storage area II, including tables and index moves. You will create list and range partitions for the database. There are also a couple of additional bonus labs if you have time and interested. In the end, there are some useful commands how you can manage your database partitions. To best leverage this guide, it is recommended you perform the operations as you read them, taking breaks between lessons as required. CONVENTIONS USED IN THIS GUIDE This document uses the following conventions to distinguish elements of text: > Bold Text that you should type, e.g. proenv>prodb sportshtp sports2000 > Italics Notes and tips that give you more info Page 3 of 45

Getting started with Progress Arcade WHAT IS PROGRESS ARCADE? Progress Arcade is a web portal where you can deploy and manage Progress applications in a Cloud-based environment. You can use Arcade to migrate existing Progress applications to a public Cloud environment, run and test the application in the Cloud, and then deploy the application. Deployment includes the ability to host demos or to publish applications that are available to subscribers. Progress Arcade is also a site where you can interact with other Arcade users, and find out about services offered by various Progress Technology Partners. HOW DO I ACCESS THE FEATURES OF PROGRESS ARCADE? The features of Progress Arcade are grouped into functional areas, represented by six panels on the Arcade home page. The panels include: > Stage & Test Gain experience in running your application in the public cloud. > Deploy - Deploy your application into full production for customer use directly from the public cloud (not currently available). > Demo Publish your application for demonstration purposes using the public cloud. > Expo Search for information on complementary products and services offered by the Progress community. > Community Café Access Progress product resources and network with others in the Progress community. > Product Showroom Learn about the features and benefits of Progress products. Specify what technology you are interested in, and within minutes get a public cloud-based machine dedicated to your exclusive use. Page 4 of 45

Setting up your environment LAUNCHING YOUR OPENEDGE DEMO MACHINE ON PROGRESS ARCADE To launch your OpenEdge Horizontal Table Partition machine, follow these steps: 1. Several machines have been started for this workshop. Each of you will be given a unique DNS address by the workshop host at this point which points to a virtual windows server running on Progress Arcade. 2. On your laptop, choose Start Accessories Remote Desktop Connection and paste your unique DNS into the Computer field. Click the Connect button. You may need to click the button left of Options to change (erase) the domain name. 3. Enter Administrator as the Username, and Huhtikuu2015 as the Password. Page 5 of 45

4. Click the Yes button to say you trust this remote connection. 5. You should now be connected to the demonstration machine running in Progress Arcade. Note: The machine instance has may have a different keyboard setting than what you are using. If your laptop has a different keyboard, you may need to set this up yourself on the machine instance through Control Panel Region and Language settings. Page 6 of 45

Preparing database for table partitioning Preparing database for horizontal table partition In this workshop, we are going to use Sports2000 database - surprisingly!! :-) Start your PROENV (Start-Programs-OpenEdge-PROENV) window or click Proenv on your Desktop. Type the following command to create a new database: Page 7 of 45

proenv>prodb sportshtp sports2000 Procopy session begin for Administrator on CON:. (451) Database copied from C:\Progress\OpenEdge\sports2000. (1365) Procopy session end. (334) Start your database: proenv>proserve sportshtp -S 7878 07:42:31 BROKER This broker will terminate when session ends. (5405) 07:42:31 BROKER The startup of this database requires 17Mb of shared memory. Maximum segment si ze is 1024Mb. 07:42:31 BROKER 0: Multi-user session begin. (333) 07:42:31 BROKER 0: Before Image Log Initialization at block 0 offset 647. (15321) 07:42:31 BROKER 0: Login by Administrator on CON:. (452) 07:42:32 BROKER 0: Started for 7878 using TCP IPV4 address 0.0.0.0, pid 2040. (5644) If you open your sportshtp.st file (c:\openedge\wrk folder) you will see the current structure for this database: # b. # d "Schema Area":6,32;1. # d "Employee":7,32;1. f 320 d "Employee":7,32;1. # d "Inventory":8,32;1. f 640 d "Inventory":8,32;1. # d "Cust_Data":9,32;1. f 320 d "Cust_Data":9,32;1. # d "Cust_Index":10,32;1. f 320 d "Cust_Index":10,32;1. # d "Order":11,32;1. f 1280 d "Order":11,32;1. # d "Misc":12,32;1. f 320 d "Misc":12,32;1. Page 8 of 45

As you probably know, this DB will be by default TYPE I database (last digit is 1 see above). To use existing database, we need to create storage TYPE II areas for horizontal table partitioning. If you do have storage TYPE I database, you can follow the instructions here to move your database completely to storage TYPE II areas (no need to do now!!): This is also a bookmark in your Chrome browser. http://knowledgebase.progress.com/articles/article/p124708?q=type+ii&l=en_us&c=product_group%3aopenedge&fs=search&pn= 1 In this case, we will add the following new area (TYPE II) for existing DB: Contents of file: c:\openedge\wrk\sportshtp_areas.st # ------------ Finland data area; customers from Finland d "Finland_data":27,32;8. f 320 d "Finland_data":27,32;8. d "Finland_index":29,32;8. # ------------ USA data area; customers from USA d "USA_data":30,32;8. f 320 d "USA_data":30,32;8. d "USA_index":32,32;8. # ------------ Rest of the customers from other countries d "Customer_data":33,32;8. f 320 d "Customer_data":33,32;8. d "Customer_index":35,32;8. # ------------ Order range partitions will be store here d "OrderData_data":45,32;8. d "OrderData_index":46,32;8. d "Order2013_data":47,32;8. d "Order2013_index":48,32;8. d "Order2014_data":49,32;8. d "Order2014_index":50,32;8. d "Order2015_data":51,32;8. d "Order2015_index":52,32;8. d "Order2016_data":53,32;8. d "Order2016_index":54,32;8. d "OrderVeryOld_data":55,32;8. d "OrderVeryOld_index":56,32;8. d "Order_index":57,32;8. The following command will create the above areas for you: proenv>prostrct addonline sportshtp sportshtp_areas.st Converting relative path database to absolute path database. (8461) Formatting extents: size area name path name 80 Finland_data C:\OpenEdge\WRK\sportsHTP_27.d1 00:00:00 16 Finland_data C:\OpenEdge\WRK\sportsHTP_27.d2 00:00:00 Page 9 of 45

16 Finland_index C:\OpenEdge\WRK\sportsHTP_37.d1 00:00:00 80 USA_data C:\OpenEdge\WRK\sportsHTP_28.d1 00:00:00 16 USA_data C:\OpenEdge\WRK\sportsHTP_28.d2 00:00:00 16 USA_index C:\OpenEdge\WRK\sportsHTP_38.d1 00:00:00 80 Customer_data C:\OpenEdge\WRK\sportsHTP_29.d1 00:00:00 16 Customer_data C:\OpenEdge\WRK\sportsHTP_29.d2 00:00:00 16 Customer_index C:\OpenEdge\WRK\sportsHTP_39.d1 00:00:00 16 OrderData_data C:\OpenEdge\WRK\sportsHTP_45.d1 00:00:00 16 OrderData_index C:\OpenEdge\WRK\sportsHTP_46.d1 00:00:00 16 Order2013_data C:\OpenEdge\WRK\sportsHTP_47.d1 00:00:00 16 Order2013_index C:\OpenEdge\WRK\sportsHTP_48.d1 00:00:00 16 Order2014_data C:\OpenEdge\WRK\sportsHTP_49.d1 00:00:00 16 Order2014_index C:\OpenEdge\WRK\sportsHTP_50.d1 00:00:00 16 Order2015_data C:\OpenEdge\WRK\sportsHTP_51.d1 00:00:00 16 Order2015_index C:\OpenEdge\WRK\sportsHTP_52.d1 00:00:00 16 Order2016_data C:\OpenEdge\WRK\sportsHTP_53.d1 00:00:00 16 Order2016_index C:\OpenEdge\WRK\sportsHTP_54.d1 00:00:00 16 OrderVeryOld_data C:\OpenEdge\WRK\sportsHTP_55.d1 00:00:00 16 OrderVeryOld_index C:\OpenEdge\WRK\sportsHTP_56.d1 00:00:00 16 Order_index C:\OpenEdge\WRK\sportsHTP_57.d1 00:00:00 Enabling extents: size area name path name (13170) 80 Finland_data C:\OpenEdge\WRK\sportsHTP_27.d1 00:00:00 16 Finland_data C:\OpenEdge\WRK\sportsHTP_27.d2 00:00:00 16 Finland_index C:\OpenEdge\WRK\sportsHTP_37.d1 00:00:00 80 USA_data C:\OpenEdge\WRK\sportsHTP_28.d1 00:00:00 16 USA_data C:\OpenEdge\WRK\sportsHTP_28.d2 00:00:00 16 USA_index C:\OpenEdge\WRK\sportsHTP_38.d1 00:00:00 80 Customer_data C:\OpenEdge\WRK\sportsHTP_29.d1 00:00:00 16 Customer_data C:\OpenEdge\WRK\sportsHTP_29.d2 00:00:00 16 Customer_index C:\OpenEdge\WRK\sportsHTP_39.d1 00:00:00 16 OrderData_data C:\OpenEdge\WRK\sportsHTP_45.d1 00:00:00 16 OrderData_index C:\OpenEdge\WRK\sportsHTP_46.d1 00:00:00 16 Order2013_data C:\OpenEdge\WRK\sportsHTP_47.d1 00:00:00 16 Order2013_index C:\OpenEdge\WRK\sportsHTP_48.d1 00:00:00 16 Order2014_data C:\OpenEdge\WRK\sportsHTP_49.d1 00:00:00 16 Order2014_index C:\OpenEdge\WRK\sportsHTP_50.d1 00:00:00 16 Order2015_data C:\OpenEdge\WRK\sportsHTP_51.d1 00:00:00 16 Order2015_index C:\OpenEdge\WRK\sportsHTP_52.d1 00:00:00 16 Order2016_data C:\OpenEdge\WRK\sportsHTP_53.d1 00:00:00 16 Order2016_index C:\OpenEdge\WRK\sportsHTP_54.d1 00:00:00 16 OrderVeryOld_data C:\OpenEdge\WRK\sportsHTP_55.d1 00:00:00 16 OrderVeryOld_index C:\OpenEdge\WRK\sportsHTP_56.d1 00:00:00 16 Order_index C:\OpenEdge\WRK\sportsHTP_57.d1 00:00:00 (NOTE: You can also remove these areas using the following command but no need to do it now!!: Page 10 of 45

Database have to be offline in this case. C:\OpenEdge11.4Beta\WRK>proutil sportshtp -C truncate BI C:\OpenEdge11.4Beta\WRK>prostrct remove sportshtp d "OrderData_index ) Now we will have these new areas, but the existing data and indexes are still located in the TYPE I areas. We have to move these tables and indexes from TYPE I area to TYPE II area. You can use tablemove and indexmove commands for that. The following command will move Customer table from TYPE I storage area to the TYPE II storage area: proenv>proutil sportshtp-c tablemove customer Customer Attempting to obtain an exclusive lock on customer [2]... (8595) If you'd like to cancel this operation, press CTRL-C. (8581)...lock on customer [2] has been obtained, tablemove in process. (8597) Table customer [2] has been moved to area Customer [29]. (8613) You can run the script TableAndIndexMoves.bat and it will move all the Customer and Order data to the TYPE II storage area including indexes. The script contains the following: call proutil sportshtp -C tablemove customer Customer_data call proutil sportshtp -C indexmove Customer.SalesRep "Customer_index" call proutil sportshtp -C indexmove Customer.Name "Customer_index" call proutil sportshtp -C indexmove Customer.Custnum "Customer_index" call proutil sportshtp -C indexmove Customer.CountryPost "Customer_index" call proutil sportshtp -C indexmove Customer.Comments "Customer_index" call proutil sportshtp -C tablemove order OrderData_data call proutil sportshtp -C indexmove Order.CustOrder "OrderData_index" call proutil sportshtp -C indexmove Order.OrderDate "OrderData_index" call proutil sportshtp -C indexmove Order.OrderNum "OrderData_index" call proutil sportshtp -C indexmove Order.OrderStatus "OrderData_index" call proutil sportshtp -C indexmove Order.SalesRep "OrderData_index" proenv>tableandindexmoves.bat C:\OpenEdge\WRK>call proutil sportshtp-c tablemove customer Customer_data Attempting to obtain an exclusive lock on customer [2]... (8595) If you'd like to cancel this operation, press CTRL-C. (8581)...lock on customer [2] has been obtained, tablemove in process. (8597) Table customer [2] has been moved to area Customer_data [29]. (8613) Attempting to obtain an exclusive lock on Customer.SalesRep [16]... (8580) If you'd like to cancel this operation, press CTRL-C. (8581)...lock on Customer.SalesRep [16] has been obtained, indexmove in process. (8583) Index Customer.SalesRep [16] has been moved to area Customer_index [39]. (8589) Page 11 of 45

Attempting to obtain an exclusive lock on Customer.Name [15]... (8580) If you'd like to cancel this operation, press CTRL-C. (8581)...lock on Customer.Name [15] has been obtained, indexmove in process. (8583) Index Customer.Name [15] has been moved to area Customer_index [39]. (8589) Attempting to obtain an exclusive lock on Customer.Custnum [12]... (8580) If you'd like to cancel this operation, press CTRL-C. (8581)...lock on Customer.Custnum [12] has been obtained, indexmove in process. (8583) Index Customer.Custnum [12] has been moved to area Customer_index [39]. (8589) Attempting to obtain an exclusive lock on Customer.CountryPost [14]... (8580) If you'd like to cancel this operation, press CTRL-C. (8581)...lock on Customer.CountryPost [14] has been obtained, indexmove in process. (8583 Index Customer.CountryPost [14] has been moved to area Customer_index [39]. (8589) Attempting to obtain an exclusive lock on Customer.Comments [13]... (8580) If you'd like to cancel this operation, press CTRL-C. (8581)...lock on Customer.Comments [13] has been obtained, indexmove in process. (8583) Index Customer.Comments [13] has been moved to area Customer_index [39]. (8589) Attempting to obtain an exclusive lock on order [18]... (8595) If you'd like to cancel this operation, press CTRL-C. (8581)...lock on order [18] has been obtained, tablemove in process. (8597) Table order [18] has been moved to area OrderData_data [45]. (8613) Attempting to obtain an exclusive lock on Order.CustOrder [48]... (8580) If you'd like to cancel this operation, press CTRL-C. (8581)...lock on Order.CustOrder [48] has been obtained, indexmove in process. (8583) Index Order.CustOrder [48] has been moved to area OrderData_index [46]. (8589) Attempting to obtain an exclusive lock on Order.OrderDate [49]... (8580) If you'd like to cancel this operation, press CTRL-C. (8581)...lock on Order.OrderDate [49] has been obtained, indexmove in process. (8583) Index Order.OrderDate [49] has been moved to area OrderData_index [46]. (8589) Attempting to obtain an exclusive lock on Order.OrderNum [47]... (8580) If you'd like to cancel this operation, press CTRL-C. (8581)...lock on Order.OrderNum [47] has been obtained, indexmove in process. (8583) Index Order.OrderNum [47] has been moved to area OrderData_index [46]. (8589) Attempting to obtain an exclusive lock on Order.OrderStatus [50]... (8580) If you'd like to cancel this operation, press CTRL-C. (8581)...lock on Order.OrderStatus [50] has been obtained, indexmove in process. (8583) Index Order.OrderStatus [50] has been moved to area OrderData_index [46]. (8589) Attempting to obtain an exclusive lock on Order.SalesRep [51]... (8580) If you'd like to cancel this operation, press CTRL-C. (8581) Page 12 of 45

...lock on Order.SalesRep [51] has been obtained, indexmove in process. (8583) Index Order.SalesRep [51] has been moved to area OrderData_index [46]. (8589) You can now run DBANALYS to see the changes in our sportshtp database using the following command: proenv>proutil sportshtp -C dbanalys > sportshtp_1.txt (Open the file c:\openedge\wrk\sportshtp_1.txt using NotePad++) As you can see from the DBANALYS (picture below, Rows 1401-1640 in your Notepad++), Customer and Order tables and all the data has moved from TYPE I storage area to the TYPE II area the new area we have just created. USA and Finland areas are still empty. We will use those later on after enabling table partitioning. (NOTE: There are new options for dbanalys in OpenEdge 11.4: proenv>proutil sportshtp C dbanalys csoutput fieldsep, verbose > sportshtp.analys.txt You will get four new files in your c:\openedge\wrk directory: sportshtp.ch sportshtp.ix sportshtp.tab sportshtp.block You can use e.g. Excel to read the context of these files easily: Page 13 of 45

) So far, we haven t done anything for the horizontal table partition. We have now prepared our existing database for this. If your own database is already in TYPE II Storage area, you don t need to take these steps at all! Next, we are going to use OpenEdge Explorer / OpenEdge Management tool to enable horizontal table partition. Page 14 of 45

Creating partition policy (LIST partition) Start your Chrome browser and go to http://localhost:9090 or click the bookmark on your Chrome browser (if you don t have access for this, make sure your admin server is up and running in PROENV window proadsv query will show the status of your admin server and proadsv start will start your admin server, if it s not running) Username: admin Passoword: progress Go to Database Administration New Database Connection Page 15 of 45

Type the info above (Adminserver is your machine name there is only one in the list, so choose that one) and press Save! Select your new database connection (sportshtp) from the left column. After that you will see on your right hand side Database Features section. Click now Enable for Table Partitioning. (NOTE: You can also use PROENV window to enable your table partitioning. Command is: PROUTIL SportsHTP C enabletablepartitioning) Page 16 of 45

And now status is green for Table Partitioning see below We will create a list partition for customer table. In this scenario, we have a need to have separate table partitions for Finland and USA customers. In OEM (sportshtp database connection), click Create partition policy link. Page 17 of 45

Fill-in the above info for creating customer CountryPolicy partition and then click next. Click Add fields from index, select CountryPost and then press OK button. Page 18 of 45

Select PostalCode and click Remove Field. In this case, we want create only list partitions for countries regardless PostalCode values. Page 19 of 45

Select CountryPost - it will become a local index when creating a policy for Customer table. Note: All the indexes for customer table are now Global index also CountryPost see below (you can see this in Data Dictonary there is a shortcut on your desktop for Data Dictonary): Page 20 of 45

Click Properties button to open template for this policy. Clear the Name template field. 1. Select TableName row and press Copy button. 2. Then add _ underscore character 3. Select Values[1] row and press Copy button again Name template value will be after these steps: ${TableName}_${Values[1]}. Press OK. Page 21 of 45

Make sure your Name template is the same than in your previous screen and you have _ underscore character between Tablename and Values. Click Load details and you will see that 9 partition records were discovered from your database. Press Next to the final screen. And Press Finish Page 22 of 45

Now, click Edit Details for this CountryPolicy Change Data and Index areas for Finland and USA countries and then press Commit. You have to commit these before you can select Split-target option. After clicking Commit button, make sure you will select Split-target as well for Finland and USA countries! You can do these steps by double-clicking Partitions button on the Partitions column. If you click Partitions button, you can also change the buffer pool for the tables, but no need to change it now: Page 23 of 45

Click Cancel. Make sure you have clicked Commit button! You can verify now that global CountryPost index is now a local index. Database is now in transition mode and you cannot use this local index, until you have run the command to split the data for these partitions. For example, the following ABL code will work, because it s using a global index (custnum): for each customer where custnum < 100. disp custnum country. end. But if you want to run the following query, which is now using the local CountryPost index, it will not work and you will get an error message. Page 24 of 45

for each customer where country = "Finland". disp custnum country. end. Run the following command to split the data for different partitions (in this case Finland and USA customers) proenv>proutil sportshtp -C partitionmanage split table customer composite initial BEGIN: Split Operation For Table customer (17384) Source Partition initial[0] Target Partition Customer_Finland[1] Target Partition Customer_USA[2] Index CountryPost has been identified as the scanning index (selected). A non-unique index has been selected as the useindex index. Additional locking is required with the use of this index CountryPost. Number of Records per Transaction (recs): 100 Do you want to continue (y/n)? y Target partition: Customer_Finland[1], records moved: 28. Target partition: Customer_USA[2], records moved: 1059. Source partition: initial[0], still contains records. Total records processed: 1087. END: Split Operation For Table customer[0] Split Operation finished successfully. (17359) You can see that 28 records moved to Finland partition and 1059 records for USA partition. Run dbanalys to see and verify the status of USA and Finland customers now: proenv>proutil sportshtp -C dbanalys > sportshtp_split.txt (you will find this file on c:\openedge\wrk folder.) Page 25 of 45

Dbanalys will show for you these table partitions and also how many records do these contains. Rest of the data (other countries than Finland and USA) is still located in customer table (Composite). You will find this info starting from row 1439 when using Notepad++. Just a very simple example: Run Procedure Editor with the following code: Find first customer. disp name country. /* Country is USA in the first run */ assign country = "Finland". /* We will change the country from USA to Finland */ When running dbanalys again (proenv>proutil sportshtp-c dbanalys -> sportshtp_split_2.txt), you will see that there is one record more in Finland partition and one record less in USA partition. No need to change your business logic!! Page 26 of 45

BONUS LAB If you have extra time, you can create a new storage area for the remaining countries e.g. add_new_storage_areas.st d Italy_data :80,32:8. d Italy_index :81,32:8. etc.. And then use the following command to add areas to the database online: proenv>prostrct addonline sportshtp add_new_storage_areas.st Page 27 of 45

Creating partition policy (RANGE partition) For this exercise, you need to load some data for the Order table. We will load some orders for 2013 and 2014. Open Data Administation and select Table Contents. Select Order table and press OK Page 28 of 45

Select input file Order2013_2014.d (c:\openedge\wrk) and Press OK Press OK, we have now 40 new Orders in our table (2013 and 2014) Page 29 of 45

Go to OEM and Select Database Administration. From the left bar, choose sportshtp connection and after that choose the link Create partition policy. Fill-in the info below and press Next. Page 30 of 45

Page 31 of 45

Click Add fields from Index and choose Orderdate. Make sure you will select also Has range option in the top and select Orderdata as a local index. Then click Next. Page 32 of 45

Press Load details button and you will see that 1 partition was discovered. OpenEdge will create this partition by default. Page 33 of 45

On this last page, you will see that there is only partition (all the data is in the one partition right now). You cannot add a new partition on this window. You have to press Finish and after that add/edit range partitions. Press Finish now. Select Edit Details for CompanyOrders Now you can add new partitions using Add button. Add the following partitions below; Orders2013 and VeryOldOrders. Page 34 of 45

Make sure you will mark all of the partitions as a Split-target and press Commit button. Then, let s split the data between different partitions. proenv>proutil sportshtp -C partitionmanage split table order composite initial BEGIN: Split Operation For Table customer (17384) Source Partition initial[0] Target Partition Customer_Finland[1] Target Partition Customer_USA[2] Index CountryPost has been identified as the scanning index (selected). A non-unique index has been selected as the useindex index. Additional locking is required with the use of this index CountryPost. Number of Records per Transaction (recs): 100 Do you want to continue (y/n)? y Target partition: Customer_Finland[1], records moved: 28. Target partition: Customer_USA[2], records moved: 1059. Page 35 of 45

Source partition: initial[0], still contains records. Total records processed: 1087. END: Split Operation For Table customer[0] Split Operation finished successfully. (17359) proenv>proutil sportshtp -C partitionmanage split table order composite initial BEGIN: Split Operation For Table order (17384) Source Partition initial[0] Target Partition VeryOldOrders[1] Target Partition Orders2013[2] Index OrderDate has been identified as the scanning index (selected). A non-unique index has been selected as the useindex index. Additional locking is required with the use of this index OrderDate. Number of Records per Transaction (recs): 100 Do you want to continue (y/n)? y Target partition: VeryOldOrders[1], records moved: 3953. Target partition: Orders2013[2], records moved: 20. Source partition: initial[0], still contains records. Total records processed: 3973. END: Split Operation For Table order[0] Split Operation finished successfully. (17359) proenv>proutil sportshtp -C dbanalys > sportshtp_split_3.txt You can see the following results using Notepad++. BONUS LAB If you have time, add also Orders2015 table partition and test that you can also add a new order for that partition (e.g. Orderdate in 2015 will store here)!! How you can do that? Page 36 of 45

Please, take a backup of your sportshtp database in case you are getting stuck (Note: Progress backup will also backup your partition policies): proenv>probkup online sportshtp sportshtp.bck Page 37 of 45

DB tools to manage table partitions Next we are going to merge partitions, for you, it s good to have a backup in case something goes wrong or if you are going to do more testing :-) (Note: You can RESTORE your sportshtp backup and then test it more if needed. PROREST will also restore your existing partitions! To restore your DB, just give the following commands: proshut sportshtp by prodel sportshtp -> y prodb sportshtp sports2000 prostrct add sportshtp sportshtp_areas.st (NOTE, no online!!) prorest sportshtp sportshtp.bck preserve sportshtp S 7878) Backup your DB online proenv>probkup online sportshtp sportshtp.bck 2242 active blocks out of 2793 blocks in sportshtpwill be dumped. (6686) 576 BI blocks will be dumped. (6688) Backup requires an estimated 13.3 MBytes of media. (9285) Restore would require an estimated 3401 db blocks using 13.3 MBytes of media. (9286) Backed up 2498 db blocks in 00:00:00 Wrote a total of 74 backup blocks using 9.8 MBytes of media. (13625) Backup complete. (3740) Indexbuild online for partitions As you know you can run the following index build off-line only. proenv>proutil sportshtp -C idxbuild table customer ** The database sportshtp is in use in multi-user mode. (276) Now you can run index online for different partitions, but before that you need to enable this feature. You can enable this using the following command: proenv>proutil sportshtp -C enabletpidxbld TP Index Rebuild has been enabled for database sportshtp. (12479) Page 38 of 45

After that you can see that also in OpenEdge Explorer/Management but you can only enable it using command line: Let s run index rebuild online for Finland customers: C:\OpenEdge\WRK>proutil sportshtp -C tpidxbuild table customer partition Customer_Finland Do you have enough disk space for index sorting? (y/n) y TMB value is 8, TM value is 8, SG value is 48, packing factor is 100. (16141) Temporary sort file at: C:\OpenEdge\WRK will use the available disk space. (11443) Attempting to obtain an exclusive lock on customer(customer_finland). (16753) If you'd like to cancel this operation, press CTRL-C. (8581)... requested lock has been obtained. TP Index Rebuild operation continuing. Index 14 ( PUB.Customer, CountryPost.Customer_Finland:2 ): de-activated (17368) Area 27: Table scan complete for partition Customer_Finland. Elapsed time: 0.014 (17473) Sorting and index building group 16. Sorting index group 16 complete. Elapsed time: 0.000 (16761) Building index 14 (CountryPost) for Customer_Finland of group 16 in area 37 (16763) Index 14 ( PUB.Customer, CountryPost.Customer_Finland:2 ): activated (17369) Building of indexes in group 16 completed. Elapsed time: 0.002 (16762) Temporary sort file at C:\OpenEdge\WRK used up 0K of disk space. (11480) A total of 0K of temporary sort disk space was used for area 27. (11483) 1 indexes were rebuilt. (11465) Index rebuild complete. 0 error(s) encountered. Elapsed time: 2.094 Merging partitions Basically you can merge two or even three partitions to the one partition. In this case, we want to merge VeryOldOrders to Orders2013 partition. To do that, you can give the following command. The partitions will be removed after the data has been moved! Page 39 of 45

proenv>proutil sportshtp -C partitionmanage merge table order partition VeryOldOrders partition Orders2013 Composite partitions CompanyOrders-1 are ineligible for use with the partition merge operation. (17516) END: Merge Operation For Table order was unsuccessful. proenv>proutil sportshtp -C partitionmanage merge table order partition VeryOldOrders partition Orders2013 BEGIN: Merge Operation For Table order Source Partition VeryOldOrders[1] Target Partition Orders2013[2] Index OrderDate has been identified as the scanning index (selected). A non-unique index has been selected as the useindex index. Additional locking is required with the use of this index OrderDate. Number of Records per Transaction (recs): 100 Do you want to continue (y/n)? y Partition VeryOldOrders[1]: records removed: 3953. Partition VeryOldOrders[1]: has been deleted. Partition Orders2013[2]: Total records merged: 3953. END: Merge Operation For Table order was successful. Take a look at the results from OEM perspective, 1 partition was removed automatically: Page 40 of 45

Enable READ ONLY Partition On the Database Features, Enable the Read Only Partitions Going to the Partition CountryPolicy, notice the new Read only option On some Editor try to run the following code find first customer where country = "Finland". update name. Page 41 of 45

Update the Name. On the Finland Line double click and check Read Only Update Commit in the bottom of the screen Rerun the Sample Code and try to update the name field You will receive the error message Reverse to Read Write Congratulations - you have finished OpenEdge Table Partition workshop labs!! Page 42 of 45

Solution for BONUS exercise Page 43 of 45

C:\OpenEdge\WRK>proutil sportshtp -C partitionmanage split table Order partition Orders2015 Partition Orders2015:5 is not allocated, it cannot be specified as a source partition to be split. ( 17387) C:\OpenEdge\WRK>proutil sportshtp -C partitionmanage split table Order partition Orders2016 Partition Orders2016:4 is not allocated, it cannot be specified as a source partition to be s 17387) Page 44 of 45

C:\OpenEdge\WRK>proutil sportshtp -C partitionmanage split table Order partition Orders2016 BEGIN: Split Operation For Table Order (17384) Source Partition Orders2016[4] Target Partition Orders2015[5] Index OrderDate has been identified as the scanning index (selected). A non-unique index has been selected as the useindex index. Additional locking is required with the use of this index OrderDate. Number of Records per Transaction (recs): 100 Do you want to continue (y/n)? y Target partition: Orders2015[5], records moved: 0. Source partition: Orders2016[4], contains no records. Total records processed: 0. END: Split Operation For Table Order[4] Split Operation finished successfully. (17359) Page 45 of 45