CN104504144A - Method and device for acquiring index-related information - Google Patents

Method and device for acquiring index-related information Download PDF

Info

Publication number
CN104504144A
CN104504144A CN201510003880.2A CN201510003880A CN104504144A CN 104504144 A CN104504144 A CN 104504144A CN 201510003880 A CN201510003880 A CN 201510003880A CN 104504144 A CN104504144 A CN 104504144A
Authority
CN
China
Prior art keywords
index
relevant information
database
custom script
data block
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
CN201510003880.2A
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.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry 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 Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201510003880.2A priority Critical patent/CN104504144A/en
Publication of CN104504144A publication Critical patent/CN104504144A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2291User-Defined Types; Storage management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2272Management thereof

Abstract

The invention discloses a method and a device for acquiring index-related information. The method includes the steps: analyzing a preset data block in a database by a user-defined script to obtain the index-related information; applying the index-related information to the database. The index-related information in the database is acquired by the user-defined script and applied to the database, the influence on the database is less, resource consumption and time consumption can be controlled, and the problems of database performance reduction and the like caused by using information collection tasks of the database are avoided.

Description

A kind of method and apparatus obtaining index relevant information
Technical field
The present invention relates to field of computer technology, be specifically related to a kind of method and apparatus obtaining index relevant information.
Background technology
Along with developing rapidly of infotech, in large database, the change of data is very frequently, therefore, the index set up on data in a database also needs frequent maintenance, otherwise, these indexes just do not have corresponding effect, even can become the burden of database.
In prior art, database creates the information task of a robotization acquiescently, is carried out the collection of statistical information, comprise the relevant information of collection table, index and system by this information task.Above-mentioned information task infers the relevant information of index entirety by extracting a part of data of index, to system resource and the consumption of time very large, cause database performance to decline.
Summary of the invention
The invention provides a kind of method and apparatus obtaining index relevant information, to solve information task of the prior art to system resource and the very large defect of the consumption of time.
The invention provides a kind of method obtaining index relevant information, comprise the following steps:
By custom script, the preset data block in database is resolved, obtain index relevant information;
Described index relevant information is applied in described database.
Alternatively, describedly by custom script, the preset data block in database to be resolved, obtains index relevant information, specifically comprise:
From the preset data block described database, obtain index by described custom script, described index is dumped in trace file;
Described trace file is analyzed, obtains described index relevant information.
Alternatively, describedly by custom script, the preset data block in database to be resolved, before obtaining index relevant information, also comprises:
Self-defined plan target in customization custom script.
Alternatively, the self-defined plan target in described customization custom script, is specially:
By using crontab instrument, the self-defined plan target in customization custom script.
Alternatively, the number of the unique value that described index relevant information comprises the line number of index, the floor height of index, index size, index block number, index comprise, and one or more in the leaf number of index.
Present invention also offers a kind of equipment obtaining index relevant information, comprising:
Parsing module, for being resolved the preset data block in database by custom script, obtains index relevant information;
Application module, is applied in described database for described parsing module is resolved the described index relevant information obtained.
Alternatively, described parsing module, specifically for obtaining index by described custom script from the preset data block described database, is dumped in trace file by described index; Described trace file is analyzed, obtains described index relevant information.
Alternatively, described equipment, also comprises:
Customized module, for customizing the self-defined plan target in custom script.
Alternatively, described customized module, specifically for by using crontab instrument, customizes the self-defined plan target in custom script.
Alternatively, the number of the unique value that described index relevant information comprises the line number of index, the floor height of index, index size, index block number, index comprise, and one or more in the leaf number of index.
The present invention obtains the index relevant information in database by custom script, and index relevant information is applied in database, little on the impact of database, resource consumption and time loss are all controlled, avoid degradation problem under the database performance that the information task that carries because of usage data storehouse brings.
Accompanying drawing explanation
Fig. 1 is a kind of method flow diagram obtaining index relevant information in the embodiment of the present invention;
Fig. 2 is a kind of device structure schematic diagram obtaining index relevant information in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
It should be noted that, if do not conflicted, each feature in the embodiment of the present invention and embodiment can be combined with each other, all within protection scope of the present invention.In addition, although show logical order in flow charts, in some cases, can be different from the step shown or described by order execution herein.
Embodiments provide a kind of method obtaining index relevant information, as shown in Figure 1, comprise the following steps:
Step 101, disposes custom script.
Being somebody's turn to do in the present embodiment, by performing to issue orders, realizing the deployment to custom script:
Chown oracle:oinstall index_info_stat.sh
Step 102, the self-defined technical assignment in customization custom script.
Particularly, can by using crontab instrument, the self-defined plan target in customization custom script.
Step 103, obtains index by custom script from the preset data block database.
Particularly, index can be obtained by custom script from the build of the preset data block database.
In the present embodiment, perform to issue orders by custom script, obtain index:
select object_id from dba_objects where object_name='SYS_C007705'
Step 104, is dumped to index in trace file.
Wherein, trace file comprises backstage alarm log file, backstage trace file and usertracking file.
In the present embodiment, by performing to issue orders, index is dumped in trace file:
alter session set events'immediate trace name treedump level 55540'
Step 105, analyzes trace file, obtains index relevant information.
Wherein, the number of the unique value that index relevant information comprises the line number of index, the floor height of index, index size, index block number, index comprise, and one or more in the leaf number of index.
In the present embodiment, perform to issue orders by custom script, trace file analyzed:
Cat o10201_ora_32037.trc|grep“branch:”|grep“(0:”
Step 106, is applied to index relevant information in database.
In the present embodiment, perform to issue orders by custom script, index relevant information be applied in database:
Exec dbms_stats.set_index_stats(.....)
The embodiment of the present invention obtains the index relevant information in database by custom script, and index relevant information is applied in database, little on the impact of database, resource consumption and time loss are all controlled, avoid degradation problem under the database performance that the information task that carries because of usage data storehouse brings.
Based on the method for above-mentioned acquisition index relevant information, the embodiment of the present invention additionally provides a kind of equipment obtaining index relevant information, as shown in Figure 2, comprising:
Parsing module 210, for being resolved the preset data block in database by custom script, obtains index relevant information.
Particularly, above-mentioned parsing module 210, specifically for obtaining index by described custom script from the preset data block described database, is dumped in trace file by described index; Described trace file is analyzed, obtains described index relevant information.
Wherein, the number of the unique value that index relevant information comprises the line number of index, the floor height of index, index size, index block number, index comprise, and one or more in the leaf number of index.
Application module 220, is applied in database for parsing module 210 is resolved the index relevant information obtained.
Customized module 230, for customizing the self-defined plan target in custom script.
Particularly, above-mentioned customized module 230, specifically for by using crontab instrument, customizes the self-defined plan target in custom script.
The embodiment of the present invention obtains the index relevant information in database by custom script, and index relevant information is applied in database, little on the impact of database, resource consumption and time loss are all controlled, avoid degradation problem under the database performance that the information task that carries because of usage data storehouse brings.
In conjunction with the software module that the step in the method that embodiment disclosed herein describes can directly use hardware, processor to perform, or the combination of the two is implemented.Software module can be placed in the storage medium of other form any known in random access memory (RAM), internal memory, ROM (read-only memory) (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should described be as the criterion with the protection domain of claim.

Claims (10)

1. obtain a method for index relevant information, it is characterized in that, comprise the following steps:
By custom script, the preset data block in database is resolved, obtain index relevant information;
Described index relevant information is applied in described database.
2. the method for claim 1, is characterized in that, is describedly resolved the preset data block in database by custom script, obtains index relevant information, specifically comprises:
From the preset data block described database, obtain index by described custom script, described index is dumped in trace file;
Described trace file is analyzed, obtains described index relevant information.
3. the method for claim 1, is characterized in that, is describedly resolved the preset data block in database by custom script, before obtaining index relevant information, also comprises:
Self-defined plan target in customization custom script.
4. method as claimed in claim 3, it is characterized in that, the self-defined plan target in described customization custom script, is specially:
By using crontab instrument, the self-defined plan target in customization custom script.
5. the method according to any one of Claims 1-4, it is characterized in that, the number of the unique value that described index relevant information comprises the line number of index, the floor height of index, index size, index block number, index comprise, and one or more in the leaf number of index.
6. obtain an equipment for index relevant information, it is characterized in that, comprising:
Parsing module, for being resolved the preset data block in database by custom script, obtains index relevant information;
Application module, is applied in described database for described parsing module is resolved the described index relevant information obtained.
7. equipment as claimed in claim 6, is characterized in that,
Described parsing module, specifically for obtaining index by described custom script from the preset data block described database, is dumped in trace file by described index; Described trace file is analyzed, obtains described index relevant information.
8. equipment as claimed in claim 6, is characterized in that, also comprise:
Customized module, for customizing the self-defined plan target in custom script.
9. equipment as claimed in claim 8, is characterized in that,
Described customized module, specifically for by using crontab instrument, customizes the self-defined plan target in custom script.
10. the equipment according to any one of claim 6 to 9, it is characterized in that, the number of the unique value that described index relevant information comprises the line number of index, the floor height of index, index size, index block number, index comprise, and one or more in the leaf number of index.
CN201510003880.2A 2015-01-05 2015-01-05 Method and device for acquiring index-related information Pending CN104504144A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510003880.2A CN104504144A (en) 2015-01-05 2015-01-05 Method and device for acquiring index-related information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510003880.2A CN104504144A (en) 2015-01-05 2015-01-05 Method and device for acquiring index-related information

Publications (1)

Publication Number Publication Date
CN104504144A true CN104504144A (en) 2015-04-08

Family

ID=52945541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510003880.2A Pending CN104504144A (en) 2015-01-05 2015-01-05 Method and device for acquiring index-related information

Country Status (1)

Country Link
CN (1) CN104504144A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040117387A1 (en) * 2000-02-25 2004-06-17 Vincent Civetta Database sizing and diagnostic utility
CN101055591A (en) * 2007-05-25 2007-10-17 中兴通讯股份有限公司 Data access method for all-memory database
CN101136016A (en) * 2006-09-01 2008-03-05 北大方正集团有限公司 Indexes on-line updating method of full text retrieval system
CN101887417A (en) * 2009-05-13 2010-11-17 上海即略网络信息科技有限公司 Searching method
CN102004800A (en) * 2010-12-28 2011-04-06 北京数码大方科技有限公司 Data query method and device of PDM (Product Data Management) system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040117387A1 (en) * 2000-02-25 2004-06-17 Vincent Civetta Database sizing and diagnostic utility
CN101136016A (en) * 2006-09-01 2008-03-05 北大方正集团有限公司 Indexes on-line updating method of full text retrieval system
CN101055591A (en) * 2007-05-25 2007-10-17 中兴通讯股份有限公司 Data access method for all-memory database
CN101887417A (en) * 2009-05-13 2010-11-17 上海即略网络信息科技有限公司 Searching method
CN102004800A (en) * 2010-12-28 2011-04-06 北京数码大方科技有限公司 Data query method and device of PDM (Product Data Management) system

Similar Documents

Publication Publication Date Title
CN109062780B (en) Development method of automatic test case and terminal equipment
CN105049287A (en) Log processing method and log processing devices
CN110737594B (en) Database standard conformance testing method and device for automatically generating test cases
CN111064712B (en) Game resource packaging method and system
CN109597974B (en) Report generation method and device
CN104298588A (en) Continuous integration implementation method and device
CN109508355A (en) A kind of data pick-up method, system and terminal device
US9177020B2 (en) Gathering index statistics using sampling
CN104268064A (en) Abnormity diagnosis method and device of product logs
CN111190962B (en) File synchronization method and device and local terminal
CN104902292B (en) A kind of the analysis of public opinion method and system based on television report
CN105095059A (en) Method and device for automated testing
CN104022913B (en) For method of testing and the device of data cluster
ATE314703T1 (en) METHOD FOR AUTOMATIC LABELING OF BRANCHES
DE102016205013A1 (en) Fingerprinting and comparing historical data streams
DE102016100773A1 (en) Collect compression performance metrics for processing data
CN105005585A (en) Log data processing method and device
CN106201857B (en) The choosing method and device of test case
CN104636244A (en) Server monitoring method using Java, MySQL and Shell
CN111324781A (en) Data analysis method, device and equipment
CN110704417A (en) Metadata management method, equipment and storage medium
CN106503010B (en) A kind of method and device of database change write-in subregion
CN104461875B (en) A kind of method according to equivalence class design software test case
EP3506101A3 (en) System and method for controlled data extraction in computer networks
CN102981822A (en) Method and equipment of treatment strategy

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: 20150408