From Rosh Chodesh Elul till after Hoshana Raba, after the Shir shel Yom is recited, and at Mincha before Oleinu, we say “LeDavid HaShem….’ Until after Hoshana Raba, the last time being Mincha of Hoshana Raba. During the days of Rosh Chodesh Elul, the custom is to recite the Psalm Borchi Nafshi, and afterwards ‘L’David HaShem Ori’.