Sunteți pe pagina 1din 14

US008510269B2

(12) United States Patent


Witt
(54) UNINTERRUPTED DATABASE INDEX
REORGANIZATION/MOVEMENT

(10) Patent N0.:


(45) Date of Patent:
5,794,242 A
6,182,079 B1 *

US 8,510,269 B2
Aug. 13, 2013

8/1998 Green et al. .................. .. 707/10


1/2001 LenZie . . . . . . . . . . . . . . . . . . . . . .. 1/1

6,199,069 B1 *
. 6,377,959 B1 *

3/2001 Dettinger et al.


4/2002 Carlson . . . . . . . . . . . . . . . . . . . . . . . . ..

1/1
l/l

(75)
(73)

Inventor:
Assignee:

Russell W1, Plano TX (Us)


CA, Inc., Islandia, NY (US)

2002/0010701 A1
2002/0107876 A1*
2002/0133491 A1*

1/2002 Kosciuszko et al.


8/2002 Tsuchida et a1.
9/2002 Sim et al. . . . . . . .

707/100
707/202
. . . .. 707/10

2004/0098423 A1

5/2004

Chigusa et a1. ............. .. 707/204

(*)

Notice:

Subject to any disclaimer, the term of this patent is extended or adjusted under 35

OTHER PUBLICATIQNS
Noti?cation of Transmittal of the International Search Report for

U.S.C. 154(b) by 1465 days.


(21) App1_ No; 11/134,097
(22)
(65)

application PCT/US2005/017602 (7 pages), Dec. 27, 2005.


Written Opinion of the International Searching Authority for appli cation PCT/US2005/017602 (5 pages), Dec. 27, 2005.
Communication pursuant to 94(3) EPC, Application No. 05 751 7583-1527, Ref. No. HCD/J00049298EP, 4 pages, Dec. 17, 2010.
*

Filed:

May 20, 2005


PIiOI Publication Data

US 2005/0262118 A1

Nov. 24, 2005

cited by examiner

Related US. Application Data


(60) Provisional application No. 60/573,670, ?led on May
21, 2004-

Primary Examiner * Hosain Alam


Assistant Examiner * Van Oberly (74) Attorney, Agent, or Firm * Baker Botts, LLP

(51) (52)
(58)

Int. Cl. G06F 7/00 G06F 17/00 US. Cl.

(2006.01) (2006.01)

(57)

ABSTRACT

USPC ........................................................ .. 707/635

A method for reorganizing a ?rst database includes copying

Field of Classi?cation Search


USPC ........................................................ .. 7 07/635

data from the ?rst database to a second database having an


index structure different from that of the ?rst database, updat

See application ?le for complete search history.


(56) References Cited
U.S. PATENT DOCUMENTS
5,408,654 A * 5,594,900 A * 4/1995 1/1997 Barry .......................... .. 707/752 Cohnet al. .......................... .. 1/1

ing the second database to re?ect changes that have been


made to the ?rst database since the commencement of the

copying, and switching the second database for the ?rst data
base.

29 Claims, 6 Drawing Sheets

V
ORIGINAL DATABASE
Index

V
SECOND DATABASE

Re-Organizcd
Index

Log

Log

US. Patent

Aug. 13, 2013

Sheet 1 of6

US 8,510,269 B2

Fig. 1

ORIGINAL DATABASE

SECOND DATABASE

Index

Re-Organized
Index

\ 12

\ 15

Log

_/
\ 13

Log
\ 16

US. Patent

Aug. 13, 2013

Sheet 2 of6

US 8,510,269 B2

Fig. 2

Desire New Index Structure?

Create Second Database

Lock

\ S22
r r

\ S26

Examine Log

Sync Databases

\ S23
v v

\ S27

Copy
Database

Switch
Databases

\ S24

\ S28

Update
New

Unlock
\
S25 \ s29

Database

US. Patent

Aug. 13, 2013

Sheet 3 0f 6

US 8,510,269 B2

Fig. 3

Create Second Database


S32
V

Lock

S36
7

Examine

Sync
Databases
S33 S37
V

Log

Copy
Database S34
1

Switch Databases S38

Update
New

Unlock

Database
S35

US. Patent

Aug. 13, 2013

Sheet 4 of6

US 8,510,269 B2

F1 g. 4

Desire New Index Structure?

Create Second Database

\ S42
7

Examine

Log
\
S43

Copy
Database

Apply New
Transactions
to both

databases

\ S44

\ s45

Switch Databases

\ S46

US. Patent

Aug. 13, 2013

Sheet 5 of6

US 8,510,269 B2

F 1g . 5

/
Copying
Unit

53

Updating
51 Unit

55

/ 52

54 /
Switching

\ 56
Unit \
57

User

58

US. Patent

Aug. 13, 2013

Sheet 6 of6

US 8,510,269 B2

Flg. 6
1000

