第33天~还原资料库

这个的上一篇:https://ithelp.ithome.com.tw/articles/10283889

又是练习MS-SQL 也有人叫T-SQL

连线至服务器的图案-可以按"插头"的图案

https://ithelp.ithome.com.tw/upload/images/20220207/20119035CPIjVChqie.png

写程序开发-一定会用到资料库-

https://ithelp.ithome.com.tw/upload/images/20220207/20119035tQwi1WkdAH.png

功能正常可以不用升级~
https://ithelp.ithome.com.tw/upload/images/20220207/20119035CrQ2tdqZjk.png

三层-
https://ithelp.ithome.com.tw/upload/images/20220207/20119035dv0ACFG0w2.png

外部层-

https://ithelp.ithome.com.tw/upload/images/20220207/201190354kaEh4RE3a.png

跟T-SQL对照-就是检视-view

https://ithelp.ithome.com.tw/upload/images/20220207/20119035JVPF7YZjIV.png

要看要按右键-新增检视-
https://ithelp.ithome.com.tw/upload/images/20220207/20119035ijuCGKqCzY.png

点开会看到-

https://ithelp.ithome.com.tw/upload/images/20220207/20119035OISyt8KaUy.png


概念层-
https://ithelp.ithome.com.tw/upload/images/20220207/20119035uthLtR3YU2.png

跟T-SQL对照-就是资料表-
https://ithelp.ithome.com.tw/upload/images/20220207/20119035CcjwiDZRHU.png

纲要Schema-例如盖大楼前要有施工蓝图-资料表=宣告变数=int age;

https://ithelp.ithome.com.tw/upload/images/20220207/20119035pT4JLjSKpr.png

https://ithelp.ithome.com.tw/upload/images/20220207/20119035oZxeB2OIiK.png

https://ithelp.ithome.com.tw/upload/images/20220207/20119035Jj8A8I9Pic.png

年龄跟生日可以从外部写公式对照/电话是敏感性资料不公开-

https://ithelp.ithome.com.tw/upload/images/20220207/20119035FBcrw0l2KZ.png
关SQL是按右键-停止=维护时用=银行暂停使用
https://ithelp.ithome.com.tw/upload/images/20220207/20119035DH7f4nCl6Q.png


新增资料表-
https://ithelp.ithome.com.tw/upload/images/20220207/20119035fBsBciMw2S.png

https://ithelp.ithome.com.tw/upload/images/20220207/20119035CSncxUXqgK.png

查看-指令码-

https://ithelp.ithome.com.tw/upload/images/20220207/20119035leoalWtxFr.png

只要留下第一行.其他删掉-按执行
https://ithelp.ithome.com.tw/upload/images/20220207/20119035q6IgHGzizg.png
/images/emoticon/emoticon08.gif
https://ithelp.ithome.com.tw/upload/images/20220207/20119035aQzVKd8Ox7.png

重新整理会看到资料库-
https://ithelp.ithome.com.tw/upload/images/20220207/20119035XoFsZ2ZoGR.png


删除资料库-按右键-删除-X会直接删掉

https://ithelp.ithome.com.tw/upload/images/20220207/20119035eanXHF5Bor.png

也可以-看到这样-再看到-指令码-原来的视窗按X
https://ithelp.ithome.com.tw/upload/images/20220207/20119035yL8cIBYywB.png

按执行-长这样
https://ithelp.ithome.com.tw/upload/images/20220207/20119035Og1xHa9CMb.png

然後再到 资料表-按重新整理-就没看到了~
https://ithelp.ithome.com.tw/upload/images/20220207/20119035vFyuJeHrgd.png

现在的公司资料库是不能带回家的..........


下载范例
https://docs.microsoft.com/zh-tw/sql/samples/adventureworks-install-configure?view=sql-server-ver15&tabs=ssms

https://ithelp.ithome.com.tw/upload/images/20220207/20119035vA07LmxlUJ.png

档案不要放在下载会找不到-我的版本号-每个人都不同

https://ithelp.ithome.com.tw/upload/images/20220207/20119035Zt5FIxfhNj.png

要放在-C:\Program Files\Microsoft SQL Server\MSSQL13.SQLEXPRESS\MSSQL\Backup

https://ithelp.ithome.com.tw/upload/images/20220207/20119035xds1zIGo9u.png
直接拖过来~
https://ithelp.ithome.com.tw/upload/images/20220207/20119035cKzYdWYFkg.png


再来按右键-还原资料库-

https://ithelp.ithome.com.tw/upload/images/20220207/20119035ImXM3YFgBB.png

按装置-

https://ithelp.ithome.com.tw/upload/images/20220207/201190352cCvl5oX0r.png

-依序按2个确定-
https://ithelp.ithome.com.tw/upload/images/20220207/20119035blfAZYC2uq.png

後面开始找到档案C:\Program Files\Microsoft SQL Server\MSSQL13.SQLEXPRESS\MSSQL\Backup

https://ithelp.ithome.com.tw/upload/images/20220207/20119035FeS66sWo6u.png
只能依序点-不好找

/images/emoticon/emoticon06.gif


然後依序按4个确定
https://ithelp.ithome.com.tw/upload/images/20220207/20119035EtQ2ejFma0.png

目前新增失败:???
https://ithelp.ithome.com.tw/upload/images/20220207/20119035WxSkKq1S3o.png
可能是新旧版本的问题。

下载的是 2019 的备份档,若是还原到 SQL Server 2019 版本之前,例如:SQL Server 2017、2016…等旧版就会出问题。

https://ithelp.ithome.com.tw/upload/images/20220207/20119035ZbH1VZjQPc.png

成功~
因为我用2016的~^^
https://docs.microsoft.com/zh-tw/sql/samples/adventureworks-install-configure?view=sql-server-ver15&tabs=ssms

这个的下一篇:https://ithelp.ithome.com.tw/articles/10283907


<<:  因边界网关协议 ( BGP) 路由配置错误导致 DNS 故障而遭受服务中断,防止此事件的最佳对策-对配置更改实施两人控制

>>:  4. 看看网页前端技术用在哪里

Day 22 Context

第 22 天 ! 当我们资料项下传递的时候, 会发现, component 的阶层越深, 传递资讯会...

纵深防御架构有效性检视

资安制度说白了就是企业或机构营运的日常管理,套用 ISMS 框架也只是为了满足内部或外部需求,视产业...

Day13 Let's ODOO: Security(2) Group

今天来介绍Group的写法,Group用意就是分你需要的权限群组,将需要这些权限的人加入,最後再把权...

[ Day 22 ] - 阵列资料处理 - forEach

阵列资料处理 - forEach 会将阵列中的每一个元素资料进行处理 使用范例 let dataLi...

GoDaddy 购买网域教学-建立你的网路门牌

GoDaddy 是一家美国上市的网域注册公司,也是全球网域注册量前10名的注册商,在 GoDaddy...