473,511 Members | 14,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Monitor object activity

Hello:
I need to cleanup a database which contains tons of tables and queries
and I would like to remove the unused/useless objects. Is there a way
to automate this? Like indexing the objects to monitor the activity? A
procedure? An utility tool maybe? Date Created and Modified is not
precise enough.
Thanks!

May 23 '06 #1
7 1888
If you're not in a rush for the data, you can do a pretty nice job of this
with some coding, though it will affect performance slightly.

Make yourself a table MyObjectLog, with columns for object type, object
name, date of last use, and number of uses. You could prepopulate that with
all types and names by using an append query that select records from
msysobjects. For readability, either change the Type column to text and
replace "5" with "query", etc, or set up constants and refer to them when
passing type info. (const OBJTYPE_QUERY as long = 5, etc). Make sure the
log table is in a backend, so that the data doesn't get overwritten with new
release of the app. If you are not using a split Front End/Back End
arrangement, make a new MDB and put the log table in it, then link to it
from your app MDB.

Write a function the accepts parameters for the type and name and creates a
recordset to retrieve the existing row for the object with the type and name
received by the function. Update the date and count columns.

Here's the not very pretty but I believe unavoidable messy part: You have
to add a call to the function in the Open event of each form or report, and
anywhere incode that you open a query (as with docmd.openquery) or table
explicitly.

I don't know of any other method for gathering accurate information about
object usage. If there is one, I'd love to know it myself.

I say "not in a rush for the data" because now you just have to let the app
run for "long enough" (whatever that is) to get enough info to base your
decisions on.

There are other ways, depending on who will be running the app and how
tolerant they would be of hitting errors and waiting for recovery from the
error: If you are in an MDB, you just rename things, adding "_X" (or
anything you like) to the end of object names. As the app runs, if
something still in use has been renamed, you wil get the obvious error.
Recovery consists of getting into the MDB at the database window and fixing
the name of the object. One down, some unknown number to go.

This is a nerve-wracking approach if it's end-users that will see these
errors, so the log table approach is recommended unless it is basically you
and a hardy soul or two using the app during the research period.

HTH
May 23 '06 #2

"Rick Wannall" <cw******@yahoo.com> schreef in bericht news:bG*******************@newssvr13.news.prodigy. com...
If you're not in a rush for the data, you can do a pretty nice job of this
with some coding, though it will affect performance slightly.

Make yourself a table MyObjectLog, with columns for object type, object
name, date of last use, and number of uses. You could prepopulate that with
all types and names by using an append query that select records from
msysobjects. For readability, either change the Type column to text and
replace "5" with "query", etc, or set up constants and refer to them when
passing type info. (const OBJTYPE_QUERY as long = 5, etc). Make sure the
log table is in a backend, so that the data doesn't get overwritten with new
release of the app. If you are not using a split Front End/Back End
arrangement, make a new MDB and put the log table in it, then link to it
from your app MDB.

Write a function the accepts parameters for the type and name and creates a
recordset to retrieve the existing row for the object with the type and name
received by the function. Update the date and count columns.

Here's the not very pretty but I believe unavoidable messy part: You have
to add a call to the function in the Open event of each form or report, and
anywhere incode that you open a query (as with docmd.openquery) or table
explicitly.

I don't know of any other method for gathering accurate information about
object usage. If there is one, I'd love to know it myself.

I say "not in a rush for the data" because now you just have to let the app
run for "long enough" (whatever that is) to get enough info to base your
decisions on.

There are other ways, depending on who will be running the app and how
tolerant they would be of hitting errors and waiting for recovery from the
error: If you are in an MDB, you just rename things, adding "_X" (or
anything you like) to the end of object names. As the app runs, if
something still in use has been renamed, you wil get the obvious error.
Recovery consists of getting into the MDB at the database window and fixing
the name of the object. One down, some unknown number to go.

This is a nerve-wracking approach if it's end-users that will see these
errors, so the log table approach is recommended unless it is basically you
and a hardy soul or two using the app during the research period.

HTH


Hmmmm, I think I would not like this at all...

