CN103279582A - Oracle partition based data storing method and device - Google Patents

Oracle partition based data storing method and device Download PDF

Info

Publication number
CN103279582A
CN103279582A CN2013102560592A CN201310256059A CN103279582A CN 103279582 A CN103279582 A CN 103279582A CN 2013102560592 A CN2013102560592 A CN 2013102560592A CN 201310256059 A CN201310256059 A CN 201310256059A CN 103279582 A CN103279582 A CN 103279582A
Authority
CN
China
Prior art keywords
data
table space
data file
tables
subregion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2013102560592A
Other languages
Chinese (zh)
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
GUANGDONG YUTIAN TECHNOLOGY Co Ltd
ZHEJIANG YUTIAN TECHNOLOGY Co Ltd
Original Assignee
GUANGDONG YUTIAN TECHNOLOGY Co Ltd
ZHEJIANG YUTIAN TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by GUANGDONG YUTIAN TECHNOLOGY Co Ltd, ZHEJIANG YUTIAN TECHNOLOGY Co Ltd filed Critical GUANGDONG YUTIAN TECHNOLOGY Co Ltd
Priority to CN2013102560592A priority Critical patent/CN103279582A/en
Publication of CN103279582A publication Critical patent/CN103279582A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention provides an Oracle partition based data storing method and device. The data storing method includes establishing M table spaces for a data table, wherein M is an integer larger than or equal to 2; evenly distributing N data files to the M table spaces, wherein N is an integer larger than or equal to M; partitioning the data table; and storing data in each partition to the data files of the M table spaces through a mode of circularly using the M table spaces. According to the Oracle partition based data storing method and device, the partition data of the data table are stored by circularly using the M table spaces, and such data storage mode can effectively disperse data hot spots, and guarantee even distribution of the data of the data table into a plurality of the data files, so that data query speeds are accelerated, and resource consumption of data bases is reduced.

Description

