The 29-year-old O'Hearn hit .239 with a home run and 16 RBIs last season. He has spent his first five big league seasons with the Royals.
O'Hearn has played mostly first base in his career, but he has also spent time in the corner outfield spots.
O'Hearn led the majors last year with 11 hits as a pinch-hitter.
The Orioles designated right-hander Chris Vallimont for assignment. Their 40-man roster is currently full.