0

I'm trying to check all counts for all tables in IBM DB2 using Red Hat Linux. When I try to run this DB2 SQL Script

db2 "SELECT 'SELECT COUNT(*) AS ROW_COUNT FROM '|| tabschema || '.' || tabname || ';' FROM sysibmadm.admintabinfo WHERE tabschema not like 'SYS%' order by tabschema, tabname asc" > script 

Linux will return

bash: script: Permission denied 
2
  • Does there exist a file named script already? If so, do you own it (see ls -l) Commented Mar 9, 2021 at 3:08
  • Do you have write permissions to the directory where you are running the command, as that is where the script file will be created? Commented Mar 9, 2021 at 8:09

1 Answer 1

3

You are trying to execute the command in a directory in which you do not have write permission. This means that the file script can not be created or written to.

You can try to run the command replacing the last part, > script, with > ~/script, which will write the output to a file in your home directory, where you are more likely to have write permissions.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.