/ 1002
NETWORK CONTROLLER TO
PsTN

CPU

1001 /

\1003
LAN DATA LAN
_ , INTERFACE

MEMORY

TRANSMISSION

CONTROLLER

1004/
HARD

\1005
M 7
.

/
1006
LAN
TO

INPUT DEVICES

/
1008 1007

/
\1009

PRINTER INTERFACE

DISPLAY UNIT

1010 /

\ 1011

US 8,510,269 B2
1
UNINTERRUPTED DATABASE INDEX REORGANIZATION/MOVEMENT REFERENCE TO RELATED APPLICATION

2
indexed database, the dynamically indexed database may

require less frequent re-organization.


HoWever, With either form of indexed database, periodic re-organization may be required. Re-organization of database
indexes often requires that the database be made temporary

The present disclosure is based on and claims the bene?t of

unavailable. While re-organization is underWay, I/O activity,


such as for example queries, reads, and updates may be pre
vented. There may be other reasons Why a database may be made temporarily unavailable. For example, it may be desirable to
move a database from one device to another. For example, a database may be moved from one server to another. Moving a

Provisional application Ser. No. 60/ 573,670 ?led May 21,


2004, the entire contents of Which are herein incorporated by reference.
BACKGROUND

1. Technical Field The present disclosure relates to databases and, more spe

database may require that the database be made temporarily


unavailable. Users of modern DBMS are becoming increasingly less
tolerant of DBMS doWntime. There is therefore a need to

ci?cally, to uninterrupted reorganization and movement of


databases. 2. Description of the Related Art A database is an organized collection of data. Most data
bases are computerized and are stored on computer-readable
20

utilize a system and method for re-organizing database tables

Without impeding database I/O activity.


SUMMARY

storage devices, such as hard disks. Computerized databases are frequently built, maintained and called upon to store, organize, and retrieve useful information as needed. A data

base management system (DBMS) is generally a computer


program that is designed to store, organize, and retrieve com
25

A method for reorganizing a ?rst database includes copy ing data from the ?rst database to a second database having an

puterized database information.


Many databases organize information as a collection of

index structure different from that of the ?rst database, updat ing the second database to re?ect changes that have been
made to the ?rst database since the commencement of the

tables. Each table may include one or more entries and each copying, and sWitching the second database for the ?rst data base. entry may have one or more attributes. Each attribute may then be assigned one or more values. Each table may include 30 A method for reorganizing a ?rst database includes prepar ing a second database, identifying a most recent transaction one or more columns; a single column generally stores a

single attribute for each entry. Each table may include of one
or more roWs, a single roW generally stores a single entry With

all of its attributes.

In certain databases, for example relational databases, tWo


or more tables may be related to each other by virtue of sharing common entries and/or common elements. A DBMS for relational databases may utilize various indexes in

35

from a ?rst database log, copying data from the ?rst database to the second database, updating the second database With transactions performed to the ?rst database since the identi ?ed most recent transaction, and sWitching the second data base for the ?rst database.
A method for reorganizing a ?rst database includes prepar ing a second database, identifying a most recent transaction from a ?rst database log, copying data from the ?rst database

responding to queries.
Database entries may be hierarchically arranged such that
some entries are parents of other entries Which are children.
40

Indexing is a technique used by most current DBMSs to

speed up particular kinds of queries. For example, redundant


information may be internally generated and stored in the
database tables to more quickly locate table entries. The most
common kind of index is a sorted list of the contents of some
45

to the second database, updating the ?rst database and the second database With transactions performed to the ?rst data base since the identi?ed most recent transaction, and sWitch ing the second database for the ?rst database.
A method for moving a ?rst database from a ?rst device to a second device includes copying data from the ?rst database
on the ?rst device to a second database on the second device,

particular table column, With pointers to the roW associated With the value. There are multiple different forms of indexed databases.
One such form is a ?xed-indexed database. The ?xed-index
50

updating second database to re?ect changes that have been


made to the ?rst database since the commencement of the

copying, and sWitching the second database for the ?rst data
base. A system for reorganizing a ?rst database includes a copy ing unit for copying data from the ?rst database to a second database having an index structure different from that of the

database includes an index for assisting in quickly responding to queries that has been speci?cally organized for a particular
database. While the ?xed-indexed database may be able to

quickly respond to queries, it may be necessary to re-organize


the ?xed indexes every time the database is modi?ed. For example, it may be necessary to re-organize ?xed indexes as
neW records are added to the database. Re-organizing an
55

?rst database, an updating unit for updating the second data


base to re?ect changes that have been made to the ?rst data base since the commencement of the copying, and a sWitch

ing unit for sWitching the second database for the ?rst
database. A system for reorganizing a ?rst database includes a pre
60

index is the process of updating the index to re?ect a modi?ed database, for example to re?ect the addition of a neW database entry. For example, Where a ?xed-index is the sorted list

paring unit for preparing a second database, an identifying


