DB2 can't recognize windows network drives that are configured in the server, but it can recognize UNC paths (i.e. \\Server1\sharedfolder) to shared resources.
Here are the 2 requirements to allow DB2 to access this shared folders as targets for Database Backups:
- Configure the DB2 Service (services.msc) to run using a specific user. This user MUST be included in the local Administrators group.
If you configure "Local System User" as the user to run the service, you will not be able to access shared folders.
- Add this user to the ACL of the shared folder in the server. This must be done in the computer that hosts the shared folder and not on the DB2 server.
Notice that this should be done in the "Permissions..." button in the same tab where you mark a folder as Shared.
Some common errors that you will are:
- SQL2036N - path or device invalid: This error will happen if you have not set a specific user to run the service (using Local System Admin) or the user you selected does not have read access on the shared folder. Since DB2 doesn't recognize Network drives, this error will also appear if you are targeting the database file into one.
- SQL2061N - An attempt to access media media is denied: This error will happen if the user has read access but not write access on the shared folder.
This two steps should resolve any problem you have accessing Shared folders as backup targets. As described, any error on this is related to user privileges for the user that runs the DB service.