Oil rises marginally as markets weigh inventory data, US ratings downgrade