Dameng 7 's trial compared to SQL Server's simple technology

Source: Internet
Author: User
Tags failover sessions


Dameng 7 's trial compared to SQL Server's simple technology


Dameng Database company launched their database services management platform, you can use the Dream database on the platform without the need to install the Dream 7 database



Address: http://online.dameng.com/



To tell the truth, at first sight still feel very tall on , after all, ORACLE,MYSQL,SQL Server did not launch database trial cloud Platform



In fact, other databases should also learn a dream, make a platform for everyone to have the opportunity to learn the knowledge of their own database, although the current time to download the installation package is relatively easy, but to provide a platform is also beneficial



Dameng Database document Download: Http://files.cnblogs.com/lyhabc/DM%E6%96%87%E6%A1%A3.rar









Trial Experience



The SQL language used by the Dameng database is Dm_sql









Storage hierarchies for Dameng databases





Free friends can take a look at the three documents in the lower right corner of the home page









You can refer to the specific Dm_sql syntax and commands dm_sql.pdf












Trial start



1, we first select an instance, Dameng is this, an instance below can only hang a database, not like SQL Server and MySQL can hang multiple databases



We're going to choose DM1. This instance, Windows, has some instances where someone might be using it so you won't be able to connect, the current number of sessions there shows which instances are in use



And these examples below are some of the people who have built the database on it.






2, after selecting the instance, we can create the database, we open the new query window









Script:


--Build a library
CREATE TABLESPACE BOOKSHOP DATAFILE ‘BOOKSHOP.DBF’ SIZE 150

--Create schemas and tables
CREATE SCHEMA RESOURCES AUTHORIZATION SYSDBA


CREATE TABLE RESOURCES.COMPANYHOLIDAYS
(
   HOLIDAY DATE
) STORAGE (ON BOOKSHOP);

--Insert data
INSERT INTO RESOURCES.COMPANYHOLIDAYS (HOLIDAY)
VALUES (‘2007-7-21’)

INSERT INTO RESOURCES.COMPANYHOLIDAYS (HOLIDAY)
VALUES (‘2008-8-26’)

INSERT INTO RESOURCES.COMPANYHOLIDAYS (HOLIDAY)
VALUES (‘2010-10-2‘)


--Query data
select "HOLIDAY"
from "RESOURCES". "COMPANYHOLIDAYS"; 
View Code


TIPS: If you really do not know how to write the statement, do not worry, the left side of the manager also has the ability to generate scripts, only need to select the table and then right-click, Popup Right-click menu









However, the lower-right corner does not show which instance you are currently connected to which library, not too convenient









View table properties, you can see that the table is a block size that uses 16K






Management interface






The basic functions of this management platform






Platform Editor functions: Automatic grammar completion, automatic format code, keyword Auto-highlighting, debugging, interface management and a complete database management tools almost



The disadvantage is that the lower right corner does not show the current instance and database name in use






Here are some of the features



Once you have created a new database and schema, you can see the new schema in the tree menu on the left.
























You can see that the current dream database is running on the Windows2003 system.



There are more system worker threads in the dream, each with a system worker thread



For example, rapply_worker_thread thread, he is a log redo thread, he is in the standby log redo, and SQL Server is the same, SQL Server image, replication also has the same function of the thread












The management interface is introduced here, continue to speak as if deviate from the main body of this article, we are interested to continue to further study



Technical comparison



When you study a database in depth and then learn another database, you will find that most of the principles are interlinked.



For example, the principle of technical implementation, there are some concepts, just changed the noun yier



For example:



1, SQL Server user-defined functions , in the MySQL and Dameng database called storage functions



2, MySQL inside the event, is SQL Server inside the job (Job)



3. Dynamic Performance View in the database of dreams, called dynamic management view (DMV) in SQL Server



4. Archive log files in the Dream database, transaction log files in SQL Server



5. table Spaces in MySQL and Dameng databases are similar to filegroups in SQL server



Of course, the above concept may not be quite accurate, if there is an error, I hope you correct O (∩_∩) o






Technology to exits



Database backup






Table Space Backup












Backup, I think most of the principle is the same as SQL Server, when the backup, SQL Server will put the activity log together in the Bak file



The goal is to ensure the consistency of the transaction, the same as the Dream database, the online backup when the archive log is written to the backup file



and the Dream database offline backup means: Because the database is offline, no data changes, the current database of transactions are consistent, so this time there is no need to write to the backup file



Tablespace backups are similar to SQL Server file/filegroup backups, only part of the database is backed up, and SQL Server also needs to write transaction logs to the Bak file when backing up filegroups



Ensure transactional consistency



NOTE:SQL Server does not provide offline backup functionality






Technical Comparison II



Database restore











Sqlerver also only supports offline restore at restore time, requiring no connection to the database that is currently being restored, ensuring consistency



In the dream also has a backup chain principle, the internal principle should be the same as SQL Server, detailed reference: "Do you really understand SQL Server's log chain?" 》



In SQL Server also has a similar to the dream database of parallel restore technology, when restoring the database enterprise version of SQL Server is also using multi-threading technology to restore



The following excerpt from the "SQLSERVER2012 implementation and management of practical guidance"


Enterprise version of the Sqlserverr will be optimized for the above situation, mainly in the following two points: 1, multi-threaded parallel processing redo and rollback on the Enterprise Edition, SQL Server enables multi-threaded redo and rollback operations. One of the benefits of this is to shorten the overall recovery time and get the database up and running as soon as possible. If you see a message similar to the following in SQL Server's errorlog, it is a relatively large recovery





Technical comparison Three



