Schaub, who has a $14.5 million salary-cap figure and a $10 million base salary for 2014, became expendable when the Texans signed former Tennessee Titans quarterback Ryan Fitzpatrick to a two-year deal Thursday night.
Not long after Houston got Fitzpatrick, Oakland made its final pitch for Schaub.
The Cleveland Browns also had expressed interest in Schaub, who could have been reunited with former offensive coordinator Kyle Shanahan. But the Raiders wanted Schaub more, according to a source.
The trade between Oakland and Houston, teams scheduled to pick in the top five in this year's draft, could affect how high quarterbacks will be selected.
Oakland will have Schaub, a veteran atop the team's offseason wish list and someone who reduces the pressure on the team to use its first-round pick -- No. 5 overall -- on a quarterback.
Houston, which holds the No. 1 overall pick, likely has an even greater need at the quarterback position now after trading Schaub.
The Raiders have three other quarterbacks in Terrelle Pryor, Matt McGloin and Trent Edwards. Coach Dennis Allen recently said he was not sure whether the team's quarterback of the future is in the locker room at this time.
After leading the Texans to AFC South Division titles in 2011 and 2012, Schaub struggled early last season before being benched in favor of rookie Case Keenum in October. The 10-year veteran regained the starting job in late December but could not help the Texans avoid finishing the season with a 14-game losing streak, the longest in franchise history.
A two-time Pro Bowler, Schaub has eclipsed 4,000 passing yards three times in his career. The 32-year-old spent the past seven seasons as the Texans' starting quarterback.
ESPN.com Raiders reporter Paul Gutierrez contributed to this report.