A kind of date storage method and device based on the Oracle subregion
Technical field
The invention belongs to the database storage techniques field, relate in particular to a kind of date storage method based on the Oracle subregion and device.
Background technology
The Oracle subregion is a kind of technology of handling the ultra-large type table.Subregion is the technology of a kind of " dividing and rule ", by will showing to be divided into the fritter that can manage with index greatly, thereby has avoided each table is managed as big, an independent object, for mass data provides telescopic performance.
Subregion has reduced the time that manages operation by operation being distributed to littler storage unit; Parallel processing by strengthening has improved performance; Subregion by the shielding fault data has increased availability.Oracle provides three kinds of basic partition methods: scope subregion, tabulation subregion and Hash subregion, adopt above-mentioned partition method, tables of data can be divided into single table or combination partition table, the user can adjust data subdividing in the best way according to actual business requirement.
Database storage means of the prior art is: for tables of data is set up a table space, for table space distributes the data file of some, tables of data is carried out subregion, the data of subregion are stored in the data file of table space.The inventor finds in the process that realizes the invention: because partition data can only write in the data file of a table space, therefore, the data that occur often being read probably are written to the situation in the same data file, when the big concurrent data I focus that is easy to produce when reading these data of user, when the data block that has the data I focus is inquired about, SQL statement is carried out consuming time very long, it is very fast to cause the database linking number to increase, because each linking number expends certain resource, the continuous increase of linking number finally causes database response slowly even dies.
Summary of the invention
In view of this, the invention provides a kind of date storage method based on the Oracle subregion and device, be easy to generate the data I focus in order to solve database storage means of the prior art, when causing the data block that has the data I focus inquired about, SQL statement is carried out consuming time very long, it is very fast further to cause the database linking number to increase, and finally causes database response slowly even the problem of dying, and its technical scheme is as follows:
On the one hand, a kind of date storage method based on the Oracle subregion comprises:
Create M table space for tables of data, wherein, M is the integer more than or equal to 2;
The equilibrium of N data file is assigned in the described M table space, and wherein, N is the integer more than or equal to M;
Described tables of data is carried out subregion;
The data of i subregion of described tables of data are stored in the data file of i-k*M table space, wherein, i=1,2 ..., P, P are the subregion number of tables of data, and P is the integer greater than M,
Figure BDA00003398111600021
Expression rounds up.
Wherein, described N data file big or small identical describedly is assigned to M the process in the table space with the equilibrium of N data file and comprises:
When N can be divided exactly by M, for each table space distributes N/M data file;
When N can not be divided exactly by M, for each table space in M-R the table space distributes
Figure BDA00003398111600022
Individual data file is for each table space in all the other table spaces distributes
Figure BDA00003398111600023
Individual data file, wherein, R is the remainder that N obtains divided by M, Expression rounds downwards.
Optionally, said method also comprises:
Data in described tables of data increase, and during the data that N the data file that distributes for described M table space is not enough to increase in the data table memory, create at least one table space, and be described table space distribute data file according to the data volume that increases, so that the data that increase newly in the tables of data store in the data file of table space of this new establishment.
Optionally, said method also comprises:
Data in described tables of data increase, and during the data that N the data file that distributes for described M table space is not enough to increase in the data table memory, the data volume that foundation increases is at least one the table space distribute data file in the described M table space, so that the data that increase newly in the tables of data store in this data file.
Optionally, said method also comprises:
Detect the read-write number of times of described N data file;
The read-write number of times is moved in other table space in the data file of read-write number of times less than second preset value greater than the data in the data file of first preset value, and wherein, described first preset value is greater than described second preset value.
On the other hand, a kind of data storage device based on the Oracle subregion comprises:
First creating unit is used to tables of data to create M table space, and wherein, M is the integer more than or equal to 2;
First allocation units are used for the equilibrium of N data file is assigned to M table space, and wherein, N is the integer more than or equal to M;
The tables of data zoning unit is used for described tables of data is carried out subregion;
Data storage cell is used for the data of i subregion of described tables of data are stored to the data file of i-k*M table space, wherein, i=1,2 ..., P, P are the subregion number of tables of data, and P is the integer greater than M,
Figure BDA00003398111600031
Expression rounds up.
Wherein, described N data file big or small identical, described first allocation units comprise:
Distribute subelement, be used for when N can be divided exactly by M, for each table space distributes N/M data file, when N can not be divided exactly by M, for each table space in M-R the table space distributes
Figure BDA00003398111600032
Individual data file is for each table space in all the other table spaces distributes
Figure BDA00003398111600033
Individual data file, wherein, R is the remainder that N obtains divided by M,
Figure BDA00003398111600034
Expression rounds downwards.
Optionally, described device also comprises:
Second creating unit is used for increasing when the data of described tables of data, and during the data that are not enough to increase in the data table memory for N data file of described M table space distribution, creates at least one table space;
Second allocation units, being used for according to the data volume that increases is the table space distribute data file that described second creating unit is created, so that the data that increase in the tables of data store in the data file of described second allocation units distribution.
Described device also comprises:
The 3rd allocation units, be used for increasing when the data of described tables of data, and during the data that N the data file that distributes for described M table space is not enough to increase in the data table memory, the data volume that foundation increases is at least one the table space distribute data file in the described M table space, so that the data that increase in the tables of data store in the data file of described the 3rd allocation units distribution.
Described device also comprises:
Detecting unit is for detection of the read-write number of times of described N data file;
Data migration unit is used for read and write number of times and moves in other table space greater than the data of the data file of first preset value and read and write in the data file of number of times less than second preset value, and wherein, described first preset value is greater than described second preset value.
Technique scheme has following beneficial effect:
Date storage method and device based on the Oracle subregion that the embodiment of the invention provides, for tables of data is created M table space, the equilibrium of N data file is assigned in M the table space, tables of data is carried out subregion, by recycling the mode of M table space, the data of each subregion are stored in the data file of M table space, the data that are about to the 1st subregion of tables of data are stored in the data file of the 1st table space, the data of the 2nd subregion are stored in the data file of the 2nd table space, by that analogy, the data of M subregion are stored to M table space, then M+1 subregion is stored in the data file of the 1st table space, the M+2 subregion is stored in the data file of the 2nd table space, the data until all subregions of tables of data are stored in the data file of M table space by that analogy.Date storage method and device based on the Oracle subregion provided by the invention, recycling M table space data table memory partition data, this data storage method is the separate data focus effectively, guarantee that the data balancing of tables of data is in a plurality of data files, thereby accelerated data query speed, reduced the resource consumption of database.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below, apparently, accompanying drawing in describing below is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the schematic flow sheet based on the date storage method of Oracle subregion that the embodiment of the invention one provides;
Fig. 2 is the schematic flow sheet based on the date storage method of Oracle subregion that the embodiment of the invention two provides;
Fig. 3 is the schematic flow sheet based on the date storage method of Oracle subregion that the embodiment of the invention three provides;
The data storage synoptic diagram that Fig. 4 provides for the embodiment of the invention three;
Fig. 5 is the structural representation based on the data storage device of Oracle subregion that the embodiment of the invention four provides;
Fig. 6 is the structural representation based on the data storage device of Oracle subregion that the embodiment of the invention five provides;
Fig. 7 is the structural representation based on the data storage device of Oracle subregion that the embodiment of the invention six provides.
Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
Embodiment one
See also Fig. 1, be a kind of date storage method based on the Oracle subregion that the embodiment of the invention one provides, this method can comprise:
Step S101: create M table space for tables of data, wherein, M is the integer more than or equal to 2.
Step S102: the equilibrium of N data file is assigned in M the table space, and wherein, N is the integer more than or equal to M.
The number N of data file determines according to the size of the required storage space of the data volume of data table stores and each data file.For example, the data volume of data table stores needs the size of 600G storage space, each data file to be 10G, then is required to be table space and distributes 60 data files that size is 10G.
Step S103: tables of data is carried out subregion.
Step S104: the data of i subregion of tables of data are stored in the data file of i-k*M table space, wherein, and i=1,2 ..., P, P are the subregion number of tables of data, and P is the integer greater than M, Expression rounds up, and namely by recycling the mode of M table space, the data of each subregion is stored in the data file of M table space.
Particularly, the data of the 1st subregion of tables of data are stored in the data file of the 1st table space, the data of the 2nd subregion are stored in the data file of the 2nd table space, by that analogy, the data of M subregion are stored to M table space, then M+1 subregion is stored in the data file of the 1st table space, the M+2 subregion is stored in the data file of the 2nd table space, the data until all subregions of tables of data are stored in the data file of M table space by that analogy.
The date storage method based on the Oracle subregion that the embodiment of the invention one provides, recycling M table space data table memory partition data, this data storage method is the separate data focus effectively, guarantee that the data balancing of tables of data is in a plurality of data files, thereby accelerated data query speed, reduced the resource consumption of database.
Embodiment two
See also Fig. 2, be a kind of date storage method based on the Oracle subregion that the embodiment of the invention two provides, this method can comprise:
Step S201: create M table space for tables of data, wherein, M is the integer more than or equal to 2.
Step S202: the equilibrium of N data file is assigned in M the table space, and wherein, N is the integer more than or equal to M.
Wherein, data file can be the good data file of EMC preformatting, and the size of data file can be 2G, 5G or 10G.The number N of data file determines according to the size of the required storage space of the data volume of data table stores and each data file in the present embodiment, for example, the data volume of data table stores needs the size of 600G storage space, each data file to be 10G, then is required to be table space and distributes 60 data files that size is 10G.
In the present embodiment, N data file is big or small identical.The equilibrium of N data file is assigned to M table space can be comprised: when N can be divided exactly by M, for each table space distributes N/M data file; When N can not be divided exactly by M, for each table space in M-R the table space distributes Individual data file is for each table space in all the other table spaces distributes
Figure BDA00003398111600072
Individual data file, wherein, R is the remainder that N obtains divided by M,
Figure BDA00003398111600073
Expression rounds downwards.
Suppose that table space is 5, data file is 10, so, can be each table space and distributes two data files.Suppose that table space is 5, data file is 12, so, can be wherein that three table spaces distribute two data files respectively, for two other table space distributes three table spaces respectively.
In the present embodiment, the data file in each table space is unsuitable too many, guarantees the multilist space as far as possible, if data file is too many, its data quantity stored will be very big, just the data hot issue may occur.
Step S203: tables of data is carried out subregion.
Can from scope subregion, tabulation subregion and Hash subregion, select suitable partitioned mode that tables of data is carried out subregion according to actual conditions.
Step S204: the data of i subregion of tables of data are stored in the data file of i-k*M table space, wherein, and i=1,2 ..., P, P are the subregion number of tables of data, and P is the integer greater than M,
Figure BDA00003398111600074
Expression rounds up, and namely by recycling the mode of M table space, the data of each subregion is stored in the data file of M table space.
On the basis of the invention described above embodiment, now enumerate an instantiation and describe.
Suppose in oracle, to create 5 table spaces for tables of data, be respectively M 1, M 2, M 3, M 4And M 5, be that 5 table spaces distribute 12 data files, be respectively F 1, F 2, F 3, F 4, F 5, F 6, F 7, F 8, F 9, F 10, F 11And F 12, particularly, can be M1 and distribute 3 data file F 1, F 2And F 3, be M 2Distribute three data file F 4, F 5And F 6, be M 3Distribute two data file F 7And F 8, for M4 distributes two data file F 9And F 10, be M 5Distribute two data file F 11And F 12
Be example with the scope subregion: to be days time that dimension is carried out subregion, subregion is respectively P to tables of data 2012 January in year, P In February, 2012, P In March, 2012, P In April, 2012, P In May, 2012, P In June, 2012, P In July, 2012, P 2012 8 Month, P In September, 2012, P In October, 2012, P In November, 2012And P In Dec, 2012The data capacity of supposing each subregion is 2G, and each data file is 2G.
With subregion P In January, 2012Data store table space M into 1In data file F 1In, with subregion P 2012 February in yearData store table space M into 2In data file F 4In, with subregion P In March, 2012Data store table space M into 3In data file F 7In, with subregion P In April, 2012Data store table space M into 4In data file F 9In, with subregion P In May, 2012Data store table space M into 5In data file F 11In, remaining subregion reuses table space M 1, M 2, M 3, M 4And M 5, be about to subregion P 2012 June in yearData store table space M into 1In data file F 2In, with subregion P In July, 2012Data store table space M into 2In data file F 5In, with subregion P In August, 2012Data store table space M into 3In data file F 8In, with subregion P In September, 2012Data store table space M into 4In data file F 10In, P In October, 2012Data store table space M into 5In data file F 12In, with subregion P In November, 2012Data store table space M into 1In data file F 3In, with subregion P In Dec, 2012Data store table space M into 2In data file F 6In.
Optionally, said method can also comprise:
Step S205: the data in tables of data increase, and during the data that N the data file that distributes for M table space is not enough to increase in the data table memory, the data volume that foundation increases is at least one the table space distribute data file in M the table space, with the data that increase in the data table memory.
When the data in the tables of data increase, because the data file in the table space is limited, for the data that increase newly in the data table memory, can be the data file that table space distributes some, and the data file equilibrium is dispensed in the table space.
For example, the data volume of increase is 4G, and wherein, 2G is subregion P In January, 2013Data, 2G is subregion P In February, 2013Data, be table space M 3Distribute data file F 13, be table space M 4Distribute data file F 14, with P In January, 2013Data store table space M into 3Data file F 13In, with P In February, 2013Data store table space M into 4Data file F 14In.
Data in tables of data increase, and during the data that N the data file that distributes for M table space is not enough to increase in the data table memory, store the data that increase newly except adopting aforesaid way, also has alternate manner, for example: create at least one table space, and be the table space distribute data file of creating according to the data volume that increases, so that the data that increase in the tables of data store in the data file of table space of new establishment.When the table space of new establishment is a plurality of, data file also is a plurality of, and the number of data file is the balanced distribute data file of the new table space of creating during greater than the number of table space, the data that increase newly in a plurality of table space data table memories of recycling new establishment.
The date storage method based on the Oracle subregion that the embodiment of the invention two provides, recycling M table space data table memory partition data, this data storage method is the separate data focus effectively, guarantee that the data balancing of tables of data is in a plurality of data files, thereby accelerated data query speed, reduced the resource consumption of database.
Embodiment three
See also Fig. 3, be a kind of date storage method based on the Oracle subregion that the embodiment of the invention three provides, this method can comprise:
Step S301: create M table space for tables of data, wherein, M is the integer more than or equal to 2.
Step S302: the equilibrium of N data file is assigned in M the table space, and wherein, N is the integer more than or equal to M.
Wherein, data file can be the good data file of EMC preformatting, and the size of data file can be 2G, 5G or 10G.The number N of data file determines according to the size of the required storage space of the data volume of data table stores and each data file in the present embodiment, for example, the data volume of data table stores needs the size of 600G storage space, each data file to be 10G, then is required to be table space and distributes 60 data files that size is 10G.
In the present embodiment, N data file is big or small identical.The equilibrium of N data file is assigned to M table space can be comprised: when N can be divided exactly by M, for each table space distributes N/M data file; When N can not be divided exactly by M, for each table space in M-R the table space distributes
Figure BDA00003398111600091
Individual data file is for each table space in all the other table spaces distributes
Figure BDA00003398111600092
Individual data file, wherein, R is the remainder that N obtains divided by M,
Figure BDA00003398111600101
Expression rounds downwards.
Suppose that table space is 5, data file is 10, so, can be each table space and distributes two data files.Suppose that table space is 5, data file is 12, so, can be wherein that three table spaces distribute two data files respectively, for two other table space distributes three table spaces respectively.
In the present embodiment, the data file in each table space is unsuitable too many, guarantees the multilist space as far as possible, if data file is too many, its data quantity stored can be very big, just the data hot issue may occur.
Step S303: tables of data is carried out subregion.
Step S304: the data of i subregion of tables of data are stored in the data file of i-k*M table space, wherein, and i=1,2 ..., P, P are the subregion number of tables of data, and P is the integer greater than M,
Figure BDA00003398111600102
Expression rounds up, and namely by recycling the mode of M table space, the data of each subregion is stored in the data file of M table space.
Be example with sky wing reading project: the Order Entry Form data in the project are nearly 1,000,000,000, at first create 7 table spaces in oracle, are respectively M 1, M 2, M 3, M 4, M 5, M 6And M 7, for each table space distributes 10 EMC data files, each data file 10G.
Order Entry Form is according to business characteristic scope service time subregion, and subregion is according to diurnal on days subregion, and every month, 4 subregions were respectively P The 1st week of January in 2012, P The 2nd week of January in 2012, P The 3rd week of January in 2012, P January the 4th in 2012 Week, P The 1st week of February in 2012, P The 2nd week of February in 2012, P The 3rd week of February in 2012, P The 4th week of February in 2012,P In Dec, 2012 The 4th week
See also Fig. 4, with subregion P The 1st week of January in 2012Data store table space M into 1, with subregion P 2012 The 2nd week of January yearData store table space M into 2, with subregion P The 3rd week of January in 2012Data store table space M into 3, with subregion P The 4th week of January in 2012Data store table space M into 4, with subregion P The 1st week of February in 2012Data store table space M into 5, with subregion P The 2nd week of February in 2012Data store table space M into 6, with subregion P 2012 The 3rd week of February yearData store table space M into 7, with subregion P The 4th week of February in 2012Data store table space M into 1, with subregion P The 1st week of March in 2012Data store table space M into 2, with subregion P The 2nd week of March in 2012Data store table space M into 3, with subregion P The 3rd week of March in 2012Data store table space M4 into, with subregion P 2012 The 4th week of March yearData store table space M into 5With subregion P The 1st week of April in 2012Data store table space M into 6With subregion P The 2nd week of April in 2012Data store table space M into 7, remaining subregion reuses table space M 1, M 2, M 3, M 4, M 5, M 6And M 7In the practical application, the number of subregion is far longer than the number of table space usually.
Adopt above-mentioned storage mode, the data balancing of tables of data can be dispensed to table space M 1-M 710 data files in, effective separate data focus.But, still may exist the user at least two bigger situations of data file read-write frequency of certain table space, for further separate data focus, the date storage method that present embodiment provides can also comprise:
Step S305: the read-write number of times that detects N data file, the read-write number of times is moved in other table space in the data file of read-write number of times less than second preset value greater than the data in the data file of first preset value, wherein, first preset value is greater than second preset value.
For example, data file F1 in user's his-and-hers watches space M 1 and the read-write of F2 time number average is greater than first preset value, and the read-write of the data file in user's his-and-hers watches space M 3 time number average is less than second preset value, at this moment, data among the data file F1 among the table space M1 can be moved among the table space M3 in a certain data file, like this, further the separate data focus improves data query speed.Need to prove, the data of data file F1 directly can be moved in the data file among the table space M3, also data file F1 and the read-write number of times among the table space M3 of table space can be exchanged less than the data in a certain data file of second preset value.
Step S306: the data in tables of data increase, and during the data that N the data file that distributes for M table space is not enough to increase in the data table memory, create at least one table space, and be the table space distribute data file of creating according to the data volume that increases, so that the data that increase in the tables of data store in the data file of table space of new establishment.
When the table space of new establishment is a plurality of, data file also is a plurality of, and the number of data file is the balanced distribute data file of the new table space of creating during greater than the number of table space, the data that increase newly in a plurality of table space data table memories of recycling new establishment.
Data in tables of data increase, and during the data that N the data file that distributes for M table space is not enough to increase in the data table memory, except above-mentioned storage mode, also has other, for example: the data volume that foundation increases is at least one the table space distribute data file in M the table space, with the data that increase in the data table memory.When the data in the tables of data increase, because the data file in the table space is limited, for the data that increase newly in the data table memory, can be the data file that table space distributes some, and the data file equilibrium is dispensed in the table space.
The date storage method based on the Oracle subregion that the embodiment of the invention three provides, recycling M table space data table memory partition data, this data storage method is the separate data focus effectively, guarantee that the data balancing of tables of data is in a plurality of data files, thereby accelerated data query speed, reduced the resource consumption of database.
Embodiment four
See also Fig. 5, the structural representation of a kind of data storage device based on the Oracle subregion that provides for the embodiment of the invention four, this device can comprise: first creating unit 101, first allocation units 102, tables of data zoning unit 103 and data storage cell 104.Wherein:
First creating unit 101 is used to tables of data to create M table space, and wherein, M is the integer more than or equal to 2.
First allocation units 102 are used for the equilibrium of N data file is assigned to M table space, and wherein, N is the integer more than or equal to M.
Tables of data zoning unit 103 is used for tables of data is carried out subregion.
Data storage cell 104 is used for the data of i subregion of tables of data are stored to the data file of i-k*M table space, wherein, i=1,2 ..., P, P are the subregion number of tables of data, and P is the integer greater than M,
Figure BDA00003398111600121
Expression rounds up.
The data storage device based on the Oracle subregion that the embodiment of the invention four provides, recycling M table space data table memory partition data, this data storage method is the separate data focus effectively, guarantee that the data balancing of tables of data is in a plurality of data files, thereby accelerated data query speed, reduced the resource consumption of database.
Embodiment five
See also Fig. 6, the structural representation of a kind of data storage device based on the Oracle subregion that provides for the embodiment of the invention five, this device can comprise: first creating unit 201, first allocation units 202, tables of data zoning unit 203, data storage cell 204, second creating unit 205 and second allocation units 206.Wherein:
First creating unit 201 is used to tables of data to create M table space, and wherein, M is the integer more than or equal to 2.
First allocation units 202 are used for the equilibrium of N data file is assigned to M table space, and wherein, the number N of data file is definite according to the size of the required storage space of the data volume of data table stores and each data file, and N is the integer more than or equal to M.
Tables of data zoning unit 203 is used for tables of data is carried out subregion.
Data storage cell 204 is used for the data of i subregion of tables of data are stored to the data file of i-k*M table space, wherein, i=1,2 ..., P, P are the subregion number of tables of data, and P is the integer greater than M,
Figure BDA00003398111600131
Expression rounds up.
Second creating unit 205 is used for increasing when the data of tables of data, and during the data that are not enough to increase in the data table memory for N data file of M table space distribution, creates at least one table space.
Second allocation units 206, being used for according to the data volume that increases is the table space distribute data file that second creating unit 205 is created, so that the data that increase newly in the tables of data store in the data file of second allocation units, 206 distribution.
Wherein, N data file is big or small identical.Further, first allocation units 202 comprise distribution subelement 2021.
Distribute subelement 2021, be used for when N can be divided exactly by M, for each table space distributes N/M data file, when N can not be divided exactly by M, for each table space in M-R the table space distributes
Figure BDA00003398111600132
Individual data file is for each table space in all the other table spaces distributes Individual data file, wherein, R is the remainder that N obtains divided by M,
Figure BDA00003398111600134
Expression rounds downwards.
The data storage device based on the Oracle subregion that the embodiment of the invention five provides, recycling M table space data table memory partition data, this data storage method is the separate data focus effectively, guarantee that the data balancing of tables of data is in a plurality of data files, thereby accelerated data query speed, reduced the resource consumption of database.
Embodiment six
See also Fig. 7, the structural representation of a kind of data storage device based on the Oracle subregion that provides for the embodiment of the invention six, this device can comprise: first creating unit 301, first allocation units 302, tables of data zoning unit 303, data storage cell 304, detecting unit 305, data migration unit 306 and the 3rd allocation units 305.Wherein:
First creating unit 301 is used to tables of data to create M table space, and wherein, M is the integer more than or equal to 2.
First allocation units 302 are used for the equilibrium of N data file is assigned to M table space, and wherein, the number N of data file is definite according to the size of the required storage space of the data volume of data table stores and each data file, and N is the integer more than or equal to M.
Tables of data zoning unit 303 is used for tables of data is carried out subregion.
Data storage cell 304 is used for the data of i subregion of tables of data are stored to the data file of i-k*M table space, wherein, i=1,2 ..., P, P are the subregion number of tables of data, and P is the integer greater than M, Expression rounds up.
Detecting unit 305 is for detection of the read-write number of times of N data file.
Data migration unit 306 is used for read and write number of times and moves in other table space greater than the data of the data file of preset value and read and write in the data file of number of times less than second preset value, and wherein, first preset value is greater than second preset value.
The 3rd allocation units 307, be used for increasing when the data of tables of data, and during the data that N the data file that distributes for M table space is not enough to increase in the data table memory, data volume according to increase is M table space distribute data file, so that the data that increase in the tables of data store in the data file of the 3rd allocation units 307 distribution.
Wherein, N data file is big or small identical.Further, first allocation units 302 comprise distribution subelement 3021.
Distribute subelement 3021, be used for when N can be divided exactly by M, for each table space distributes N/M data file, when N can not be divided exactly by M, for each table space in M-R the table space distributes
Figure BDA00003398111600142
Individual data file is for each table space in all the other table spaces distributes
Figure BDA00003398111600143
Individual data file, wherein, R is the remainder that N obtains divided by M,
Figure BDA00003398111600151
Expression rounds downwards.
The data storage device based on the Oracle subregion that the embodiment of the invention six provides, recycling M table space data table memory partition data, this data storage method is the separate data focus effectively, guarantee that the data balancing of tables of data is in a plurality of data files, thereby accelerated data query speed, reduced the resource consumption of database.
For the convenience of describing, be divided into various unit with function when describing above the device and describe respectively.Certainly, when enforcement is of the present invention, can in same or a plurality of softwares and/or hardware, realize the function of each unit.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and identical similar part is mutually referring to getting final product between each embodiment, and each embodiment stresses is difference with other embodiment.Especially, for device embodiment, because it is substantially similar in appearance to method embodiment, so describe fairly simplely, relevant part gets final product referring to the part explanation of method embodiment.System embodiment described above only is schematic, wherein said unit as the separating component explanation can or can not be physically to separate also, the parts that show as the unit can be or can not be physical locations also, namely can be positioned at a place, perhaps also can be distributed on a plurality of network element.Can select wherein some or all of module to realize the purpose of present embodiment scheme according to the actual needs.Those of ordinary skills namely can understand and implement under the situation of not paying creative work.
The present invention can be used in numerous general or special purpose computingasystem environment or the configuration.For example: personal computer, server computer, handheld device or portable set, plate equipment, multicomputer system, the system based on microprocessor, network PC, small-size computer, mainframe computer, comprise distributed computing environment of above any system or equipment etc.
Need to prove, in this article, relational terms such as first and second grades only is used for an entity or operation are made a distinction with another entity or operation, and not necessarily requires or hint and have the relation of any this reality or in proper order between these entities or the operation.
The above only is preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (10)

