以下的文章主要是介绍SQL Server数据库与其实际应用元数据,我前两天在相关网站看见SQL Server数据库与其实际应用元数据的资料,觉得挺好,就拿出来供大家分享,希望会给大家带来一些帮助在此方面。 以下的文章主要是介绍SQL Server数据库与其实际应用元数据
以下的文章主要是介绍SQL Server数据库与其实际应用元数据,我前两天在相关网站看见SQL Server数据库与其实际应用元数据的资料,觉得挺好,就拿出来供大家分享,希望会给大家带来一些帮助在此方面。
以下的文章主要是介绍SQL Server数据库与其实际应用元数据,我前两天在相关网站看见SQL Server数据库与其实际应用元数据的资料,觉得挺好,就拿出来供大家分享,希望会给大家带来一些帮助在此方面。
我常被问到如何把驻留在物理服务器/SQL 实例上的SQL Server数据库转变为它们相应的应用程序名称。在准备计划好的服务器停机通知时,这种需要就产生了,,但在我的组织内与IT经理或非技术人员沟通时,这也是有价值的。如果你不是数据
我常被问到如何把驻留在物理服务器/SQL 实例上的数据库转变为它们相应的应用程序名称。在准备计划好的服务器停机通知时,这种需要就产生了,但在我的组织内与IT经理或非技术人员沟通时,这也是有价值的。
如果你不是数据库管理员或特定数据库的应用分析师,你通常会无视数据库的命名规则,而这些数据库支持着你每日依赖的应用程序。这就是为什么当需要产生时在适当的位置上由元数据库来提供转化很重要。
专家解答
大部分数据库管理员拥有某种形式的数据库元SQL Server数据库,他们依赖其来跟踪范围很广的Microsoft SQL Server环境。我利用连接的服务器和分布式数据库访问来建立一个已经在我的环境中使用了七年的元数据库。它不是漂亮的,但它是功能性很强的。
跟很多IT开发者和数据库管理员一样,即使它有自身的不足我还是为自己的创造感到骄傲。它很慢,不像它可以的那样最新型,也不像它应该的那样安全。
自从读了2007年5月和6月Rodney Landrum在SQL Server杂志上发表的关于SQL Server集成服务(SSIS)和数据库管理员知识库(DBA Repositories)的文章,我知道是时候采取别人的解决方法了。这对于我的环境来说是完美的,而一些改动也是容易采纳的。
2008年2月,一篇后续文章在SQL Server杂志上发表,在这篇文章里,Rodney更新了他的解决方法。我下载了代码,在我的测试环境里审核,并迅速把它纳入产品中。当大家普遍地为这个解决方法所提供的而感到高兴时,在它包中缺少的一方面是把数据库关联到应用程序的能力。
通过在他的解决方法中增加两张额外的表,我可以在我的“土生土长”元数据库中增加应用程序元数据到我现在使用的SQL Server杂志的方法中。
增加到我数据库中的应用元数据包括创建两张表:dbo.Applications,专为存储所有程序的应用名称,而这些程序在我的环境中依赖于SQL Server数据库,还有
dbo.Database_Applications,它保存SQL 实例、SQL Server数据库和应用程序之间的关系。
Applications Table CREATE TABLE [dbo].[Applications] (
[AppID] [int] IDENTITY(154,1) NOT NULL,
[ApplicationName] [varchar](100) NOT NULL, )
Database_Applications Table
CREATE TABLE [dbo].[Database_Applications] (
[DB_AppID] [int] IDENTITY(1,1) NOT NULL,
[ServerName] [varchar](50) NOT NULL,
[DatabaseName] [varchar](100) NOT NULL,
[ApplicationName] [varchar](100) NULL )
你可能注意到,我没有规范化dbo.Database_Applications表。如果我规范化,我会只存储两个区域:一个与存储我的应用元数据的表有关的外键,和一个与我的元数据库相对应的外键。我有自己的原因:
我没有处理大量的数据:我有大概800个数据库,这些SQL Server数据库在我的环境里发布80个实例。虽然这对于一个数据库管理员来说是个很大的环境,但是它既不转变成在我的元数据表里的大量纪录,也不转变成数据库的巨大字节。
不是通过dbo.Applications表的主键,而是包含表中的应用程序名,我可以通过只访问dbo.Database_Applications表产生我的主要应用程序元数据报告(key Application Metadata report)。
我的环境中的SQL元数据库使用“焦土政策”人口处理方法,除了SQL Agent Job History和Backup History,其他的表都被每天删除和重新载入。我发现在
dbo.Database_Applications表中保存信息可以使我的生活变得很容易。
每日从我的环境中载入数据后,我可以通过以下脚本得到在我的环境中产生的任何新的数据库的良好的陈述。
SELECT D.[Server], D.DatabaseName FROM dbo.Databases D LEFT JOIN dbo.Database_Applications DA ON D.DatabaseName = DA.DatabaseName AND D.[Server] = DA.[ServerName] WHERE DA.DB_AppID IS NULL ORDER BY D.[Server], D.DatabaseName
这个查询的结果提供任何数据库的清单,这些SQL Server数据库产生于上次我更新应用元数据和服务器时,它不仅是跨域的数据库创建活动的通知,也是致力于更新两个数据库来符合应用程序信息的数据清单。这个查询也适合SQL Server Reporting Services报告的数据表,而当我不在办公室时,SQL Server Reporting Services报告也为我提供了一个新的数据库到我的黑莓(BlackBerry)的日常通知。
最后,我创建了以下存储程序,由此用任何新的数据库信息来合并dbo.Applications表和dbo.Database_Applications 表。它接受三个参数:服务器,数据库和应用程序。如果应用程序已经不存在于dbo.Applications表中,它就会被补充。然后一个记录被插入到服务器/数据库/应用程序关系中的dbo.Applications表。
CREATE PROCEDURE [dbo].[pAdd_Application]
@ServerName varchar(50),
@DatabaseName varchar(100),
@ApplicationName varchar(100)
AS --Add any new databases created,
but not recorded in the repository, to the repository
UPDATE dbo.Database_Applications
SET ApplicationName = @ApplicationName
WHERE ServerName = @ServerName
AND DatabaseName = @DatabaseName
AND ApplicationName IS NULL
--Determine if there is already an application
for this database in the repository, if not, then add it
IF (SELECT COUNT(*) FROM dbo.Applications
WHERE ApplicationName = @ApplicationName) = 0
BEGIN INSERT INTO dbo.Applications (ApplicationName)
VALUES (@ApplicationName)
PRINT 'Added new Application: '
+ @ApplicationName + ' to Applications table'
SELECT * FROM dbo.Applications
WHERE ApplicationName = @ApplicationName
END --List the new record in the repository
SELECT ServerName, DatabaseName, ApplicationName
FROM dbo.Database_Applications
WHERE ServerName = @ServerName
AND DatabaseName = @DatabaseName
AND ApplicationName = @ApplicationName

