I'am using TDengine as a time-series storage engine. How could I change the replication of a vgroup from 2 to 3? During the change, should I do or not to do something?
try following commands in taos shell
alter database db replica 3
Change it will sql statement:
alter database dbname replica 3.
Here's the full list you can use with alter for a database:
keep: days to keep data in the database
cache/blocks: the memory cache for vnode: cache*blocks
wal
fsync
replica
cachelast
quorum
See more details in docs for Database Management
Related
There are many queries of restoring database in SQL Server - below are two:
Query #1
restore database database_name
from disk = 'databaselocation+name'
Query #2
use master
restore database database_name
from disk = 'location'
What is the difference between simple restoration and master restoration?
There is no difference between these two queries. However, management queries are created using the master database by default when created by the SSMS. It is better you also do this as these queries may change some information inside the master database.
We have transaction replication between two server (production and staging) which is running on SQL Server 2008 R2. The distributor is running on the staging server. Now my management is asking to create a copy of database on the production environment and replication few tables to that database. Is it possible to replicate twice? Could you please help me on this. If not possible through replication, is there any other way to do it?
You sure can. Create another publication, add the subset of tables to that, and subscribe the other database to the new publication. NB, this will create another copy of changes for this table at the distributor so take that into account.
I'm refering to when we say USE dbTest we start using that database and we can create tables and what not, and if we want to change databases we could just say USE dbNotatest and it would change the database we're using.
But is there a way to stop using the database we selected in the first place, without starting to use another one?
To stop using a database, you will need to change your database context. For example, if you are trying to drop your database and you are in the context of that database, simply switch to another database (commonly master or tempdb).
If other connections are open to the database and preventing you from dropping the database, you will need to kill the connected spids. This can be tedious, so an option to force close all connections and then drop your database that usually works for me is:
use [master];
ALTER DATABASE [foo] SET OFFLINE WITH ROLLBACK IMMEDIATE;
ALTER DATABASE [foo] SET ONLINE;
DROP DATABASE [foo];
By taking the database offline with rollback immediate, I force all connections closed and rollback any open transactions. Now, I could drop it while it is offline, but if I do the database files will remain on the file system. Dropping a database online will remove the database files, so I bring it back online before I drop it.
There is no option in SQL Server.
you can use only use query to manipulate other databasees otherwise you don have any options.
you can detach it just by using another database . for example in Microsoft sql sever management you can use the test database that already exists
Is it possible to log shipping for few tables only in SQL Server 2012?
Thanks
SImple answer: NO. THere is no per table log. THere is ONE log per database. SImple like that.
You want partial table stuff - only chance is replication.
You can manually configure this using FileGroups (ie. put tables into a different FILEGROUP), and manually manage the restore process.
Initially only restoring the tables you require
Lookup Partial Restore.
This is a currently working.
I'm new to SQL Server replication options.
I want to set up a system such that a backup database at a remote location is used for data analysis over some large set of data in the primary database. The analysis does not need to have access to live data, and I want to run this analysis daily.
I don't have access to transaction logging on the primary SQL Server 2008 database.
What is the best way to synchronize a primary database to a secondary one in SQL Server without using transaction logging?
Is there maybe another option I'm not seeing?
Thanks,
You could do one of the following:
Some sort of automated backup, copy and restore.
Use a SSIS job to transfer the data from one to the other.
Use a linked SQL Server, and copy/update as appropriate.
The best solution though, is to use log shipping, scheduled once a day, if you can sort out your access to the primary database.