Much, much better IMO you could use a tool like Rick Fisher's Find & Replace (or Speed Ferret) for this job.
I don't know Speed Ferret myself (I heard it's good), but I use F&R since Access 2.0
It is a very good tool. For this job you would need the cross-reference report (available in the registered version)
http://www.rickworld.com/products.html

Arno R
May 23 '06 #3
Thanks Rick.
This is a standalone mdb. No forms or reports. Some tables and queries
are used thru ColdFusion to display web live info. This mdb is used by
different users (which can query, view or update some tables thru the
web). Other tables and queries are used for performing data search
inside the mdb. Changing object names is not a problem, they cannot.
I still can read the sql statements in ColdFusion to get some of the
object names, it is a bit fastidious but well, it is possible, but it
resolves only one part of my task. Inside the mdb I can't see a way to
get a solution. Do you envision another way without using forms and
reports?

May 23 '06 #4
Interesting thanks. I check out the Help of F&R about the Xref report
but I am not sure if I can get something like a last used date for eahc
object. It seems to reference objects between them, like what tables
are used in what queries, did you already get results for my request?

May 23 '06 #5
F&R won't give you a last used date, no
Apparantly that is what you need. I misunderstood you.

Arno R

"jojo1" <pj*******@msn.com> schreef in bericht news:11*********************@j55g2000cwa.googlegro ups.com...
Interesting thanks. I check out the Help of F&R about the Xref report
but I am not sure if I can get something like a last used date for eahc
object. It seems to reference objects between them, like what tables
are used in what queries, did you already get results for my request?

May 23 '06 #6
No.
May 23 '06 #7
On 23 May 2006 09:00:54 -0700, "jojo1" <pj*******@msn.com> wrote:

Long shot: there is a DLL that can be used to get the same information
as LdbViewer application. The name escapes me, but I'm sure you can
google for it. Perhaps it can give you what you need.
Otherwise: inspect your source code. Convert everything to text files,
and search for any of the tablenames and querynames using something as
simple as fc.exe.

-Tom.
Hello:
I need to cleanup a database which contains tons of tables and queries
and I would like to remove the unused/useless objects. Is there a way
to automate this? Like indexing the objects to monitor the activity? A
procedure? An utility tool maybe? Date Created and Modified is not
precise enough.
Thanks!


May 24 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3299
by: Jack David | last post by:
Using the code below I am able to monitor a single directory for a new file and then kick-off a process to deal with the file. The question is??? How would I modify this code to be able to monitor...
1
1256
by: chris | last post by:
Is there a way that i can monitor the use of a file in terms of a timestamp? My goal is to monitor the activity of a file and when it goes beyond 10 minutes of non activity I will shut it down.
4
2370
by: John | last post by:
I'd like to write a programme that runs on a PC with two monitors. The application would be used in a shop, with one monitor for shop assistant and the other for the customer. The two must show...
4
6131
by: Raj | last post by:
Can we create an event monitor for statements in a partitioned environment? CREATE EVENT MONITOR stmt_event FOR STATEMENTS WRITE TO FILE '/home/rajm/event' ON PARTITION 0 GLOBAL DB21034E ...
0
1203
by: dunleav1 | last post by:
Is there a bug in the activity monitor in that if the active sql statement is over size N the statement doesn't show in the tool? I have statements that I can see in the design advisor gui, but...
4
4186
by: max | last post by:
Hi all, I want to write a program in C/C++ which monitor any hard disk activity by a particular program which have assigned for WINXP. For example, the program are going to run like this.....
6
6784
by: wugon.net | last post by:
Hi , Anyone know how to monitor db2 trigger activity ? We suffer some trigger issue , and we try to monitor trigger's behavior use event monitor and db2audit, but both tools can not get...
0
2607
by: wugon.net | last post by:
Hi , Anyone know how to monitor db2 trigger activity ? We suffer some trigger issue today and we try to monitor trigger's behavior use event monitor and db2audit, but both tools can not get...
5
14792
by: jbenner | last post by:
I have opened a PMR for this with IBM, and am not asking for advice from the DB2 DBA community. I am posting this as an FYI that DB2 Health Monitor, even at the latest version of DB2, still can cause...
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7349
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5659
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4734
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3219
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.