In the rare event that your Aperture database becomes corrupted or the files within it have permissions issues, Aperture provides a few methods for reconstituting your Aperture library and the file relationships within it.
Close Aperture, if it’s open.
Locate the Aperture library you want to fix, then hold down the Command and Option keys while double-clicking the Aperture library.
The Aperture Library First Aid dialog appears.

In the Aperture Library First Aid dialog, do one of the following:
This option should be used when Aperture can’t access some of the image files within the database or Aperture is unable to open the library itself. The Repairing Permissions option reviews each file in your Aperture library and sets the read and write access of each file where appropriate, allowing Aperture to access the files again.
Note: This option does not relocate referenced images whose master image files are offline. For more information about reconnecting offline images, see Reconnecting Missing or Offline Referenced Images.
This is the first option you should use if you believe there is something wrong with the Aperture library other than image file access issues.
This option should be used as your last measure as it can be time-consuming for large image libraries. If you have tried repairing your database, and the issues you are encountering with your Aperture library still persist, you should use the Rebuild Database option. Aperture examines the library’s entire database and rebuilds each component until it reconstitutes your original Aperture library.
Depending on your selection, click Repair or Rebuild.
Aperture either fixes file permissions within the library or repairs or rebuilds the library, and then opens the application workspace.