Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 50 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
50
Dung lượng
1,27 MB
Nội dung
CHAPTER 9 • USING SQLSERVER ENTERPRISE MANAGER
320
• New maintenance plan
• Maintenance plan history
• Backup database
• Restore database
• Truncate log
• Shrink database
• Modify data file sizes
• Modify log file sizes
The Table Info page of the taskpad lists all of the tables and indexes within the
database. For each table, this page also shows the number of rows of data that the
table currently contains. A bar graph shows you the amount of space occupied by
each table and index.
The Wizards page of the taskpad offers another way to invoke any of the SQL
Server Wizards.
From any database node, you can perform common database tasks by using the
shortcut menu. These include:
• Create a new database
• Create new database objects
• Delete an existing database
• Import data
• Export data
• Create maintenance plan
• Generate SQL scripts
• Back up database
• Restore database
• Shrink database
• Detach database
• Copy subscription database
• View replication conflicts
2627ch09.qxt 9/6/00 11:22 AM Page 320
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
321
NOTE You’ll learn more about databases in Chapter 10.
Diagrams
When you click a Diagrams node, the right pane of SQLServer Enterprise Manager
shows all of the database diagrams that have been created for the database. A single
database might have no database diagrams, a single database diagram, or multiple data-
base diagrams representing its structure. Double-clicking a database diagram will open it
in the database diagram designer.
From the Diagrams node, you can create and delete database diagrams. You can
create new database diagrams with the node’s shortcut menu, and you can delete
database diagrams with the individual diagram’s shortcut menu. This is typical of
how all the objects in Enterprise Manager work.
NOTE You’ll learn more about database diagrams in Chapter 11.
Tables
When you click a Tables node, the right pane of SQLServer Enterprise Manager shows
all of the tables in the current database, as you can see Figure 9.11. For each table,
SQL Server Enterprise Manager lists the table name, the owner name, the type of table
(System or User), and the date on which the table was created.
THE SQLSERVER ENTERPRISE MANAGER TREE
Digging into SQL
Server
PART
III
2627ch09.qxt 9/6/00 11:22 AM Page 321
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
CHAPTER 9 • USING SQLSERVER ENTERPRISE MANAGER
322
FIGURE 9.11
Listing of tables in SQL
Server Enterprise
Manager
From the Tables node, you can create and delete tables, as well as import and
export data.
Double-clicking a table opens the property sheet for that table. By right-clicking a
table, you can perform other table operations:
• Design table
• Rename table
• Delete table
• Copy table
• Open table (all rows or top n rows)
• Open query based on the table
2627ch09.qxt 9/6/00 11:22 AM Page 322
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
323
• Add a full-text index to the table
• Manage indexes
• Manage triggers
• Manage permissions
• Import data
• Export data
• Create a publication (for replication)
• Generate SQL scripts
• Display dependencies
The Dependencies dialog box is especially useful if you’re considering modifying
an object. This dialog box (shown in Figure 9.12) tells you which objects the selected
table depends on and which objects depend on the selected table. Both direct and
indirect dependencies are shown. For example, in Figure 9.12, the CustOrderHist
stored procedure has a sequence of 2, indicating that it depends on another object
that depends directly on the Orders table. Checking the Show First Level Dependency
Only box will limit the display to objects that have a sequence of 1.
FIGURE 9.12
The Dependencies
dialog box
THE SQLSERVER ENTERPRISE MANAGER TREE
Digging into SQL
Server
PART
III
2627ch09.qxt 9/6/00 11:22 AM Page 323
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
CHAPTER 9 • USING SQLSERVER ENTERPRISE MANAGER
324
NOTE You’ll learn more about tables in Chapter 11.
Views
If you select a Views node in SQLServer Enterprise Manager, the right-hand pane will
display a list of all the views in the current database, along with their owner, type,
and creation date. Figure 9.13 shows this list for a typical database.
FIGURE 9.13
Views in SQL Server
Enterprise Manager
From the Views node, you can create new views and delete existing views. You can
also choose to hide some of the columns that are normally shown for each view.
The shortcut menu for individual views lets you perform basic operations:
• Design view
• Open view (all rows or top n rows)
• Open query based on the view
• Delete view
• Copy view
• Rename view
2627ch09.qxt 9/6/00 11:22 AM Page 324
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
325
• Manage triggers
• Manage permissions
• Generate SQL scripts
• Display dependencies
Double-clicking a view will open the property sheet for the view. On the property
sheet, you can modify the permissions for the view, check the syntax of the view, or
even change the SQL statement that creates the view. Figure 9.14 shows the property
sheet for a view.
FIGURE 9.14
Property sheet for
a view
NOTE You’ll learn more about views in Chapter 13.
Stored Procedures
As you’d expect by now, if you select a Stored Procedures node in SQLServer Enter-
prise Manager, the right-hand pane will display a list of all the stored procedures in
the current database, along with their owner, type, and creation date. Figure 9.15
shows this list for a typical database.
THE SQLSERVER ENTERPRISE MANAGER TREE
Digging into SQL
Server
PART
III
2627ch09.qxt 9/6/00 11:22 AM Page 325
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
CHAPTER 9 • USING SQLSERVER ENTERPRISE MANAGER
326
FIGURE 9.15
Stored procedures in
SQL Server Enterprise
Manager
From the Stored Procedures node, you can create new stored procedures and delete
existing stored procedures. You can also choose to hide some of the columns that are
normally shown for each stored procedure.
The shortcut menu for individual stored procedures lets you perform basic operations:
• Copy stored procedure
• Delete stored procedure
• Rename stored procedure
• Manage permissions
• Create new publication
• Generate SQL scripts
• Display dependencies
Double-clicking a stored procedure will open the property sheet for that stored pro-
cedure, which includes the SQL statements that make up the stored procedure, as well
as the ability to edit permissions and check syntax.
2627ch09.qxt 9/6/00 11:22 AM Page 326
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
327
NOTE SQLServer Enterprise Manager does not provide a way to display any rows that
might be retrieved by a stored procedure.
You’ll learn more about stored procedures in Chapter 14.
Users
If you click a Users node, you’ll see a list of all the users for the current database. Users
are specific to a database (unlike logins, which apply to entire servers) and are the
basis for permissions within a database. As you can see in Figure 9.16, the user list
shows the name, associated login name (if any), and whether that user is permitted in
the database.
FIGURE 9.16
User list in SQL Server
Enterprise Manager
You can create and delete users from the Users node. The shortcut menu associated
with an individual user object lets you manage the permissions associated with that user.
NOTE You’ll learn more about users (and the other facets of SQLServer security) in
Chapter 18.
Roles
Clicking a Roles node will show you a list of all the roles in the current database. Roles
are another part of the SQLServer security mechanism. They allow you to manage
permissions for groups of users rather than for individual users. There are two types of
roles: application roles (designed for client-side validation of user identity) and stan-
dard roles (containing SQLServer users). Figure 9.17 shows a typical list of roles.
THE SQLSERVER ENTERPRISE MANAGER TREE
Digging into SQL
Server
PART
III
2627ch09.qxt 9/6/00 11:22 AM Page 327
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
CHAPTER 9 • USING SQLSERVER ENTERPRISE MANAGER
328
FIGURE 9.17
List of roles in SQL
Server Enterprise
Manager
From the Roles node itself, you can create and delete roles. Double-clicking a role
shows you the properties of that role, including the users in the role and the permis-
sions that they are assigned.
NOTE You’ll learn more about roles in Chapter 18.
Rules
Clicking a Rules node will show you all the rules in the current database. Rules are
conditions expressed in T-SQL syntax (for example, @salary < 20000) that can be
used to limit the data contained in columns of a table.
TIP You usually won’t find any rules in SQLServer 2000 databases. Rules are now con-
sidered to be obsolete and have been largely replaced by constraints.
You’ll find further information about rules in Chapter 4.
2627ch09.qxt 9/6/00 11:22 AM Page 328
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
329
Defaults
If you click a Defaults node, the right-hand pane of SQLServer Enterprise Manager
will show you all the defaults in the current database. Figure 9.18 shows such a list of
defaults.
FIGURE 9.18
Defaults in SQL Server
Enterprise Manager
A default is a default value that can be attached to one or more table columns for
use when a value is not explicitly supplied for that column in a new row of the table.
From the Defaults node, you can create and delete defaults. Double-clicking an
individual default will show you the properties for that default.
TIP Like rules, defaults are largely obsolete. For the most part, you should use default
constraints instead of defaults in your database designs.
There’s further information on defaults in Chapter 4.
User Defined Data Types
When you click a User Defined Data Types node, SQLServer Enterprise Manager
shows you all of the user-defined datatypes in the current database. You can think of
user-defined datatypes as aliases for built-in datatypes. Figure 9.19 shows the user-
defined datatypes in a typical database.
FIGURE 9.19
User-defined datatypes
THE SQLSERVER ENTERPRISE MANAGER TREE
Digging into SQL
Server
PART
III
2627ch09.qxt 9/6/00 11:22 AM Page 329
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
[...]... can’t manage a linked server with SQLServer Enterprise Manager Remote Servers Remote servers are Microsoft SQL Servers that allow users from the current server to execute stored procedures When you click a Remote Servers node, SQLServer Enterprise Manager will display information on all of the current server s remote servers Double-clicking a remote server brings up the remote server property sheet... start and stop the SQLServerAgent service, or create a new operator, job, or alert You can also view the SQLServerAgent error log, or make this a master or target server for multiserver administration N OT E The SQLServerAgent error log contains only errors directly related to the SQLServerAgent service, not to the operation of SQLServer as a whole When you click an Alerts node, SQLServer Enterprise... by the SQLServerAgent service SQLServerAgent is a separate component of SQLServer that’s Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark 9/6/00 11:23 AM Page 335 THE SQLSERVER ENTERPRISE MANAGER TREE 335 responsible for managing alerts, jobs, and operators, and there are nodes of the tree underneath the SQLServer Agent node for each of these objects From the SQL Server. .. participate in this server role The second tab shows you the operations that this server role has permission to perform NOTE Unlike with most other objects displayed in SQLServer Enterprise Manager, you can’t create or delete server roles Linked Servers Linked servers are servers that SQLServer Enterprise Manager knows about, but that are not necessarily Microsoft SQL Servers A linked server might be... has access to, and the server roles in which it participates Server Roles Server roles are built-in sets of permissions that SQLServer supplies For example, there’s a Server Administrator role that allows its members to configure serverwide settings When you click a Server Roles node, SQLServer Enterprise Manager displays all of the server roles on that server Double-clicking a server role opens the... DB provider The Linked Servers node in SQLServer Enterprise Manager contains one node for each server linked to the current server Each server node in turn contains a Tables node When you click a Tables node, SQLServer Enterprise Manager displays all of the tables on that linked server You can add and delete linked servers from a Linked Servers node Double-clicking a linked server will show the connection... that use that column FIGURE 9.21 Browsing repository metadata in SQLServer Enterprise Manager Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark PA R T Digging into SQLServer III 2627ch09.qxt 334 9/6/00 11:23 AM Page 334 CHAPTER 9 • USING SQLSERVER ENTERPRISE MANAGER The Management Folder Each SQL Server in SQLServer Enterprise Manager contains a Management folder This is... about database maintenance Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark 2627ch09.qxt 9/6/00 11:23 AM Page 339 THE SQL SERVER ENTERPRISE MANAGER TREE 339 SQL Server Logs The SQLServer Logs node for a server holds nodes for the current activity log and for the six most recent activity logs before that Whenever you start SQL Server, it starts writing events to the Windows... that server in its property sheet Figure 9.26 shows a linked server property sheet Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark PA R T III Digging into SQLServer 2627ch09.qxt 2627ch09.qxt 344 9/6/00 11:23 AM Page 344 CHAPTER 9 • USING SQLSERVER ENTERPRISE MANAGER FIGURE 9.26 Connection information for a linked server N OTE Linked servers are primarily used in T -SQL statements... 9.24 Entries in a SQLServer activity log PA R T NOTE You’ll learn more about interpreting SQLServer logs in Chapter 16 Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark Digging into SQLServer III 2627ch09.qxt 340 9/6/00 11:23 AM Page 340 CHAPTER 9 • USING SQLSERVER ENTERPRISE MANAGER The Replication Folders The nodes in the Replication folders depend on the server s role in . Management
folder
SQL Server Agent
The SQL Server Agent node is primarily a container for the objects managed by the
SQLServerAgent service. SQLServerAgent is. 338
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
339
SQL Server Logs
The SQL Server Logs node for a server holds nodes for