SQL2000 孤立用户修复

孤立用户的产生

当我们把备份的数据库恢复到新服务器时,原有的数据库用户名没有对应的登录名。就产生了孤立用户。

解决方法之一:使登录用户和数据库的孤立用户对应起来
存储过程- sp_change_users_login. 可使用3种操作(report, update_one ,auto_fix)
– 列出孤立用户
sp_change_users_login ‘report’
– 连接孤立用户(登录名已建)
sp_change_users_login ‘update_one’,’用户名’,’登录名’
– 自动连接孤立用户
sp_change_users_login ‘Auto_Fix’,’用户名’,NULL,’登录密码’

Windows AD Time

Windows AD域(单域)内的时间同步只需掌握以下几点:

* 域内工作站/服务器与登陆时的联络的DC同步时间,此DC与Root PDC角色的DC同步时间。*

有效的时间服务器可查询 http://www.pool.ntp.org/

  1. 域控(Root PDC角色)上需要与外部时间源同步,命令如下:
    W32tm /config /manualpeerlist:time.nrc.ca /syncfromflags:manual /reliable:yes /update
    W32tm /resync /rediscover
    net stop w32time && net start w32time

  2. 域控(非PDC角色),运行以下命令:
    w32tm /config /syncfromflags:domhier /update
    w32tm /resync /rediscover
    net stop w32time && net start w32time

  3. 遇到问题,重建时间配置:
    net stop w32time
    w32tm /unregister
    w32tm /register
    net start w32time

  • 域内机器同步: net time \DC Name或ip /set /y
  • 查看时间源: w32tm /monitor
  • 查看登录服务器: echo %logonserver%

KMS

命令行激活,请使用管理员权限

激活WINDOWS

  1. slmgr /skms X.X.X.X. 设置kms服务器
  2. slmgr /ipk xxxx-xxxx-xxxx-xxxx 更换Key
  3. slmgr /ato 激活

激活OFFICE

  1. ospp.vbs(C:\program files\microsoft office\officeXX) 注意32位版x86目录
  2. cscript ospp.vbs /sethst:X.X.X.X
  3. cscript ospp.vbs /act

其他

Linux Shell Example

grep

#-r 递归目录
#-i 大小写不敏感
#--exclude-dir 排除目录
#--include 包含指定文件 
#-l 只显示搜索到内容的文件名
#-L 只显示搜索不到内容的文件名
grep -r --exclude-dir=node_modules --exclude-dir=build --include  \*.js 'deve' ./

vim plugin

插件管理使用pathogen
插件列表:

  • camelcasemotion
  • nerdcommenter
  • undotree
  • vim-airline
  • vim-bufonly
  • vim-easymotion
  • vim-markdown
  • vim-surround
  • ag
  • auto-pairs
  • deoplete.nvim
  • vim-prettier
  • awesome-vim-colorschemes
  • nerdtree
  • vim-gitgutter

SQL XACT_ABORT

When SET XACT_ABORT is ON, if a Transact-SQL statement raises a run-time error, the entire transaction is terminated and rolled back. When SET XACT_ABORT is OFF, in some cases only the Transact-SQL statement that raised the error is rolled back and the transaction continues processing.