The forum will be unavailable for maintenance at some point from Friday, April 13 at 19:00 EDT until Sunday, April 15 at 23:59 EDT. Downtime will be minimized but the exact timing is unknown.

How do I set the ReadOnly property of a databast to On?

I can only see ways to read the ReadOnly property.

Thanks in advance.

asked 06 Mar '12, 20:17

VMeng's gravatar image

accept rate: 0%

You can start a database as readonly on the server command line by using the -r server switch or -r database switch, or using the FOR READ ONLY clause on the START DATABASE statement.


dbsrv12 -r foo.db bar.db
-- start both foo.db and bar.db databases as read only

dbsrv12 foo.db bar.db -r
-- start database foo.db normally (read/write) and bar.db as read only

-- start database foo.db as read only using a SQL statement
permanent link

answered 06 Mar '12, 20:53

Mark%20Culp's gravatar image

Mark Culp
accept rate: 40%

Thanks Mark.

Once I typed your command in command window, how do I connect to the db from Sybase Central? On Sybase Central Connect dialog, for Action, I chose "Connect to a running database on this computer", but I do not know Server name.

Sorry, I am new to SQL Anywhere.

(06 Mar '12, 21:28) VMeng
Replies hidden

I just found the answer to my previous question: leave the server name blank, just specify the db name is enough.

Thanks Mark.

(06 Mar '12, 21:35) VMeng

For the record, if a server name is not specified then the server uses the name of the first database specified on the command line as the name for the server.

(07 Mar '12, 08:12) Mark Culp
Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 06 Mar '12, 20:17

question was seen: 1,019 times

last updated: 07 Mar '12, 08:12