unit for identifying a most recent transaction from a ?rst

described above, re-organization may be the re-sorting of the


list after a neW entry has been added.

Another form of indexed database is the dynamically indexed database. Dynamically indexed databases may uti lize indexes that may be modi?ed Without having to re-orga nize the index every time the database is modi?ed. While the
dynamically indexed database may not be as fast as the ?xed

database log, a copying unit for copying data from the ?rst database to the second database, an updating unit for updating the second database With transactions performed to the ?rst
65

database since the identi?ed most recent transaction, and a

sWitching unit for sWitching the second database for the ?rst
database.

US 8,510,269 B2
3
A system for moving a ?rst database from a ?rst device to a second device includes a copying unit for copying data from
the ?rst database on the ?rst device to a second database on

4
FIG. 4 is a ?oW chart shoWing a method for re-organizing a database according to another embodiment of the present

disclosure;
FIG. 5 is a block diagram shoWing a system according to an

the second device, an updating unit for updating second data base to re?ect changes that have been made to the ?rst data
base since the commencement of the copying, and a sWitch

ing unit for sWitching the second database for the ?rst
database.
A computer system includes a processor and a program

embodiment of the present disclosure; and FIG. 6 shoWs an example of a computer system capable of implementing the method and apparatus according to embodiments of the present disclosure.
DETAILED DESCRIPTION

storage device readable by the computer system, embodying


a program of instructions executable by the processor to

perform method steps for reorganizing a ?rst database. The


method includes copying data from the ?rst database to a second database having an index structure different from that

In describing the preferred embodiments of the present disclosure illustrated in the draWings, speci?c terminology is employed for sake of clarity. HoWever, the present disclosure
is not intended to be limited to the speci?c terminology so

of the ?rst database, updating the second database to re?ect changes that have been made to the ?rst database since the commencement of the copying, and sWitching the second database for the ?rst database.
A computer system includes a processor and a program
20

selected, and it is to be understood that each speci?c element includes all technical equivalents Which operate in a similar
manner.

storage device readable by the computer system, embodying


a program of instructions executable by the processor to

Embodiments of the present disclosure alloW for the re organization of database indexes and/or the moving of a data base from one device to another Without interrupting database

functionality for extended periods of time.


FIG. 1 is a block diagram shoWing an embodiment of the
25

perform method steps for reorganizing a ?rst database. The method includes preparing a second database, identifying a most recent transaction from a ?rst database log, copying data from the ?rst database to the second database, updating the second database With transactions performed to the ?rst data
base since the identi?ed most recent transaction, and sWitch ing the second database for the ?rst database. A computer system includes a processor and a program

present disclosure. An original database 11 may handle I/O activity such as, for example, query requests and/ or database updates. The original database 11 may be an indexed data
base, for example a ?xed-indexed database or a dynamically indexed database, containing one or more indexes 12. The original database 11 may additionally contain a transaction log 13 (also referred to as an audit log). The transaction log 13
may be part of the index itself or a separate ?le on the same or

30

storage device readable by the computer system, embodying


a program of instructions executable by the processor to

perform method steps for reorganizing a ?rst database. The method includes preparing a second database, identifying a most recent transaction from a ?rst database log, copying data from the ?rst database to the second database, updating the ?rst database and the second database With transactions per
formed to the ?rst database since the identi?ed most recent

different data storage device. The transaction log 13 may be a log that records every modi?cation that is made to the original database 11. The transaction log 13 may therefore be used to
35

back out database modi?cations and/ or re-apply database modi?cations in the event that there is a problem With the integrity of the data stored on the database. Embodiments of the present disclosure utilize a second
database 14 that may be located either on the same data storage device as the original database 11 or on a different

transaction, and sWitching the second database for the ?rst


database.
A computer system includes a processor and a program

40

storage device readable by the computer system, embodying


a program of instructions executable by the processor to perform method steps for moving a ?rst database from a ?rst device to a second device, the method includes copying data from the ?rst database on the ?rst device to a second database on the second device, updating second database to re?ect changes that have been made to the ?rst database since the
45

data storage device. This second database 14 may be set up to store the data from the ?rst database 11. The second database 14 may contain an index 15 that has been re-organized. The second database 14 may be used to handle I/O activity intended for the ?rst database 11 alloWing for access to the

database 11 data Without signi?cant interruption. The second


database 14 may then continue to function as the primary

database handling I/O activity and maintaining a second data base transaction log 16.
50

commencement of the copying, and sWitching the second


database for the ?rst database.
BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 2 is a ?oW chart shoWing a method for re-organizing a database according to an embodiment of the present disclo
sure. It may ?rst be determined Whether a neW index structure

A more complete appreciation of the present disclosure and many of the attendant advantages thereof Will be readily
obtained as the same becomes better understood by reference

55

