factory数据库考核
WHERE 职工号=
(SELECT 职工号 FROM deleted) END GO
(3)删除触发器depart_update。
DROP TRIGGER depart_update GO
(4)删除触发器worker_delete。
DROP TRIGGER worker_delete GO
11、在SQL Server管理控制器中完成如下操作:
(1)创建一个登录账号XYZ/123(其默认的工作数据库为factory;其“服务器角色”设置为sysadmin;将“映射到此登录名的用户”设置为Factory,使其具有public权限;设置安全对象LCB-PC服务器具有Connect SQL权限)。
CREATE LOGIN XYZ WITH PASSWORD='123', DEFAULT_DATABASE=factory GO
EXEC sp_addsrvrolemember 'XYZ','sysadmin' GO
CREATE USER Factory FOR LOGIN XYZ GO
GRANT public TO Factory GO
GRANT Connect SQL TO LCB_PC GO
(2)修改(1)中为factory数据库创建的用户账号XYZ的属性,使XYZ登录账号对factory数据库具有db_owner权限。
factory数据库考核
12、使用SQL Server管理控制器对factory数据库执行完全备份(备份到H:\\DBF\\backup1文件中)和恢复操作。
factory数据库考核
13、使用SQL Server管理控制器生成数据库factory的脚本文件H:\\DBF\\factory.sql,并显示该文件的内容。
USE [master] GO
/****** Object: Database [factory] Script Date: 12/23/2015 12:51:34 ******/ CREATE DATABASE [factory] ON PRIMARY
( NAME = N'factory', FILENAME = N'G:\\DBF\\factory.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 5120KB )
LOG ON
( NAME = N'factory_log', FILENAME = N'G:\\DBF\\factory_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 1024KB )
GO
ALTER DATABASE [factory] SET COMPATIBILITY_LEVEL = 100 GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled')) begin
factory数据库考核
EXEC [factory].[dbo].[sp_fulltext_database] @action = 'enable' end GO
ALTER DATABASE [factory] SET ANSI_NULL_DEFAULT OFF GO
ALTER DATABASE [factory] SET ANSI_NULLS OFF GO
ALTER DATABASE [factory] SET ANSI_PADDING OFF GO
ALTER DATABASE [factory] SET ANSI_WARNINGS OFF GO
ALTER DATABASE [factory] SET ARITHABORT OFF GO
ALTER DATABASE [factory] SET AUTO_CLOSE OFF GO
ALTER DATABASE [factory] SET AUTO_CREATE_STATISTICS ON GO
ALTER DATABASE [factory] SET AUTO_SHRINK OFF GO
ALTER DATABASE [factory] SET AUTO_UPDATE_STATISTICS ON GO
ALTER DATABASE [factory] SET CURSOR_CLOSE_ON_COMMIT OFF GO
ALTER DATABASE [factory] SET CURSOR_DEFAULT GLOBAL GO
ALTER DATABASE [factory] SET CONCAT_NULL_YIELDS_NULL OFF GO
ALTER DATABASE [factory] SET NUMERIC_ROUNDABORT OFF GO
ALTER DATABASE [factory] SET QUOTED_IDENTIFIER OFF GO
ALTER DATABASE [factory] SET RECURSIVE_TRIGGERS OFF GO
ALTER DATABASE [factory] SET DISABLE_BROKER GO
ALTER DATABASE [factory] SET AUTO_UPDATE_STATISTICS_ASYNC OFF GO
ALTER DATABASE [factory] SET DATE_CORRELATION_OPTIMIZATION OFF GO
factory数据库考核
ALTER DATABASE [factory] SET TRUSTWORTHY OFF GO
ALTER DATABASE [factory] SET ALLOW_SNAPSHOT_ISOLATION OFF GO
ALTER DATABASE [factory] SET PARAMETERIZATION SIMPLE GO
ALTER DATABASE [factory] SET READ_COMMITTED_SNAPSHOT OFF GO
ALTER DATABASE [factory] SET HONOR_BROKER_PRIORITY OFF GO
ALTER DATABASE [factory] SET READ_WRITE GO
ALTER DATABASE [factory] SET RECOVERY FULL GO
ALTER DATABASE [factory] SET MULTI_USER GO
ALTER DATABASE [factory] SET PAGE_VERIFY CHECKSUM GO
ALTER DATABASE [factory] SET DB_CHAINING OFF GO