Message: Cannot access file ... Permission denied SQLCODE=-602
Message: -602 Cannot access file ... Permission denied SQLCODE=-602 Message: OFSS Cannot access file ... Permission denied SQLCODE=-602 Message: Permission denied Cannot access file ... SQLCODE=-602 Message: SQLCODE=-602 Cannot access file ... Permission denied Message: UNC Cannot access file ... Permission denied SQLCODE=-602
Explanation:
If a CALL start_OFSS_monitor() statement fails with "Cannot access file ... Permission denied SQLCODE=-602", and
- you are using UNC file specification like SET unload_path = '\\\\Xps\\c\\DATA\\OFSSremote\\'
- with an OFSS subject database being run as a Windows service,
- try using the dbsvc -a and -p options to create the service to run under the account name and password for a Microsoft Windows account you have created
- instead of using dbsvc -as to run under the Windows LocalSystem account.
For example, if you created the OFSS subject database service with dbsvc -as, you might see the following
exception that is raised by an UNLOAD TABLE statement inside the OFSS script:
-- Subject database ISQL session
PARAMETERS OWNER;
UPDATE "{OWNER}".OFSS_settings SET unload_path = '\\\\Xps\\c\\DATA\\OFSSremote\\';
UPDATE "{OWNER}".OFSS_settings SET max_batch_duration = '7m';
UPDATE "{OWNER}".OFSS_settings SET encryption_key = 'KeHX8?k1Rqz/5FvOu{nhx1#mQxy0@95e'; -- the values must agree
UPDATE "{OWNER}".OFSS_settings SET max_batch_size = '1M';
UPDATE "{OWNER}".OFSS_settings SET server_messages_are_to_be_captured = 'Y';
CALL "{OWNER}".start_OFSS_monitor();
Could not execute statement.
Cannot access file
'\\Xps\c\DATA\OFSSremote\OFSS-ddd-batch------2-uuid-3728852...' --
Permission denied
SQLCODE=-602, ODBC 3 State="HY000"
C:\ProgramData\RisingRoad\Foxhound5\scripts\OFSS_1_setup.sql:7
CALL "dba".start_OFSS_monitor()
-- OFSS diagnostic table on the subject database
SELECT * FROM OFSS_exception;
exception_id,inserted_at,diagnostic_text
1,2019-07-29 16:35:00.924,OFSS-b2e(OFSSehb2) SQLCODE = -602, SQLSTATE = WL002,
ERRORMSG() = Cannot access file '\\\\Xps\\c\\DATA\\OFSSremote\\OFSS-arbiter-batch------2-uuid-dfa...' -- Permission denied
Here's a template for using the dbsvc -a and -p options to set up a High Availability partner database as a service:
"%SQLANY17%\Bin64\dbsvc.exe"^
-a youraccount^
-o "xxx\dbsvc_partner1_log.txt"^
-p yourpassword^
-s Automatic^
-sd "SQL Anywhere 17 Partner1 Server"^
-sn nnnnnnnn^
-t Network^
-y^
-w nnnnnnnn^
"%SQLANY17%\bin64\dbsrv17.exe"^
-dt "ttt"^
-n nnnnnnnn^
-o "yyy\dbsrv17_partner1_log.txt"^
-oe "yyy\dbsrv17_partner1_startup_log.txt"^
-su sqlsql^
-x tcpip(port=99999;dobroadcast=no)^
-zp^
-zl^
-zt^
"zzz\ddd.db"^
-xp on
|