You can use the script below to clear analysis DB cache, you can run this xmla script into the cube.
<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<ClearCache>
<Object>
<DatabaseID>dwSampleCubeDB</DatabaseID>
</Object>
</ClearCache>
</Batch>
<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<ClearCache>
<Object>
<DatabaseID>dwSampleCubeDB</DatabaseID>
</Object>
</ClearCache>
</Batch>