The trial heard that police in Greenock set up Operation Evergreen to continue their hunt for the killer of Elaine, whose body was found near her home in June 1986.
They tried to visit every male who had come to the attention of police since then - which included John Docherty, 49, the man now on trial.
They were asked for "elimination samples" which would be destroyed at the end of any court case and not find their way on to the national data base.
Detective constable Stuart Young, 49, told how Docherty willingly gave a DNA sample, finger-prints and allowed himself to be photographed.
The detective said Docherty signed a form agreeing: "I have been made aware I am not obliged to provide this sample and that any information from this sample may be used in evidence."
Fiona McMahon, 42, who heads the specialist DNA data base team at the Scottish Police Authority lab in Dundee, said the sample from Docherty was one of 361 processed in her lab.
She told the High Court in Edinburgh she compared it with what was tagged "the crime scene profile." Ms McMahon said: "It was a full match."
She said she had also examined "elimination samples" provided by some of the possible suspects put forward by the defence but found no matches.
The trial heard that Docherty, now of Dun-oon, was living in Green-ock in 1986 but spent time in the Army before moving back to the town.
He denies murdering Elaine. The trial continues.