is desired (Step S21). A neW index stricture may be desired, for example, When a database index requires re-organization. Examining the control statements of the DBMS may help
determine Whether a neW index structure is required. If it is determined that a neW index structure is not required (No,

to the folloWing detailed description When considered in con

Step S21) then the determination may be made again (Step


S21) at a later point.
60

nection With the accompanying draWings, Wherein:


FIG. 1 is a block diagram shoWing an embodiment of the

If it is determined that a neW index structure is required

present disclosure;
FIG. 2 shoWs a is a ?oW chart shoWing a method for re-organizing a database according to an embodiment of the

(Yes, Step S21), then a second database may be prepared, for


example, the second database may be created or an existing

second database may be initialized (Step S22). It may be


65

present disclosure;
FIG. 3 shoWs a is a ?oW chart shoWing a method for copying a database according to an embodiment of the

present disclosure;

bene?cial to check to see that the appropriate requirements for creating the second database are satis?ed before the sec ond database is created. For example, it may be bene?cial to check to see that enough free space remains on the device that

US 8,510,269 B2
5
the second database is to be created on. There should be

6
original database since the copying began may be applied to
the second database (Step S35). Next an exclusive lock may
be placed on the original database to ensure that no further

enough free space to accommodate the existing data in the original database plus the neW index structure. Depending on the ?le-structure of the platform upon Which the second data base is to be located, the check for free space may not be necessary.

changes may be made to the original database (Step S36). The


transaction log may then be reexamined to ensure that the

Next, the transaction log of the original database may be


examined to determine the identity of the last transaction to be

logged to the transaction log (Step S23). Then, the data con
tent of the original database may be copied to the created second database (Step S24). Since the index structure of the neW database might be different from the index structure of the old database, a get command used to read data from the original database and a put command used to Write data to
the second database may each refer to their oWn index struc ture. For example, data taken from a particular address on the original database may not occupy the same address once

second database is properly synchronized With the original database (Step S37). While the database is locked, the second database is sWitched for the original database (Step S38). The exclusive lock may then be removed alloWing l/ 0 activity to be directed to the second database (Step S39).
FIG. 4 is a How chart shoWing a method for re-organiZing a database according to another embodiment of the present

disclosure. Aspects of this embodiment of the present disclo sure closely folloW the embodiment described above and
shoWn in FIG. 2. Details described above may therefore be

used in carrying out corresponding steps in the current embodiment.


It may ?rst be determined Whether a neW index structure is

copied to the second database. After all data has been copied to the second database (Step S24), all transactions that have occurred on the original data base since the copying began may be applied to the second database (Step S25). These transactions may be determined

desired (Step S41). If it is determined that a neW index struc


20

ture is not required (No, Step S41) then the determination may be made again (Step S41) at a later point. If it is deter
mined that a neW index structure is required (Yes, Step S41), then a second database may be created (Step S42). The trans action log of the original database may be examined to deter mine the identity of the last transaction to be logged to the

by examining the transaction log of the original database and


applying all transactions that occurred after the last transac tion as identi?ed in Step S23. Care may be given to ensure that the transactions are applied to the second database in a Way that accounts for the neW index structure of the second data base. Next an exclusive lock may be placed on the original data base to ensure that no further changes may be made to the
25

transaction log (Step S43). Then the data content of the origi
nal database may be copied to the created second database

(Step S44) While subsequent database transactions are


applied to both the original database as Well as the second
30

original database (Step S26). The transaction log may then be


reexamined to ensure that the second database is properly

database (Step S45). These steps (S44 and S45) may be car ried out simultaneously, for example, using parallel pro
cesses. There may be multiple Ways to apply the transactions to each database simultaneously. For example, if the transac tion relates to data that has already been copied, the transac tion may be successfully applied to each database While if the transaction relates to data that has yet to be copied, the trans action may be successfully applied to the original database Where it Will be later copied to the second database. After all data has been copied to the second database (Step S44), the second database may be sWitched for the original database

synchronized With the original database (Step S27). This may


entail applying updates to the second database that Were made on the original database While second database Was updated in Step S25. This step is likely to be very short and therefore the length of time the database is locked for is minimized. While the database is locked, the second database may be
35

sWitched for the original database (Step S28). This may entail updating the l/ 0 control blocks of the applications that utiliZe the database, for example the DBMS, so that they point to the second database rather than the original database. The exclu sive lock may then be removed alloWing 110 activity to be directed to the second database (Step S29). After the above method has been completed, the original database may be disabled to prevent applications from accessing the original database. This Will help to ensure that

40

(Step S46).
FIG. 5 is a block diagram shoWing a system according to an embodiment of the present disclosure. A copying unit 53 may
copy data from a ?rst database 51 on a ?rst device 52 to a
45

all applications using the database have successfully been


sWitched to the second database. This process may be repeated every time a neW index structure is desired. For example, the resources of the original database may be used as a subsequent database When it is determined that the index structure of the second database is to be reneWed. FIG. 3 is a How chart shoWing a method for copying a database according to an embodiment of the present disclo sure. Aspects of this embodiment of the present disclosure
50

