Creation of objects like tables and indexes are fairly essential, even if the code has to be authorized or created by the dba. What other areas normally carried out by dbas should the accomplished developer be aware of?
即使代码必须由dba授权或创建,创建表和索引等对象也是必不可少的。如果有成就的开发人员应该知道dbas通常执行的其他哪些领域?
7 个解决方案
#1
8
The ins and outs of database storage and optimization are huge. Knowing how to index and partition tables well is invaluable knowledge.
数据库存储和优化的来龙去脉都是巨大的。知道如何对表进行索引和分区是非常宝贵的知识。
Also, how to read a query execution plan. SQL is such a cool language in that it will tell you exactly how it's going to run your code, so long as you ask nicely. This is absolutely essential in optimizing your code and finding bottlenecks.
另外,如何阅读查询执行计划。 SQL是一种非常酷的语言,只要你很好地提问,它就会告诉你它将如何运行你的代码。这对于优化代码和发现瓶颈至关重要。
Database maintenance (backups, shrinking files, etc) is always important to keep your server running smoothly. It's something that's often overlooked, too.
数据库维护(备份,缩小文件等)对于保持服务器平稳运行始终非常重要。这也是经常被忽视的事情。
Developers should know all about triggers and stored procedures--getting the database to work for you. These things can help automate so many tasks, and often developers overlook them and try to handle it all app side, when they should really be handled by something that thinks in sets.
开发人员应该了解触发器和存储过程的所有内容 - 让数据库为您工作。这些东西可以帮助实现这么多任务的自动化,并且开发人员通常会忽略它们并试图在应用程序端处理它们,而它们应该真正由那些在集合中思考的东西来处理。
Which brings me to the most important point, database developers need to think in sets. To often I hear, "For each row, I want to..." and this is generally an alarm in my head. You should be thinking about how the set interacts and the actions you want to take on entire columns.
这让我想到了最重要的一点,数据库开发人员需要集思考。我经常听到,“对于每一行,我都想......”这通常是我心中的警报。您应该考虑集合如何交互以及您希望对整个列执行的操作。
#2
8
A developer is responsible for doing everything that makes his code a) correct and b) fast.
开发人员负责执行使代码a)正确且b)快速的所有操作。
This of course includes creating indexes and tables.
这当然包括创建索引和表。
Making a DBA
responsible for indexes is a bad idea. What if the code runs slowly? Who is to be blamed: a developer with bad code or a DBA
with a bad index?
让DBA对索引负责是一个坏主意。如果代码运行缓慢怎么办?谁应该受到指责:一个代码不好的开发人员或一个索引不好的DBA?
A DBA
should convey database supporting operations like making backups, building the infrastructure etc, and report the lack of resources.
DBA应该传达数据库支持操作,例如进行备份,构建基础架构等,并报告缺乏资源。
He or she should not be a sole person for making the decicions that affect the performance of the whole database system.
他或她不应该是做出影响整个数据库系统性能的决定的唯一人。
Relational databases, as for now, are not yet in that state that would allow splitting of responsibility so that developers could make the queries right and the DBA
could make them fast. That's a myth.
到目前为止,关系数据库尚未处于允许分离责任的状态,以便开发人员可以使查询正确并且DBA可以使它们变得快速。这是一个神话。
If there is a lack of resources (say, an index makes some query fast at the expence of some DML
operation being slow), this should be reported by a DBA, not fixed.
如果缺少资源(比如,索引在某些DML操作的速度很慢的情况下快速查询某些查询),则应由DBA报告,而不是修复。
Now, it is a decision making time. What do we need more, fast query or a fast insert?
现在,这是一个决策时间。我们需要更多,快速查询或快速插入?
This decision should be made by the program manager (and not the DBA
or developer).
此决定应由程序管理员(而不是DBA或开发人员)做出。
And when the decision is made, the developer should be given the new task: "make the SELECT
query to be as fast as possible, taking in account that you don't have this index". Or "make an INSERT
query to be as fast as possible, taking in account that you will have this index".
当做出决定时,开发人员应该被赋予新的任务:“使SELECT查询尽可能快,考虑到你没有这个索引”。或者“让INSERT查询尽可能快,考虑到你将拥有这个索引”。
A developer should know everything about how a database works, when it works normally.
开发人员应该知道数据库如何工作的一切,当它正常工作时。
A DBA
should know everything about how to make a database to work normally.
DBA应该知道如何使数据库正常工作的一切。
The latter includes ability to make a backup, ability to restore from a backup and ability to detect and report a resource contention.
后者包括进行备份的能力,从备份恢复的能力以及检测和报告资源争用的能力。
#3
2
Optimization. Your code allways should use as little resources as you can achieve.
优化。您的代码总是应该使用尽可能少的资源。
#4
2
I would recommend developing an understanding of the security architecture for the relevant DBMS.
我建议了解相关DBMS的安全体系结构。
Doing so could facilitate your development of secure code.
这样做可以促进您开发安全代码。
With SQL Server specifically in mind for example:
以SQL Server为例,特别考虑到:
- Understand why your “managed code” (such as .NET CLR) should not be granted elevated privileges. What would be the implications of doing so?
- 了解为什么不应授予“托管代码”(例如.NET CLR)提升权限。这样做有什么意义?
- What is Cross-Database ownership chaining? How does it work?
- 什么是跨数据库所有权链接?它是如何工作的?
- Understand execution context.
- 理解执行上下文。
- How does native SQL Server encryption work?
- 本机SQL Server加密如何工作?
- How can you sign a stored procedure? Why would you even want to do this?
- 你怎么签署存储过程?为什么你甚至想要这样做?
- Etc.
- 等等。
As a general rule, the more you understand about the engine you are working with, the more performance you can squeeze from it.
作为一般规则,您对使用的引擎了解得越多,就可以从中获得越多的性能。
#5
1
One thing that currently springs to mind is how to navigate and understand the information that database "system" tables/views gives to you. E.g. in sql server the views that are under the master database. These views hold information such as current logins, lists of tables and partitions etc. which is all useful stuff in trying to track down things such as hung logins or whether users are currently connected etc.
目前浮现在脑海中的一件事是如何导航和理解数据库“系统”表/视图给您的信息。例如。在sql server中,master数据库下的视图。这些视图包含诸如当前登录,表和分区列表等信息,这些信息在尝试跟踪诸如挂起登录或用户当前是否已连接等内容时都是有用的。
#6
1
Relationships of your tables. You should always have a recent printout and soft copy of your database. You need to know the primary keys, foreign keys, required and auto filled columns, without that I think you can't write efficient queries or make sure your database is carrying only what it needs.
你的表的关系。您应始终拥有数据库的最新打印输出和软拷贝。你需要知道主键,外键,必需列表和自动填充列,我认为你不能编写有效的查询或确保你的数据库只带有它需要的东西。
I think everyone else covered it.
我想其他人都会介绍它。
#7
0
Having a good understanding of the architecture of your database system will definitely be helpful. Can you draw a diagram by heart to show components of your DBMS and their interactions?
充分了解数据库系统的体系结构肯定会有所帮助。您能否自己绘制图表以显示DBMS的组件及其交互?
#1
8
The ins and outs of database storage and optimization are huge. Knowing how to index and partition tables well is invaluable knowledge.
数据库存储和优化的来龙去脉都是巨大的。知道如何对表进行索引和分区是非常宝贵的知识。
Also, how to read a query execution plan. SQL is such a cool language in that it will tell you exactly how it's going to run your code, so long as you ask nicely. This is absolutely essential in optimizing your code and finding bottlenecks.
另外,如何阅读查询执行计划。 SQL是一种非常酷的语言,只要你很好地提问,它就会告诉你它将如何运行你的代码。这对于优化代码和发现瓶颈至关重要。
Database maintenance (backups, shrinking files, etc) is always important to keep your server running smoothly. It's something that's often overlooked, too.
数据库维护(备份,缩小文件等)对于保持服务器平稳运行始终非常重要。这也是经常被忽视的事情。
Developers should know all about triggers and stored procedures--getting the database to work for you. These things can help automate so many tasks, and often developers overlook them and try to handle it all app side, when they should really be handled by something that thinks in sets.
开发人员应该了解触发器和存储过程的所有内容 - 让数据库为您工作。这些东西可以帮助实现这么多任务的自动化,并且开发人员通常会忽略它们并试图在应用程序端处理它们,而它们应该真正由那些在集合中思考的东西来处理。
Which brings me to the most important point, database developers need to think in sets. To often I hear, "For each row, I want to..." and this is generally an alarm in my head. You should be thinking about how the set interacts and the actions you want to take on entire columns.
这让我想到了最重要的一点,数据库开发人员需要集思考。我经常听到,“对于每一行,我都想......”这通常是我心中的警报。您应该考虑集合如何交互以及您希望对整个列执行的操作。
#2
8
A developer is responsible for doing everything that makes his code a) correct and b) fast.
开发人员负责执行使代码a)正确且b)快速的所有操作。
This of course includes creating indexes and tables.
这当然包括创建索引和表。
Making a DBA
responsible for indexes is a bad idea. What if the code runs slowly? Who is to be blamed: a developer with bad code or a DBA
with a bad index?
让DBA对索引负责是一个坏主意。如果代码运行缓慢怎么办?谁应该受到指责:一个代码不好的开发人员或一个索引不好的DBA?
A DBA
should convey database supporting operations like making backups, building the infrastructure etc, and report the lack of resources.
DBA应该传达数据库支持操作,例如进行备份,构建基础架构等,并报告缺乏资源。
He or she should not be a sole person for making the decicions that affect the performance of the whole database system.
他或她不应该是做出影响整个数据库系统性能的决定的唯一人。
Relational databases, as for now, are not yet in that state that would allow splitting of responsibility so that developers could make the queries right and the DBA
could make them fast. That's a myth.
到目前为止,关系数据库尚未处于允许分离责任的状态,以便开发人员可以使查询正确并且DBA可以使它们变得快速。这是一个神话。
If there is a lack of resources (say, an index makes some query fast at the expence of some DML
operation being slow), this should be reported by a DBA, not fixed.
如果缺少资源(比如,索引在某些DML操作的速度很慢的情况下快速查询某些查询),则应由DBA报告,而不是修复。
Now, it is a decision making time. What do we need more, fast query or a fast insert?
现在,这是一个决策时间。我们需要更多,快速查询或快速插入?
This decision should be made by the program manager (and not the DBA
or developer).
此决定应由程序管理员(而不是DBA或开发人员)做出。
And when the decision is made, the developer should be given the new task: "make the SELECT
query to be as fast as possible, taking in account that you don't have this index". Or "make an INSERT
query to be as fast as possible, taking in account that you will have this index".
当做出决定时,开发人员应该被赋予新的任务:“使SELECT查询尽可能快,考虑到你没有这个索引”。或者“让INSERT查询尽可能快,考虑到你将拥有这个索引”。
A developer should know everything about how a database works, when it works normally.
开发人员应该知道数据库如何工作的一切,当它正常工作时。
A DBA
should know everything about how to make a database to work normally.
DBA应该知道如何使数据库正常工作的一切。
The latter includes ability to make a backup, ability to restore from a backup and ability to detect and report a resource contention.
后者包括进行备份的能力,从备份恢复的能力以及检测和报告资源争用的能力。
#3
2
Optimization. Your code allways should use as little resources as you can achieve.
优化。您的代码总是应该使用尽可能少的资源。
#4
2
I would recommend developing an understanding of the security architecture for the relevant DBMS.
我建议了解相关DBMS的安全体系结构。
Doing so could facilitate your development of secure code.
这样做可以促进您开发安全代码。
With SQL Server specifically in mind for example:
以SQL Server为例,特别考虑到:
- Understand why your “managed code” (such as .NET CLR) should not be granted elevated privileges. What would be the implications of doing so?
- 了解为什么不应授予“托管代码”(例如.NET CLR)提升权限。这样做有什么意义?
- What is Cross-Database ownership chaining? How does it work?
- 什么是跨数据库所有权链接?它是如何工作的?
- Understand execution context.
- 理解执行上下文。
- How does native SQL Server encryption work?
- 本机SQL Server加密如何工作?
- How can you sign a stored procedure? Why would you even want to do this?
- 你怎么签署存储过程?为什么你甚至想要这样做?
- Etc.
- 等等。
As a general rule, the more you understand about the engine you are working with, the more performance you can squeeze from it.
作为一般规则,您对使用的引擎了解得越多,就可以从中获得越多的性能。
#5
1
One thing that currently springs to mind is how to navigate and understand the information that database "system" tables/views gives to you. E.g. in sql server the views that are under the master database. These views hold information such as current logins, lists of tables and partitions etc. which is all useful stuff in trying to track down things such as hung logins or whether users are currently connected etc.
目前浮现在脑海中的一件事是如何导航和理解数据库“系统”表/视图给您的信息。例如。在sql server中,master数据库下的视图。这些视图包含诸如当前登录,表和分区列表等信息,这些信息在尝试跟踪诸如挂起登录或用户当前是否已连接等内容时都是有用的。
#6
1
Relationships of your tables. You should always have a recent printout and soft copy of your database. You need to know the primary keys, foreign keys, required and auto filled columns, without that I think you can't write efficient queries or make sure your database is carrying only what it needs.
你的表的关系。您应始终拥有数据库的最新打印输出和软拷贝。你需要知道主键,外键,必需列表和自动填充列,我认为你不能编写有效的查询或确保你的数据库只带有它需要的东西。
I think everyone else covered it.
我想其他人都会介绍它。
#7
0
Having a good understanding of the architecture of your database system will definitely be helpful. Can you draw a diagram by heart to show components of your DBMS and their interactions?
充分了解数据库系统的体系结构肯定会有所帮助。您能否自己绘制图表以显示DBMS的组件及其交互?