1. the date storage method based on the Oracle subregion is characterized in that, comprising:
Create M table space for tables of data, wherein, M is the integer more than or equal to 2;
The equilibrium of N data file is assigned in the described M table space, and wherein, N is the integer more than or equal to M;
Described tables of data is carried out subregion;
The data of i subregion of described tables of data are stored in the data file of i-k*M table space, wherein, i=1,2 ..., P, P are the subregion number of tables of data, and P is the integer greater than M,
Figure FDA00003398111500011
Expression rounds up.
2. method according to claim 1 is characterized in that, described N data file big or small identical, and the described process that the equilibrium of N data file is assigned in the described M table space comprises:
When N can be divided exactly by M, for each table space distributes N/M data file;
When N can not be divided exactly by M, for each table space in M-R the table space distributes
Figure FDA00003398111500012
Individual data file is for each table space in all the other table spaces distributes
Figure FDA00003398111500013
Individual data file, wherein, R is the remainder that N obtains divided by M,
Figure FDA00003398111500014
Expression rounds downwards.
3. method according to claim 1 and 2 is characterized in that, also comprises:
Data in described tables of data increase, and when being not enough to store the data that increase in the described tables of data for N data file of described M table space distribution, create at least one table space, and be described table space distribute data file according to the data volume that increases, so that the data that increase newly in the tables of data store in the data file of table space of this new establishment.
4. method according to claim 1 and 2 is characterized in that, also comprises:
Data in described tables of data increase, and when being not enough to store the data that increase in the described tables of data for N data file of described M table space distribution, the data volume that foundation increases is at least one the table space distribute data file in the described M table space, so that the data that increase newly in the tables of data store in this data file.
5. method according to claim 1 is characterized in that, also comprises:
Detect the read-write number of times of described N data file;
The read-write number of times is moved in other table space in the data file of read-write number of times less than second preset value greater than the data in the data file of first preset value, and wherein, described first preset value is greater than described second preset value.
6. the data storage device based on the Oracle subregion is characterized in that, comprising:
First creating unit is used to tables of data to create M table space, and wherein, M is the integer more than or equal to 2;
First allocation units are used for the equilibrium of N data file is assigned to M table space, and wherein, N is the integer more than or equal to M;
The tables of data zoning unit is used for described tables of data is carried out subregion;
Data storage cell is used for the data of i subregion of described tables of data are stored to the data file of i-k*M table space, wherein, i=1,2 ..., P, P are the subregion number of tables of data, and P is the integer greater than M,
Figure FDA00003398111500021
Expression rounds up.
7. device according to claim 6 is characterized in that, described N data file big or small identical, and described first allocation units comprise:
Distribute subelement, be used for when N can be divided exactly by M, for each table space distributes N/M data file, when N can not be divided exactly by M, for each table space in M-R the table space distributes Individual data file is for each table space in all the other table spaces distributes Individual data file, wherein, R is the remainder that N obtains divided by M, Expression rounds downwards.
8. according to claim 6 or 7 described devices, it is characterized in that, also comprise:
Second creating unit is used for increasing when the data of described tables of data, and during the data that are not enough to increase in the data table memory for N data file of described M table space distribution, creates at least one table space;
Second allocation units, being used for according to the data volume that increases is the table space distribute data file that described second creating unit is created, so that the data that increase in the tables of data store in the data file of described second allocation units distribution.
9. according to claim 6 or 7 described devices, it is characterized in that, also comprise:
The 3rd allocation units, be used for increasing when the data of described tables of data, and during the data that N the data file that distributes for described M table space is not enough to increase in the data table memory, the data volume that foundation increases is at least one the table space distribute data file in the described M table space, so that the data that increase in the tables of data store in the data file of described the 3rd allocation units distribution.
10. according to claim 6 or 7 described devices, it is characterized in that, also comprise:
Detecting unit is for detection of the read-write number of times of described N data file;
Data migration unit is used for read and write number of times and moves in other table space greater than the data of the data file of first preset value and read and write in the data file of number of times less than second preset value, and wherein, described first preset value is greater than described second preset value.
CN2013102560592A 2013-06-24 2013-06-24 Oracle partition based data storing method and device Pending CN103279582A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2013102560592A CN103279582A (en) 2013-06-24 2013-06-24 Oracle partition based data storing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2013102560592A CN103279582A (en) 2013-06-24 2013-06-24 Oracle partition based data storing method and device