Data Guardian



Data protection for databases, whether Oracle or SQL Server or MySQL, has a triple meaning



The first is crash back up, to make sure the data is not lost



The second is that the database tells the application that the transaction has been successfully written, and that the transaction is persisted and can be lost if it is not told the application result;



The third is when the host failed to switch (master-slave switching), how to behave and do not switch when the same situation.






Each database has a different data-guarding technology (data protection technology)



and the data protection technology for each database is very similar.



Data guarding technology of Dameng database



























The dual IP configuration in the connection service name specifies the mirroring partner in a connection string similar to SQL Server, and automatically redirects the program's connection when a failover occurs



To the standby machine



When using image technology inside SQL Server, the C # connection string, partner=mymirrorserveraddress specifies the standby address, when the failure occurs . NET Data Provider



Automatic redirect connection to the standby machine


Database mirroring-database mirroring connection string C #
Data Source = myServerAddress; Failover Partner = myMirrorServerAddress;
Initial Catalog = myDataBase; Integrated Security = True;





The principle of mirror technology in SQL Server, the following excerpt from the "SQLSERVER2012 implementation and management of practical guidance"


the basic concept of database mirroring is pretty much about it. So how does the principal and mirror databases synchronize the data? Any changes to the data in the SQL database are recorded in the transaction log before the data page is actually updated. The transaction log is stored in the log buffer of the database first, and then the log in the buffer is cured to the LDF file on disk. In database mirroring, the principal server, while curing the log from the principal database to the disk, uses another thread to send the log block to the endpoint of the mirror server. When the mirror server receives the log block through the endpoint, he first puts the log block into the log cache of the mirror database and then solidifies the log in the cache to disk. Once the log block is cured , the mirror server performs a redo (redo)on the mirrored database based on the log and eventually updates the data page. When the mirror server redo the log , the mirror database is actually the roll-forward operation in the execution log . If the redo fails, the mirror server pauses the session by turning the database into the suspended state. The DBA must find the cause of the problem and resolve the issue before continuing the session. When the principal server truncates or shrinks the database transaction log, the mirror server also shrinks the log at the same point in the log. As you can see, database mirroring is actually about keeping the synchronization between partners by sending logs. Starting with SQL2008, the log block is compressed before it is sent to the network by the principal server . The purpose of this is to improve the efficiency of log sending and receiving, and to reduce the load on network links and network devices caused by log block transfers. For those unusually busy production systems, this feature not only reduces the abnormal interruption of mirroring sessions due to network overload, but also reduces the performance of database mirroring due to network latency, which can be described as double benefit.


The data daemon technology of Dameng database is actually always on technology and mirroring technology corresponding to SQL Server



SQL Server's always on technology and mirroring technology are highly available technologies, as each database uses its own terminology for some noun concepts.



For example, SQL Server is called high-availability, while MySQL and Oracle are called Usability, in the dream is called Data Guardian, the name is different, actually refers to the same thing



Because of the different names, there are some Oracle experts who think SQL Server does not have the availability of scenarios and products



ORACLE:RAC Cluster, Data guard



MySQL:mysql CLUSTER



SQL Server: Always on, mirroring






There are some architectures that are share-disk, and some architectures are share-nothing , but not in this case.



Interested friends can take a look at Song wrote "a discussion on the technology of database cluster"






Technical comparison Four



Database replication



Database replication is not a data guardian technology, so it does not belong to the data guardian inside









In SQL Server, there is a publication database, a distribution database, a subscription database of



In the dream, the primary server is the publishing library, the replication server is the distribution library, from the server is the subscription library



The replication structure of the Dameng database is almost like SQL Server






Technical comparison Five



The above all said the same point, now say a different point, but because of space constraints, I only say here to dream of the database data page structure is how






Dameng Database page has a different size, there are 4 K, 8K, 16K, 32K, in fact, the Dream Database data page called data block



Like Oracle, it's called a block of data.



Dameng database Set the size of the data block in the configuration file, after restarting the database service, the dream will read the configuration file New configuration information (a bit like MySQL)



Create a block of data based on the configuration file when creating a new table






The length of the data type of the table differs depending on the size of the current data block .









In SQL Server, it is impossible to set the size of the data page, each data page size is 8K



Plays: Count (*) count results rows






Everyone notice the underlined part!!



SQL Server is the same as the DA Dream.


 
 
USE [sss]
CREATE TABLE counttb(id INT NULL)

INSERT INTO [dbo].[counttb]
        ( [id] )
SELECT 1 UNION ALL 
SELECT NULL 

SELECT COUNT(1),COUNT(*),COUNT(id) FROM [dbo].[counttb]








I have also written an article, as to which point of view is right left to everyone to think



Which performance is good in SQL Server, select COUNT (1) and select COUNT (*)? 》



Summarize



Although most principles are the same, there are some discrepancies between the syntax and the database structure.



So it takes a while for a DBA to learn from one database to another



For example, transfer from SQL Server to MySQL or Oracle to SQL Server






This article through the technical comparison, can make everybody to the Dameng database technical content has a degree, although has not actually used, at least understand our country's independent intellectual property right product still is good






In fact, the basic functions of the Dream database are: sequence, full-text indexing, policy, table partitioning ...



All of these features are available, so you can look at the documentation and compare the differences with Oracle, SQL Server, and MySQL



Basically, some of these databases have the ability to dream.



Hope that the national team can become more and more powerful, in the database so that the country can soon get rid of foreign database of the big boys restrictions






If there is a wrong place, welcome everyone to shoot brick O (∩_∩) o


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.