There is some requirement that I need to run the export command in Java via JDBC. Hence below is the command I execute
CALL SYSPROC.ADMIN_CMD('EXPORT TO /tmp/header.csv OF DEL SELECT * FROM MYTABLE');
However, when I ssh login to the database server via db2inst1, I checked the /tmp/header.csv is own by db2fenc1 user, which not allow me to delete but read-only access as shown below:
[db2inst1@26ea60b7e4a1 /]$ ls -lrt /tmp/header.csv -rw-r--r-- 1 db2fenc1 db2fadm1 24335 Nov 12 12:25 /tmp/header.csv
May I know how to execute ADMIN_CMD as db2inst1? Or any other workaround?