Drizzle olive oil on 1 side of each bread slice. Spread 1 tablespoon mayonnaise on the other side of each slice. Pile Cheddar cheese, ham, tomato, and onion on top. Top with other bread slice, mayonnaise side down.
Heat a grill pan over medium-high heat; spray lightly with cooking spray. Place sandwich on grill; weigh it down with a heavy pan. Cook until cheese is melted and grill marks appear, 3 to 5 minutes per side.