second database 55 on a second device 56. The second data base 55 may have a different index structure than the ?rst database 51 . An updating unit 54 may then update the second database 55 to re?ect changes that may have been made to the

?st database 51 since the commencement of the copying. A sWitching unit 57 may then sWitch the second database 55 for the ?rst database 51. FIG. 6 shoWs an example of a computer system Which may

55

closely folloW the embodiment described above and shoWn in FIG. 2. Details described above may therefore be used in

implement the method and system of the present disclosure. The system and method of the present disclosure may be implemented in the form of a softWare application running on a computer system, for example, a mainframe, personal com puter (PC), handheld computer, server, etc. The softWare application may be stored on a recording media locally acces sible by the computer system and accessible via a hard Wired
or Wireless connection to a netWork, for example, a local area

carrying out corresponding steps in the current embodiment. First, a second database may be created (Step S32). Next, the transaction log of the original database may be examined to determine the identity of the last transaction to be logged to the transaction log (Step S33). Then the data content of the original database may be copied to the created second data base (Step S34). After all data has been copied to the second database (Step S34), all transactions that have occurred on the

60

netWork, or the lntemet.

The computer system referred to generally as system 1000

may include, for example, a central processing unit (CPU)


65

1001, random access memory (RAM) 1004, a printer inter face 1010, a display unit 1011, a local area netWork (LAN) data transmission controller 1005, a LAN interface 1006, a
netWork controller 1003, an internal bus 1002, and one or

US 8,510,269 B2
7
more input devices 1009, for example, a keyboard, mouse etc. As shown, the system 1000 may be connected to a data storage device, for example, a hard disk, 1008 via a link 1007. The above speci?c embodiments are illustrative, and many
variations can be introduced on these embodiments Without

8
using one or more computer systems to determine, based
on one or more control statements, that a neW index

structure of the ?rst database is required, the one or more


control statements comprising one or more DBMS con

trol statements that identify that the ?rst database has


been modi?ed and that an index structure of the ?rst

departing from the spirit of the disclosure or from the scope of

the appended claims. For example, elements and/or features


of different illustrative embodiments may be combined With each other and/ or substituted for each other Within the scope

database requires reorganization to re?ect the modi?ca tion to the ?rst database;
in response to determining that the neW index structure of the ?rst database is required, using the one or more computer systems to prepare a second database having a second index structure, the second index structure dif ferent from the ?rst index structure such that the index structure of the second database is updated to include the

of this disclosure and appended claims.


What is claimed is: 1. A method for reorganizing a ?rst database, comprising: using one or more computer systems to determine, based
on one or more control statements, that a neW index

structure of a ?rst database is required, the one or more


control statements comprising one or more DBMS con

modi?cation to the ?rst database;


identifying a most recent transaction from a ?rst database

trol statements that identify that the ?rst database has


been modi?ed and that an index structure of the ?rst

log, the ?rst database log recording a plurality of modi


?cations made to the ?rst database;
20

database requires reorganization to re?ect the modi?ca tion to the ?rst database;
in response to determining that the neW index structure of the ?rst database is required, using the one or more computer systems to create a second database; using the one or more computer systems to copy data from the ?rst database to the second database, the second database having an index structure that is different from the index structure of the ?rst database such that the index structure of the second database is updated to

using the one or more computer systems to copy data from

25

the ?rst database to the second database; using the one or more computer systems to update the second database With transactions performed to the ?rst database since the identi?ed most recent transaction; and

include the modi?cation to the ?rst database; using the one or more computer systems to update the second database to re?ect a modi?cation made to the ?rst database since the commencement of the copying; and

sWitching the second database for the ?rst database. 8. The method of claim 7, further comprising: locking the ?rst database after updating the second data base With transactions performed to the ?rst database
30

since the identi?ed most recent transaction; and

synchronizing the second database With the ?rst database. 9. A method for reorganizing a ?rst database, comprising: maintaining a ?rst database having a ?rst index structure;
35

sWitching the second database for the ?rst database. 2. The method of claim 1, Wherein prior to copying the data
from the ?rst database to the second database, a most recent transaction made to the ?rst database is identi?ed and When

using one or more computer systems to determine, based


on one or more control statements, that a neW index

structure of the ?rst database is required, the one or more


control statements comprising one or more DBMS con

updating the second database to re?ect changes that have


been made to the ?rst database since the commencement of the copying, those transactions that Were made to the ?rst
database since the identi?ed most recent transaction are
40

trol statements that identify that the ?rst database has


been modi?ed and that an index structure of the ?rst

database requires reorganization to re?ect the modi?ca tion to the ?rst database;
in response to determining that the neW index structure of the ?rst database is required, using the one or more computer systems to create a second database having a second index structure, the second index structure dif ferent from the ?rst index structure such that the index structure of the second database is updated to include the