Publications (1)

Publication Number Publication Date
CN103279582A true CN103279582A (en) 2013-09-04

Family

ID=49062099

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2013102560592A Pending CN103279582A (en) 2013-06-24 2013-06-24 Oracle partition based data storing method and device

Country Status (1)

Country Link
CN (1) CN103279582A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104270340A (en) * 2014-09-01 2015-01-07 北京锐安科技有限公司 Voice signaling data storage method and rapid early warning method
CN104731864A (en) * 2015-02-26 2015-06-24 国家计算机网络与信息安全管理中心 Data storage method for mass unstructured data
CN105677903A (en) * 2016-02-05 2016-06-15 华为技术有限公司 Data acquisition method and device as well as computer device
CN107861959A (en) * 2016-09-22 2018-03-30 阿里巴巴集团控股有限公司 Data processing method, apparatus and system
CN108268341A (en) * 2016-12-30 2018-07-10 大唐移动通信设备有限公司 A kind of Data Migration, backup and restoration methods and device
CN110287066A (en) * 2019-06-28 2019-09-27 浪潮商用机器有限公司 A kind of server partition moving method and relevant apparatus

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101086732A (en) * 2006-06-11 2007-12-12 上海全成通信技术有限公司 A high magnitude of data management method
US20090198748A1 (en) * 2008-02-06 2009-08-06 Kevin John Ash Apparatus, system, and method for relocating storage pool hot spots
CN101710339A (en) * 2009-11-20 2010-05-19 中国科学院计算技术研究所 Method and system for controlling data storage in cluster file system and method for creating file
CN102662968A (en) * 2012-03-09 2012-09-12 浪潮通信信息系统有限公司 Optimization method for Oracle massive data storage

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101086732A (en) * 2006-06-11 2007-12-12 上海全成通信技术有限公司 A high magnitude of data management method
US20090198748A1 (en) * 2008-02-06 2009-08-06 Kevin John Ash Apparatus, system, and method for relocating storage pool hot spots
CN101710339A (en) * 2009-11-20 2010-05-19 中国科学院计算技术研究所 Method and system for controlling data storage in cluster file system and method for creating file
CN102662968A (en) * 2012-03-09 2012-09-12 浪潮通信信息系统有限公司 Optimization method for Oracle massive data storage

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄嵘,等: ""基于分级存储的国土资源数据管理方法研究"", 《西北工业大学学报》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104270340A (en) * 2014-09-01 2015-01-07 北京锐安科技有限公司 Voice signaling data storage method and rapid early warning method
CN104270340B (en) * 2014-09-01 2017-10-27 北京锐安科技有限公司 A kind of voice signaling date storage method and the method for quick early warning
CN104731864A (en) * 2015-02-26 2015-06-24 国家计算机网络与信息安全管理中心 Data storage method for mass unstructured data
CN104731864B (en) * 2015-02-26 2018-05-29 国家计算机网络与信息安全管理中心 A kind of date storage method of magnanimity unstructured data
CN105677903A (en) * 2016-02-05 2016-06-15 华为技术有限公司 Data acquisition method and device as well as computer device
CN107861959A (en) * 2016-09-22 2018-03-30 阿里巴巴集团控股有限公司 Data processing method, apparatus and system
CN108268341A (en) * 2016-12-30 2018-07-10 大唐移动通信设备有限公司 A kind of Data Migration, backup and restoration methods and device
CN110287066A (en) * 2019-06-28 2019-09-27 浪潮商用机器有限公司 A kind of server partition moving method and relevant apparatus
CN110287066B (en) * 2019-06-28 2023-05-12 浪潮商用机器有限公司 Server partition migration method and related device

