If you have used repvfy utility in grid control, pls see the sql generated under emdiag/log location. Out of repvfy a sql file generated and content of those sql’s are pretty useful.
Also on other note if you want to diagonise one target, you can use below command.
./repvfy -usr SYSMAN -tns emrep -pwd