Sunteți pe pagina 1din 9

Database

administration

Homework 3

Submitted To: Submitted By:


Mr tejinder thind

Part-A

1. SQL Server 2005 provides Automated Administration. What do you


mean by Automated Administration and what is its need?
Automated administration is the programmed response to predictable
administrative responsibilities or server events. Task automation can prove to be
beneficial for administrators, application writers, and analysts operating data
warehouses etc.

To automate administration:

1) Establish which administrative responsibilities or server events occur


regularly and can be administered programmatically.
2) Define a set of jobs and alerts.
3) Run the SQL Server Agent service.

Need for Automated Administration

The job of an administrator entails various administrative duties that do not


change from day to day and can be tedious chores. By automating recurring
administrative tasks and responses to server events, one can free time to
perform other tasks that require creativity and lack predictable or programmable
responses.

2. What are different kinds of Alert System Properties provided by SQL


Server Agent?
Alert System Properties provided by SQL Server Agent are:

1) Alerts can be configured to send e-mail notification of specific events that


occur. For example, alerts can be configured to notify an operator of a
particular database event or operating system condition that may need
immediate action.
2) It can even be configured for a scheduled task, such as a database backup or
replication event succeeds or fails. For example, you can use SQL Server
Agent Mail to notify operators if an error occurs during processing at the end
of a month.
3) E-mail messages can be sent to a list of recipients informing them of the
status of scheduled jobs for possible user action. For example, you can
configure SQL Server Agent to send e-mail when a backup job completes.

SQL Server Agent Mail is required for alert notifications and automatic
notification when a job completes.

3. You must define schedules for when your job runs. Create a new
schedule for your Simple Backup job that will run the job every
weekday at noon.
Steps to define a schedule for Backup job:

1) Open sql server 2005 Management Studio and connect a server


2) Expand the tree (left navigation) ”Management->Maintenance Plans”
3) Right click on node Maintenance Plans and Click “Maintenance Plan Wizard”
(As shown in figure below) which causes to open a wizard.

4) Follow the wizard


5) In 2nd step of the wizard, You can schedule the task as clicking the Button
“Change” as shown in the following

6) Once you click the button “Change” you will get a new popup to enter
shedule details as shown below.
7) Click OK. It will save the schedule info and close the popup. And click Next
button to follow the next step.
8) In this step you will be asked to check the check list for all the tasks those
can be added in maintenance plan. Select “Backup Database (Full)” as shown
in the figure.

9) Follow the steps until you get following window. Once you get here Select one
or more databases from the list of databases by clicking Dropdown for
Databases.
10) From the above window, browse the folder location where to store the
backup files.

11) Continue the the steps until you get to Finish step.

12) Click Finish. Once you click finish, the wizard will execute the steps to create
a job to schedule database. Immediately you will notice a job created in Sql
Agent -> Jobs.

13) As per the schedule, the job runs (Repeatedly or One time) and it creates
backup file with name DB_NameMMddyyyyHHmm.bak (Ex:
NorthWind060420081912.bak) in the specified folder (Borwsed in the above
step).
Part-B

4. Write steps to create a new operator for the administrative account


that will be available for paging only on the weekends.
Steps to create a new operator for the administrative account that will be
available for paging only on the weekends are:-

1) Connect to the instance using Microsoft SQL Management Studio


2) Double Click SQL Server Agent
3) Right Click on Operators and select New Operator

4) Specify an operator Name, pager E-mail name and set Pager on duty
schedule then click OK. Settings are to be done on screen shown below.
5. Microsoft SQL Server Agent proxy accounts define a security context
in which a job step can run. To set permissions for a particular job
step, create a proxy that has the required permissions for a SQL
Server Agent subsystem, and then assign that proxy to the job step.
To create a proxy account

1) In Object Explorer, expand a server.


2) Expand SQL Server Agent.
3) Right-click Proxies and select New Proxy.
4) On the General page of the New Proxy Account dialog, specify the proxy
name, credential name, and description for the new proxy. Note that you
must create a credential first before you create a proxy if one is not already
available Check the appropriate subsystem for this proxy.
5) On the Principals page, add or remove logins or roles to grant or remove
access to the proxy account.

For example, we would like to create a proxy called SSISProxy for job steps
that execute SSIS packages. This proxy will use the credentials of the domain
account PowerDomain\PowerUser. We would like to allow the testUser login to
execute SSIS packages with this proxy account in the SQL Server Agent jobs that it
owns.

1) Create a credential containing the domain account PowerDomain\PowerUser


and its password
CREATE CREDENTIAL PowerUser WITH IDENTITY =
N'PowerDomain\PowerUser', SECRET = N'P@ssw0rd'

GO

USE [msdb]

GO

2) Create a new proxy called SSISProxy and assign the PowerUser credentail to
it

EXEC msdb.dbo.sp_add_proxy
@proxy_name=N'SSISProxy',@credential_name=N'PowerUser',@enabled=1

3) Grant SSISProxy access to the "SSIS package execution" subsystem

EXEC msdb.dbo.sp_grant_proxy_to_subsystem @proxy_name=N'SSISProxy',


@subsystem_id=11

4) Grant the login testUser the permissions to use SSISProxy

EXEC msdb.dbo.sp_grant_login_to_proxy @login_name = N'testUser',


@proxy_name=N'SSISProxy'

GO

6. If you want to configure Multi-Server Jobs in SQL-Server-2005, what


strategies would you adopt?
To create a multiserver environment, use the Master Server Wizard.

The wizard takes you through the following steps:

1) Checking the security settings for the SQL Server Agent service and the SQL
Server service on all servers intended to become target servers.
We recommend that both services should be running in Microsoft Windows
domain accounts.
2) Creating a master server operator (MSXOperator) on the master server.
MSXOperator is the only operator that can receive notifications for
multiserver jobs.
3) Starting the SQL Server Agent service on the master server.
4) Enlisting one or more servers as target servers.
If you have a large number of target servers, avoid defining your master server
on a production server. Otherwise, target server traffic can slow performance on
your production server. If you also forward events to a dedicated master server,
you can centralize administration on one server

Consider the following issues when creating a multiserver environment:

• Each target server reports to only one master server. You must defect a
target server from one master server before you can enlist it into a different one.
• When changing the name of a target server, you must defect it before
changing the name and re-enlist it after the change.
• If you want to dismantle a multiserver configuration, you must defect all the
target servers from the master server.
• If you want to distribute maintenance plans additional configuration is
required.

The following are common tasks for creating a multiserver environment:

To create a master server

• SQL Server Management Studio


• Transact-SQL
To create a target server

• SQL Server Management Studio


• Transact-SQL
• SQL Server Management Objects (SMO)
To enlist a target server into a master server

• SQL Server Management Studio


• Transact-SQL
• SQL Server Management Objects (SMO)
To defect a target server from a master server

• SQL Server Management Studio


• Transact-SQL
• SQL Server Management Objects (SMO)
To defect multiple target servers from a master server

• SQL Server Management Studio

S-ar putea să vă placă și