Is there a way to gather information on files using just the MD5 value?

0 Likes

Problem:

Is there a way to gather information on files using just the MD5 value?

Resolution:

  • Product Name: StarTeam
  • Product Version: 2005 R2 - 2008
  • Product Component: Database
  • Platform/OS Version: Windows

The attached .sql script will allow you to gather information on a file such as the files id, the project and view it belongs to, the folder location of the file and when the file was deleted (if applicable). This script is designed to run against Oracle databases only.

  1. Within SQLPlus Worksheet connect to the target database and run the "starteam_oracle_list_md5_ref.sql" script to create the stored procedure. To do this in SQLPlus Worksheet choose Worksheet | Run Local Script.
  2. If the MD5 of each file is unknown, run this query against the target database to generate a list of MD5s: select md5 from syn_file
  3. To get information on every MD5 run the following in SQL Worksheet:

set serveroutput on
declare --declare cusror
cursor c8 is
select
initcap(MD5) MD5 --select MD5
from syn_file;
begin
for r_c8 in c8 loop -- loop which rows exist
dbms_output.put_line(r_c8.MD5);
list_MD5_ref(r_c8.MD5); -- call procedure to obtain information on MD5


You could alter this query to gather information on specific MD5"s only. For example if you wanted to find all MD5"s that are native 1 format you would use the following:


set serveroutput on
declare --declare cusror
cursor c8 is
select
initcap(MD5) MD5 --select MD5
from syn_file where ArchiveFormat = 1; --additional query for native one files
begin
for r_c8 in c8 loop -- loop which rows exist
dbms_output.put_line(r_c8.MD5);
list_MD5_ref(r_c8.MD5); -- call procedure to obtain information on MD5


Related documents:


Old KB# 27387
Comment List
Related
Recommended