applied to the second database.

3. The method of claim 1, additionally comprising: locking the ?rst database from further transactions, and applying any transactions that have been applied to the ?rst
database but not the second database to the second data

base, after updating the second database to re?ect changes that have been made to the ?rst database since the commencement of the copying and before sWitching the second database for the ?rst database, and unlocking the ?rst database after sWitching the second database for the ?rst database. 4. The method of claim 1, Wherein the index structure of the
second database is a reorganization of the index structure of the ?rst database. 5. The method of claim 1, Wherein copying the data com prises using a get command referring to an index structure of the ?rst database to read data from the ?rst database and using a put command referring to the index structure of the second database to Write data to the second database.

modi?cation to the ?rst database;


50

using the one or more computer systems to identify a most

recent transaction from a ?rst database log, the ?rst

database log recording a plurality of modi?cations made


to the ?rst database;
using the one or more computer systems to copy data from
55

the ?rst database to the second database; using the one or more computer systems to update the ?rst database and the second database With transactions per formed to the ?rst database since the identi?ed most

60

recent transaction; and sWitching the second database for the ?rst database.
10. A method for moving a ?rst database from a ?rst device to a second device, comprising: using one or more computer systems to determine, based
on one or more control statements, that a neW index

6. The method of claim 1, Wherein sWitching the second database for the ?rst database comprises updating a control
block of an application that accesses the ?rst database to point to the second data base rather than the ?rst database.
65

structure of a ?rst database is required, the one or more


control statements comprising one or more DBMS con

7. A method for reorganizing a ?rst database, comprising: maintaining a ?rst database having a ?rst index structure;

trol statements that identify that the ?rst database has

US 8,510,269 B2
9
been modi?ed and that an index structure of the ?rst

10
determining, based on one or more control state

database requires reorganization to re?ect the modi?ca tion to the ?rst database;
in response to determining that the neW index structure of the ?rst database is required, using the one or more computer systems to create a second database; using the one or more computer systems to copy data from the ?rst database on the ?rst device to the second data base on the second device; using the one or more computer systems to update the second database to re?ect a modi?cation made to the

ments, that a neW index structure of the ?rst data base is required, the one or more control statements
comprising one or more DBMS control statements

that identify that the ?rst database has been modi


?ed and that an index structure of the ?rst database

requires reorganization to re?ect the modi?cation


to the ?rst database; and
in response to determining that the neW index struc

?rst database; and sWitching the second database for the ?rst database. 11. A system for reorganizing a ?rst database, comprising: a transaction log recording a plurality of modi?cations made to the ?rst database; and at least one computer system operable to reorganize the

ture of the ?rst database is required, creating a second database having a second index structure, the second index structure different from the ?rst index structure such that the index structure of the second database is updated to include the modi? cation to the ?rst database;
an identifying unit for identifying a most recent transac

?rst database, the computer system comprising:


a preparing unit for:
determining, based on one or more control state
20

tion from a ?rst database log, the ?rst database log recording a plurality of modi?cations made to the ?rst

database;
a copying unit for: copying data from the ?rst database to the second

ments, that a neW index structure of the ?rst data base is required, the one or more control statements comprising one or more DBMS control statements

database;
25

that identify that the ?rst database has been modi


?ed and that an index structure of the ?rst database

requires reorganization to re?ect the modi?cation


to the ?rst database; creating a second database in response to determining
that the neW index structure of the ?rst database is

required;
a copying unit for:

30

an updating unit for updating the second database With transactions performed to the ?rst database since the identi?ed most recent transaction; and a sWitching unit for sWitching the second database for the ?rst database. 16. The system of claim 15, further comprising: a locking unit for locking the ?rst database after updating the second database With transactions performed to the
?rst database since the identi?ed most recent transac

copying data from the ?rst database to the second


database having an index structure different from

tion; and
a synchronizing unit for synchronizing the second database With the ?rst database. 17. A system for reorganizing a ?rst database, comprising:
a ?rst database having a ?rst index structure;

that of the ?rst database; an updating unit for updating the second database to
re?ect a modi?cation made to the ?rst database since

the commencement of the copying; and a sWitching unit for sWitching the second database for the ?rst database. 12. The system of claim 11, Wherein prior to copying the
data from the ?rst database to the second database, a most recent transaction made to the ?rst database is identi?ed and

at least one computer system operable to reorganize the

?rst database, the computer system comprising:


a preparing unit for:
determining, based on one or more control state

ments, that a neW index structure of the ?rst data base is required, the one or more control statements
comprising one or more DBMS control statements

When updating the second database to re?ect changes that


have been made to the ?rst database since the commencement of the copying, those transactions that Were made to the ?rst
database since the identi?ed most recent transaction are

that identify that the ?rst database has been modi


?ed and that an index structure of the ?rst database

