Standard utilities in MySQL are located in the bin subdirectory of the MySQL root directory. The list of most frequently used utilities includes: myisampack - Compresses MyISAM tables, reduces their size, and makes them read-only; mysql - Console client for accessing the MySQL server, allows executing SQL queries and administering the server; mysqladmin - Utility for performing administrative functions, such as creating or deleting databases, retrieving various information from the server, etc.; mysqlbinlog - Used for reading the contents of the binary log for data recovery in emergency cases; mysqlcheck - Used for describing, checking, optimizing, and recovering tables; mysqldump - Outputs the contents of the MySQL database in the form of an SQL query file or a text file with tabs. Creates a dump of the specified databases; mysqlhotcopy - Utility for creating a backup copy of tables without stopping the MySQL server, in other words, creating a hot copy of the database; mysqlimport - Performs a transfer from a text file to database tables; mysqlshow - Displays information about existing databases, tables, fields, and indexes.
СУБД MySQL имеет различные инструменты для осуществления поиска, среди которых оператор LIKE , осуществляющий простейшие операции поиска, оператор RLIKE , предоставляющий возможности поиска по регулярным выражениям. Оператор LIKE Оператор L…
Get Oracle Version SELECT * FROM V$VERSION
Get catalog folder in Oracle SELECT * FROM V$DIAG_INFO
Example of creating a SEQUENCE in MSSQL: CREATE SEQUENCE [dbo].[CardNum] AS [bigint] START WITH 1 INCREMENT BY 1 MINVALUE -9223372036854775808 MAXVALUE 9223372036854775807 CACHE GO This script will create a SEQUENCE…
Restarting MSSQL Server on Linux (Ubuntu). Microsoft recommends restarting the server as follows: -- Get service status sudo systemctl status mssql-server -- Stop service sudo systemctl stop mssql-server -- Start service...
To get SESSION ID: select @@spid To get TRANSACTION ID: select CURRENT_TRANSACTION_ID()
"OFFSET FETCH" is a filter that allows skipping a certain number of rows in the result set. For example: select field1, field2, field3 from table1 order by field1, field2 offset 100 rows fetch next 50 rows only; This example will return rows from 101 to 150, from all rows sorted by field1 and field2.
Two Ways to Execute Transactions in MSSQL with Rollback on Error. The First Way: BEGIN TRY BEGIN TRAN UPDATE 1 UPDATE 2 --Error UPDATE 3 COMMIT TRAN END TRY BEGIN CATCH ROLLBACK TRAN END CATCH The Second Way: SET XACT_ABORT ON BEGIN TRAN UPDAT…
Example of searching for a procedure by text that it contains SELECT name FROM sys.procedures WHERE Object_definition(object_id) LIKE '%some_text%' This script will return the names of all procedures that contain the text: "some_text"