In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you how to use SOAR, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Download and install
SOAR is written in GE language and naturally has the cross-platform attribute of the operating system. You can download the compiled binaries directly according to the corresponding operating system in the version of Release on Github. If you are an experienced custom user, you can also refer to "read the original text" at the bottom left to download the code and compile and install it as shown in the figure below.
Binary installation
Source code installation
User's guide
Get started quickly
After installation, there is no need to make any configuration, just execute the following command, you can immediately generate a SQL review report in Markdown format and modify the SQL according to the recommendations in the report.
Use configuration
SOAR provides a wealth of configuration parameters, and you can customize private review recommendations by specifying different configuration items according to different usage scenarios. However, you don't have to worry about these configurations. Most of the configuration options are for users with special needs, and you can experience the basic features of SOAR even without any configuration.
The configuration file of SOAR is in YAML [1] format. In general, you only need to configure a few parameters such as online-dsn, test-dsn, log-output and so on, and you can experience most of the functions provided by SOAR.
Next I'll introduce some of the basic configurations commonly used in SOAR.
Configure the environment
Since many functions require database metadata to assist in judgment, many features will adopt a degraded strategy when the database environment is not specified, so we strongly recommend that you specify the relevant database environment in the configuration file. In order to protect the online database, we divide the database environment into online and test environments, but this does not mean that you need two database environments, but at least it is recommended that you specify one test environment.
It should be noted here that because we will do some relatively high-risk operations in the test environment, in order to prevent users from damaging online data due to configuration carelessness, we have added allow-online-as-test parameters to ensure that you really want to use the online environment as a test environment. So when the two integration environments you specify are the same, specify allow-online-as-test as true, otherwise SOAR will not be reviewed.
Output format
SOAR itself supports a very rich output format, in addition to the default Markdown format, SOAR also supports output in HTML or JSON format.
Some of the tools that come with SOAR are also available in the form of report-type. For example, there are 15 output formats, such as SQL rewriting, EXPLAIN analysis, SQL fingerprinting, SQL beautification and so on. Each report-type has different functions. You can view the output types supported by SOAR with the following command.
Get help
In addition to the features mentioned above, SOAR provides many other configuration items, which can be found in the SOAR project documentation for details due to space constraints. If you have any questions in use, you can submit the Issue here [2] or contact us in Gitter [3].
Scene introduction
Scene online environment test environment application type scenario 1 has daily optimization, complete recommendations, recommended scenario 2, no new application resources, environment initialization test scenario 3, no blind test, trial, no EXPLAN and index suggestion scenario 4 useless online environment as test environment, scenario 1 is not recommended
This scenario is the most common scenario in our daily work, and it is mainly applied to online services to create tables or table structure tables on a daily basis.
When SOAR analyzes the SQL, it first obtains the basic information from the SQL statement, and then obtains all the database table structure metadata from the online environment, and synchronizes it to the test environment for further analysis. In this scenario, SOAR can provide the most comprehensive functional support. It can not only output more than 110 SQL checks, but also index and analyze the database tables involved, but also output EXPLAIN, PROFILE and other information to assist DBA or developers in performance tuning and problem location. SQL rewriting also relies on metadata support, and the functionality in this scenario is the most comprehensive.
Scene two
This scenario applies to the first application for database resources, when there is no online environment that already exists.
In this scenario, the SQL file mainly contains database-building table statements. SOAR will generate the corresponding test environment according to DDL, and obtain metadata from the environment for optimization analysis.
Scene 3
In this scenario, because there is no configuration of online environment and test environment dependence, there is a lack of necessary metadata for analysis, and information such as EXPLAIN cannot be obtained. In this case, SOAR will be degraded, giving only some suggestions that can be given without relying on the database environment (most of the heuristic suggestions and a small part of SQL rewriting).
Although the service is not fully functional in this scenario, it is also the fastest to execute, and this scenario still provides more than 110 heuristic suggestions, especially suitable for the detection of SQL itself, such as as a localized SQL Linter IDE plug-in.
Scene 4
This scenario is actually the same as scenario 2, in which only the online environment is configured and allows the online environment to be used as the test environment. Then SOAR will point the test environment to the online environment without specifying the test environment.
When SOAR conducts a review, in order to ensure that multiple clients can conduct reviews in one environment at the same time, a temporary database is generated in the test environment, and the temporary database is deleted after the review ends normally. Therefore, we do not recommend using the online database environment as a test environment to prevent serious impact on the database under some unknown extreme conditions.
The above is all the contents of this article "how to use SOAR". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.