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

VMeng
1567714
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.

Examples:

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' FOR 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
23.0k9130270
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

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:

×20

question asked: 06 Mar '12, 20:17

question was seen: 832 times

last updated: 07 Mar '12, 08:12