requires reorganization to re?ect the modi?cation


to the ?rst database; and
in response to determining that the neW index struc
50

applied to the second database.

13. The system of claim 11, additionally comprising:


a locking unit for locking the ?rst database from further

transactions, and
an applying unit for applying any transactions that have been applied to the ?rst database but not the second database to the second database, after updating the sec ond database to re?ect changes that have been made to the ?rst database since the commencement of the copy ing and before sWitching the second database for the ?rst

ture of the ?rst database is required, creating a second database having a second index structure, the second index structure different from the ?rst index structure such that the index structure of the second database is updated to include the modi? cation to the ?rst database;
an identifying unit for identifying a most recent transac

database, and
an unlocking unit for unlocking the ?rst database after sWitching the second database for the ?rst database. 14. The system of claim 11, Wherein the index structure of the second database is a reorganization of the index structure of the ?rst database. 15. A system for reorganizing a ?rst database, comprising:
a ?rst database having a ?rst index structure;

tion from a ?rst database log, the ?rst database log recording a plurality of modi?cations made to the ?rst

database;
a copying unit for: copying data from the ?rst database to the second

database;
an updating unit for updating the ?rst database and the second database With transactions performed to the
?rst database since the identi?ed most recent transac

at least one computer system operable to reorganize the

tion; and
a sWitching unit for sWitching the second database for the ?rst database.

?rst database, the computer system comprising:


a preparing unit for:

US 8,5 10,269 B2
11
18. A system for moving a ?rst database from a ?rst device to a second device, comprising: a ?rst database having a ?rst index structure;

12
second database, after updating the second database to re?ect changes that have been made to the ?rst database since the commencement of the copying and before sWitching the second database for the ?rst database, and code for unlocking the ?rst database after sWitching the second database for the ?rst database. 22. The computer system of claim 19, Wherein the index

at least one computer system operable to reorganize the

?rst database, the computer system comprising:


a preparing unit for:
determining, based on one or more control state

ments, that a neW index structure of the ?rst data structure of the second database is a reorganization of the base is required, the one or more control statements index structure of the ?rst database. comprising one or more DBMS control statements 10

that identify that the ?rst database has been modi


?ed and that an index structure of the ?rst database

23. A computer system comprising:

a processor; and

requires reorganization to re?ect the modi?cation


to the ?rst database; creating a second database in response to determining
that the neW index structure of the ?rst database is required, the neW index structure of the second database being different from a ?rst index structure of the ?rst database such that the index structure of

a program storage device readable by the computer system,

including computer executable code executable by the


processor for reorganizing a ?rst database, the computer

executable code comprising:


code for maintaining a ?rst database having a ?rst index

structure;
code for determining, based on one or more control state
20

the second database is updated to include the modi ?cation to the ?rst database; a copying unit for: copying data from the ?rst database on the ?rst device to the second database on the second device; an updating unit for: updating the second database to re?ect a modi?cation
made to the ?rst database that Was added since the

ments, that a neW index structure of the ?rst database is required, the one or more control statements comprising one or more DBMS control statements that identify that the ?rst database has been modi?ed and that an index

25

structure of the ?rst database requires reorganization to re?ect the modi?cation to the ?rst database; code for creating a second database having a second index
structure in response to determining that the neW index

commencement of the copying; and a sWitching unit for sWitching the second database for the ?rst database.

structure of the ?rst database is required, the second


30

19. A computer system comprising:


a processor; and

index structure different from the ?rst index structure such that the index structure of the second database is

updated to include the modi?cation to the ?rst database;


code for identifying a most recent transaction from a ?rst

a program storage device readable by the computer system,

including computer executable code executable by the


processor for reorganizing a ?rst database, the computer
35

database log, the ?rst database log recording a plurality


of modi?cations made to the ?rst database; code for copying data from the ?rst database to the second

executable code comprising:


code for determining, based on one or more control state

database;
40

ments, that the ?rst database has been modi?ed and that
a neW index structure of the ?rst database is required to

re?ect the modi?cation to the ?rst database; code for creating a second database in response to deter mining that the neW index structure of the ?rst database

is required;
code for copying data from the ?rst database to the second database having an index structure different from that of the ?rst database such that the index structure of the second database is updated to include the modi?cation to the ?rst database; code for updating the second database to re?ect a modi?
cation made to the ?rst database that Was added since the
45

code for updating the second database With transactions performed to the ?rst database since the identi?ed most recent transaction; and code for sWitching the second database for the ?rst data base. 24. The computer system of claim 23, further comprising: code for locking the ?rst database after updating the second database With transactions performed to the ?rst data base since the identi?ed most recent transaction; and code for synchronizing the second database With the ?rst database.

25. A computer system comprising:


50

a processor; and

commencement of the copying; and code for sWitching the second database for the ?rst data base. 20. The computer system of claim 19, Wherein prior to copying the data from the ?rst database to the second data
base, a most recent transaction made to the ?rst database is

