SQL Server system database

    SQL Server database size between 1MB and 1 048 516TB
    System DB: master,model,tempdb and msdb. There is the 5th hide system db named resouce, actual name is mssqlsystemresouce.

    Master DB:
        Consist of system tables. These tables trace the system installation and the database created later. Though there are a gourp of tables to store metadata in every database, the information in master db has more information, including disk space, file space allocated and used, the configration, port and login account information in system level, the db info in current instance and other SQL Server information(for distribute db).

        Master DB is very important, so keep a backup once the configuration changed or new database created.

 

    Model DB:

        Model is just a template database.

        When a new database is created, SQL Server will copy model db as the new db basic. If u want the new db include some objects or privilage, u can put the properties in the model db by using comand "alter database", then all new db will own these properties by inherited from model db.

 

    tempdb DB:

        Tempdb db is used as a workspace. The special feature of tempdb is it is recreated instead of restored.

        The objects in tempdb include: the temporary tables user created explicitly, the work tables when SQL Server processing query and the mid-result when sorting, the snapshot isolate lever information and filling the cursor.

 

    Mssqlsystemresource DB:

        Mssqlsystemresource is a hidden database, usually called resource. The reason microsoft hide it is for quick and safe updated, if no one can see this database, ms can install Service Pack(SP) by simply replacing resource DB. One thing need to point out is resource db can not be seen using normal query methods, such as sys.database and sp_helpdb.

        All excutable system objects, such as system stored procedure and functions, are all stored in this system.

        How to see mssqlsystemresource db:

             a). The file is in the installation folder. Such as "C:/Program Files/Microsoft SQL Server/MSSQL.1/MSSQL/data", there are 2 files named "mssqlsystemresource.mdf" 38MB and "mssqlsystemresource.ldf" 0.5MB

             b). Copy the 2 files metioned in a) as new name, then excute the following statement.

                  CREATE DATABASE resource_copy ON ( NAME = data, FILENAME = 'C:/Program Files/..../Data/mssqlsystemresource_COPY.mdf'), ( NAME = log, FILENAME = 'C:/Program Files/..../Data/mssqlsystemresource_COPY.ldf')

                  FOR ATTACH;

 

    msdb DB:

        SQL Server Agent services uses msdb database for executing backup or duplicating plan, also Service Broker will use msdb db.

        Actually, msdb can be dropped before SQL Server 2005, after dropped, SQL Server is normal running, but can not maintain any history backup and can not define task, warning and work or create duplicate.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值