How to rename the database in Sybase

Follow the below steps to rename the sybase database

Step1 : Put the database in single user mode

Step2 : Rename the database

Step3 : Remove the single user mode .

sp_dboption 

it is used to place the work database in single-user mode before renaming it and restore it to multi-user mode afterward

>sp_dboption SEC, single, true

>go

>use SEC

>go

>checkpoint

>go

sp_renamedb changes the name of a database. You cannot rename system databases or databases with external referential integrity constraints.

>sp_renamedb SEC, SEC1

>go

>use master

>go

>sp_dboption SEC1, single, false

>go

>use SEC1

>go

>checkpoint

>go


No comments:

Post a Comment

Useful websites

https://www.yumpu.com/en/document/read/4306765/sybase-ase-15-best-practices-query-processing-optimization https://www.yumpu.com/en/document/...