MySQL index cardinality has a significant impact on query performance: 1. High cardinality index can more effectively narrow the data range and improve query efficiency; 2. Low cardinality index may lead to full table scanning and reduce query performance; 3. In joint index, high cardinality sequences should be placed in front to optimize query.

The MySQL learning path includes basic knowledge, core concepts, usage examples, and optimization techniques. 1) Understand basic concepts such as tables, rows, columns, and SQL queries. 2) Learn the definition, working principles and advantages of MySQL. 3) Master basic CRUD operations and advanced usage, such as indexes and stored procedures. 4) Familiar with common error debugging and performance optimization suggestions, such as rational use of indexes and optimization queries. Through these steps, you will have a full grasp of the use and optimization of MySQL.

MySQL's real-world applications include basic database design and complex query optimization. 1) Basic usage: used to store and manage user data, such as inserting, querying, updating and deleting user information. 2) Advanced usage: Handle complex business logic, such as order and inventory management of e-commerce platforms. 3) Performance optimization: Improve performance by rationally using indexes, partition tables and query caches.

SQL commands in MySQL can be divided into categories such as DDL, DML, DQL, DCL, etc., and are used to create, modify, delete databases and tables, insert, update, delete data, and perform complex query operations. 1. Basic usage includes CREATETABLE creation table, INSERTINTO insert data, and SELECT query data. 2. Advanced usage involves JOIN for table joins, subqueries and GROUPBY for data aggregation. 3. Common errors such as syntax errors, data type mismatch and permission problems can be debugged through syntax checking, data type conversion and permission management. 4. Performance optimization suggestions include using indexes, avoiding full table scanning, optimizing JOIN operations and using transactions to ensure data consistency.

InnoDB achieves atomicity through undolog, consistency and isolation through locking mechanism and MVCC, and persistence through redolog. 1) Atomicity: Use undolog to record the original data to ensure that the transaction can be rolled back. 2) Consistency: Ensure the data consistency through row-level locking and MVCC. 3) Isolation: Supports multiple isolation levels, and REPEATABLEREAD is used by default. 4) Persistence: Use redolog to record modifications to ensure that data is saved for a long time.

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

MySQL is suitable for small and large enterprises. 1) Small businesses can use MySQL for basic data management, such as storing customer information. 2) Large enterprises can use MySQL to process massive data and complex business logic to optimize query performance and transaction processing.

InnoDB effectively prevents phantom reading through Next-KeyLocking mechanism. 1) Next-KeyLocking combines row lock and gap lock to lock records and their gaps to prevent new records from being inserted. 2) In practical applications, by optimizing query and adjusting isolation levels, lock competition can be reduced and concurrency performance can be improved.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment