cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Set ReadOnly property of database to be On

2,613

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.

Accepted Solutions (1)

Accepted Solutions (1)

MarkCulp
Participant

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
0 Kudos

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.

0 Kudos

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

Thanks Mark.

MarkCulp
Participant
0 Kudos

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.

Answers (0)