a program storage device readable by the computer system,

including computer executable code executable by the


processor for reorganizing a ?rst database, the computer

executable code comprising:


55

code for maintaining a ?rst database having a ?rst index

structure;
code for determining, based on one or more control state

identi?ed and When updating the second database to re?ect changes that have been made to the ?rst database since the commencement of the copying, those transactions that Were
made to the ?rst database since the identi?ed most recent transaction are applied to the second database.
60

ments, that a neW index structure of the ?rst database is required, the one or more control statements comprising one or more DBMS control statements that identify that the ?rst database has been modi?ed and that an index

21. The computer system of claim 19, additionally com

prising:
code for locking the ?rst database from further transac

structure of the ?rst database requires reorganization to re?ect the modi?cation to the ?rst database; code for preparing a second database having a second
index structure in response to determining that the neW index structure of the ?rst database is required, the sec ond index structure different from the ?rst index struc

tions, and code for applying any transactions that have been applied
to the ?rst database but not the second database to the

US 8,510,269 B2
13
ture such that the index structure of the second database is updated to include the modi?cation to the ?rst data

14
using the one or more computer systems to update the second database to re?ect a modi?cation made to the ?rst database since the commencement of the copying; and

base;
code for identifying a most recent transaction from a ?rst

database log, the ?rst database log recording a plurality


of modi?cations made to the ?rst database; code for copying data from the ?rst database to the second

sWitching the second database for the ?rst database, Wherein copying the data comprises using a get command
referring to an index structure of the ?rst database to read

database;
code for updating the ?rst database and the second data base With transactions performed to the ?rst database since the identi?ed most recent transaction; and code for sWitching the second database for the ?rst data base.

data from the ?rst database and using a put command referring to the index structure of the second database to Write data to the second database, and Wherein an address of the data Within the index structure of the ?rst database is different from an address of the data Within the index structure of the second database.

28. A method for reorganizing a ?rst database, comprising:


using one or more computer systems to identify that a neW

26. A computer system comprising:


a processor; and

entry has been added to a ?rst database having a ?rst

a program storage device readable by the computer system,

including computer executable code executable by the


processor for moving a ?rst database from a ?rst device to a second device, the computer executable code com
20

index structure; determining that reorganization of the ?rst database is


required as a result of the neW entry in the ?rst database;
using the one or more computer systems to create a second database as a result of determining that the neW index

prising:
code for determining, based on one or more control state

structure is required for the ?rst database;


generating a second index structure for the second data base, Wherein the second index structure of the second database is a reorganization of the ?rst index structure of the ?rst database and includes the neW entry to the ?rst

ments, that a neW index structure of the ?rst database is required, the one or more control statements comprising one or more DBMS control statements that identify that the ?rst database has been modi?ed and that an index

25

database;
using the one or more computer systems to copy data from the ?rst database to the second database as a result of
30

structure of the ?rst database requires reorganization to re?ect the modi?cation to the ?rst database; code for creating a second database in response to deter mining that the neW index structure of the ?rst database

is required;
code for copying data from the ?rst database on the ?rst device to the second database on the second device; code for updating second database to re?ect a modi?cation
made to the ?rst database that Was added since the com

determining that the neW index structure is required for the ?rst database, Wherein a copy command refers to the ?rst index structure to read the data from the ?rst data base and to the second index structure to Write the data to

the second database; sWitching the second database for the ?rst database. 29. The method of claim 28, further comprising:
35

identifying that a neW entry has been added to the second

mencement of the copying; and code for sWitching the second database for the ?rst data base. 27. A method for reorganizing a ?rst database, comprising:
using one or more computer systems to determine, based
on one or more control statements, that a neW index

database;
determining that reorganization of the second index struc
ture of the second database is required as a result of the

neW entry in the second database;


40

creating a third database as a result of determining that reorganization of the second index structure of the sec

structure of a ?rst database is required, the one or more


control statements comprising one or more DBMS con

ond database is required;


45

trol statements that identify that the ?rst database has


been modi?ed and that an index structure of the ?rst

generating a third index structure for the third database, Wherein the third index structure of the third database is a reorganization of the second index structure of the
second database and includes the neW entry to the sec

database requires reorganization to re?ect the modi?ca tion to the ?rst database;
in response to determining that the neW index structure of the ?rst database is required, using the one or more computer systems to create a second database; using the one or more computer systems to copy data from the ?rst database to the second database, the second database having an index structure that is different from the index structure of the ?rst database such that the index structure of the second database is updated to
50

ond database copying data from the second database to the third database as a result of determining that reorganization of the second index structure of the second database is required, Wherein a copy command refers to the second index structure to read the data from the second database
and to the third index structure to Write the data to the

55

third database; and sWitching the third database for the second database.
* * * * *

include the modi?cation to the ?rst database;

S-ar putea să vă placă și