Similar Documents

Publication Publication Date Title
CN103279582A (en) Oracle partition based data storing method and device
US20200257690A1 (en) Tiering with pluggable storage system for parallel query engines
CN103064639B (en) Date storage method and device
US10831736B2 (en) Fast multi-tier indexing supporting dynamic update
CN103020174B (en) Similarity analysis method, Apparatus and system
Stuedi et al. Crail: A High-Performance I/O Architecture for Distributed Data Processing.
CN104111936B (en) Data query method and system
CN101944124B (en) Distributed file system management method, device and corresponding file system
US9372880B2 (en) Reclamation of empty pages in database tables
US20150032780A1 (en) Partitioning data for parallel processing
CN102255962A (en) Distributive storage method, device and system
CN103455631A (en) Method, device and system for processing data
CN104182487A (en) Unified storage method supporting various storage modes
EP3803615A1 (en) Scalable multi-tier storage structures and techniques for accessing entries therein
CN104216893A (en) Partitioned management method for multi-tenant shared data table, server and system
DE102012218269A1 (en) Interface for managing data movement in a thin provisioning storage system
CN101673271A (en) Distributed file system and file sharding method thereof
CN103631924A (en) Application method and system for distributive database platform
CN106598724B (en) Method for managing memory in a computing system
CN101777061A (en) JAVA card object management method and JAVA card
CN104536908B (en) A kind of magnanimity small records efficient storage management method towards unit
CN102945275A (en) File defragmentation method, file defragmentation unit and file defragmentation device
CN104376109A (en) Multi-dimension data distribution method based on data distribution base
CN108536392A (en) Blended data lookup method
CN107408132B (en) Method and system for moving hierarchical data objects across multiple types of storage

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20130904