Hello,

After having gotten SQL Anywhere v17 under Ubuntu 16.0.4 running in a VM on my LAN I am now trying to replicate this in an AWS based host. I have two problems/questions:

1) After uploading a database and its log file to the AWS host it appears that I have a file permissions issue. These two files on my local Ubuntu system have permissions of -r--r--r-- when the server is not running and -rw-rw-r-- when the server is running . However, if I set these same permissions in the AWS Ubuntu host I get the error: Could not open/read file: <pathtodatabase>/<dbname>.db

I am launching the server with: "dbsrv17 -n MyServer -x "tcpip(PORT=<nnnnn>;DOBROAD=no)" -su <utilitydbpw> "/<pathtodatabase>/<dbname>.db" -xp on"

However, if I issue: sudo chmod 777 '/<pathtodatabase>/<dbname>.db' and restart the server I see: Error: Cannot open transaction log file -- Permission denied

Finally, if I do the following on the log file: sudo chmod 777 '/<pathtodatabase>/<dbname>.log' and restart the server we run! Upon exiting the server, the permissions for both are left at: -rwxrwxrwx

Can you explain: a) Why do I have to set the permissions on both the .db and the .log to 777 (-rwxrwxrwx) to get the server running when this was not the case in my local Ubuntu host? b) Why, on my local Ubuntu host, the permissions on these two files, when the server is not running, are -r--r--r--?

2) If I set the permissions on both files to 777 so I can get the server to run I cannot get the Console and Error logs that I am able to get on my local Ubuntu host. If I launch the server with: "dbsrv17 -n MyServer -x "tcpip(PORT=<nnnnn>;DOBROAD=no)" -su <utilitydbpw> "/<pathtodatabase>/<dbname>.db" -xp on" -o "/<pathtologs>/Console_Log.txt" -oe "/<pathtologs>/Errors_Log.txt"

I get the error: Can't open Message window log file: /<pathtologs>/Console_Log.txt

However, if I drop out the request for the Console log and just ask for an Error log with: "dbsrv17 -n MyServer -x "tcpip(PORT=<nnnnn>;DOBROAD=no)" -su <utilitydbpw> "/<pathtodatabase>/<dbname>.db" -xp on" -oe "/<pathtologs>/Errors_Log.txt"

the server starts with no error (and no Error Log is created which I believe, if there is no error, is corrrect).

The permissions on the Logs folder on my local Ubuntu host (where I am getting a Log file) are: drwxrwxr-x and that matches the permissions on the Logs folder in my AWS Ubuntu host.

Note that this happens after a reboot with no other server running so I can't see that there could be any other process "locking the Console log file" which, at this point doesn't yet exist!

So, again I wonder if this is a permissions problem, perhaps on the Log folder.

Can you explain a) What must the permissions be on the Logs directory? b) Why can't I get a Console log?

Thank you for your help.

asked 26 Jun, 14:16

AlK's gravatar image

AlK
46521737
accept rate: 50%

3

You have a lot of questions... but before answering them I have some for you: What is the owner and group of the directory where the database & log reside - i.e. <pathtodatabase>? What is the owner and group of the <pathtologs> directory? And what is the name of the user that you are logged in as? Is it the same as the owner of the above directories? Compare these answers to your Ubuntu host and the AWS host.

(26 Jun, 15:06) Mark Culp

Hi Mark,

Duh, just reading your questions made me go check and I somehow missed a step to swap to the User I want to use to run the server before I created the directory structure. As a result the "server User" didn't have rights to the directories. I was apparently able to "overcome" that for getting the server to access the database and log but it was blocking creation of the Console log (strange). In any case, I recreated the directories and all is will now! Thanks for your prompt response!

permanent link

answered 26 Jun, 19:30

AlK's gravatar image

AlK
46521737
accept rate: 50%

converted 26 Jun, 19:31

Great. That was precisely what I thought the issue was going to be. Glad you figured it out!

(27 Jun, 08:37) Mark Culp

Just to make the answer complete, the database server will change the permissions on the database files when it shuts down the database so that there is only read access to the files, thus you will see permissions of -r--r--r--. The reason to do this is to try to remove the possibility of accidental writing or modifying the files. When the database is started, the server will acquire exclusive rights to the files (on Windows at least) and change the permissions to give the server write access, thus you will see -rw-rw-rw (or some other variant).

HTH

permanent link

answered 27 Jun, 08:37

Mark%20Culp's gravatar image

Mark Culp
23.4k9132275
accept rate: 40%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×34
×23

question asked: 26 Jun, 14:16

question was seen: 167 times

last updated: 27 Jun, 08:37