zoukankan      html  css  js  c++  java
  • 数据库操作技巧

    //读出设备名字
    restore FILELISTONLY  from disk='D:\temp\databak'

    //还原数据库
    restore database singlepos from disk='D:\temp\databak'
    with move 'CHAIN_OL_DEV_Data' to 'E:\dev\single_data.mdf',
         move 'CHAIN_OL_DEV_Log' to 'E:\dev\single_log.ldf'


    --读出日志和数据文件
    RESTORE FILELISTONLY from disk='d:\lqbh.bak'
    --还原数据库
    restore database zybh from disk='d:\lqbh.bak'
    with move 'thbh_Data' to 'd:\MSSQL\zybh_data.mdf',
         move 'thbh_Log' to 'd:\MSSQL\zybh_log.ldf',
     move 'lqbh_1_Log' to 'd:\MSSQL\zybh_log_1.ldf'




     

    execute xp_shell 'nd d:\db'//新建文件夹


    //其他技巧
    //创建数据库
    create database jtms
    on primary (name='jtms_data',filename='F:\svn\工具\进销存\db\jtms_data.mdf')
    log on (name='jtms_log',filename='F:\svn\工具\进销存\db\jtms_log.ldf')
    //还原数据库
    restore database jtms from disk='F:\svn\工具\进销存\db\JTMS_2007-6-25'

    use master
    //分离数据库
    execute sp_detach_db jtms
    //附加数据库
    execute sp_attach_db 'jtms','F:\svn\工具\进销存\db\jtms_data.mdf','F:\svn\工具\进销存\db\jtms_log.ldf'

    ---------------------------------------------------

    //还原数据库
    create database sgmw
    on primary (name='sgmw_data',filename='/var/opt/mssql/data/sgmw_data.mdf')
    log on (name='sgmw_log',filename='/var/opt/mssql/data/sgmw_log.ldf')

    //查看备份文件信息
    RESTORE FILELISTONLY FROM DISK = '/var/opt/mssql/bak/sgmw.bak'

    //还原
    restore database sgmw from disk='/var/opt/mssql/bak/sgmw.bak'
    with move 'SGMW' to '/var/opt/mssql/data/sgmw_data.mdf',
    move 'SGMW_log' to '/var/opt/mssql/data/sgmw_log.ldf',STATS =10,REPLACE
  • 相关阅读:
    MATLAB 高斯金字塔
    MATLAB 灰度图直方图均衡化
    MATLAB 生成高斯图像
    MATLAB 灰度、二值图像腐蚀膨胀
    MATLAB 中值滤波
    MATLAB 最大中值滤波
    MATLAB 最大均值滤波
    MATLAB 图像加噪,各种滤波
    MATLAB 图像傅里叶变换,幅度谱,相位谱
    十款最佳人工智能软件
  • 原文地址:https://www.cnblogs.com/kuailewangzi1212/p/796155.html
Copyright © 2011-2022 走看看