【MySQL学生手册】MySQL第三章测试

本文地址:https://www.askmac.cn/archives/mysql-3rd-chapter-test.html

 

 

从回答中选出你认为正确的答案:

1. 以下哪些陈述是正确的?
a. 在对MySQL Server设置SQL模式后,它会对所有连接到此服务的客户端起作用。
b. 如果你需要设置两个SQL模式(如,STRICT_ALL_TABLES和ERROR_FOR_DIVISION_BY_ZERO模式),你必须执行两个SET sql_mode语句。
c. 除非显示进行全局声明,否则设置SQL模式仅会对进行此设置的客户端有影响。
d. SQL模式会对server的行为进行影响,如它们会影响到server无效输入数据处理方式。
e. SQL模式可以影响到server对客户端所提供的功能;如你可以使用SQL模式来启用或关闭InnoDB支持。

答案:C,D

 

仅在global全局模式下,SQL模式设置会对所有之后连接服务的客户端其作用。如果有多个SQL模式,你需要使用逗号分隔模式并执行相应语句:

 

SET sql_mode = 'STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO';

[Read more…]

基于Oracle DataGuard的银行业两地三中心灾备解决方案

基于Oracle DataGuard的银行业两地三中心灾备解决方案

下载地址:https://www.askmac.cn/wp-content/uploads/2015/08/诗檀软件-基于Oracle-DataGuard的银行业两地三中心灾备解决方案.pdf

 

[gview file=”https://www.askmac.cn/wp-content/uploads/2015/08/诗檀软件-基于Oracle-DataGuard的银行业两地三中心灾备解决方案.pdf”]

针对Oracle数据库损坏的应对措施

针对Oracle数据库损坏的应对措施

下载地址: 针对Oracle数据库损坏的应对措施 https://www.askmac.cn/wp-content/uploads/2015/08/诗檀软件-针对Oracle数据库损坏的应对措施.pdf

[gview file=””]

 

dg-protect

Oracle数据库的存储结构

6.1 目标

通过本节,您应该能够:

  • 使用Oracle Enterprise Manager里来查看数据库存储结构
  • 在您的数据库中建立新的存储结构
  • 回收数据库中未使用的空间
  • 管理用于恢复数据库变更的结构,并维护一致性

 

6.2 Oracle数据库结构

Oracle数据库包含下列物理结构:

控制文件(Control file): 包含指定数据库物理结构文件。

数据库文件(Datafile): 包含所有数据库信息。逻辑数据库结构的内容,例如表格与索引,都储存在数据文件中。

重做日志文件(Redo log file): 负责记录数据的所有变更。

[Read more…]

一个大二学生的Oracle技术之路:Oracle数据库技术所给予我的

作者为Anderson Liu ,90后大二学生,个人博客地址:http://www.peacesky.cn/

 

2014年的时候有一个数据,中国普通本专科招生699.8万人,在校生2468.1万人,毕业生638.7万人,全年研究生招生61.1万人,在学研究生179.4万人,毕业生51.4万人。

而我,是这浩浩荡荡大军中,普通的一员。

和所有其他的学生一样,在越来越高的物价、房价下,我们没有资金雄厚的家庭背景,只有赤手双拳,和年轻的时间与精力。顶着压力,努力提升自身能力适应就业市场,期待实现经济独立乃至经济自由。

我们开始的愿望很简单,能够依靠自身踏实努力,成长为经济独立,心理独立的人。

即将踏出校园,首先要面对的是经济独立。

路有很多条,而Oracle数据库技术则提供了一条,努力与收获在很大程度上成正比的,相对稳定的路 。

 

相对来讲,公平的路。

 

做技术,在我眼里,可以单纯地靠自己真正的能力,获得自己应得的。

不需要在国内的大环境下,靠关系,靠长辈,靠酒桌,各种乱七八糟的手段,获得特殊机会。

[Read more…]

Oracle RDA 8.x 数据收集使用总结

下载 Oracle RDA 8.x 数据收集使用总结

 

 

Oracle公司申请仲裁3个易混淆域名

Name.top5月12日讯,2015年4月8日,Oracle(甲骨文)公司向美国国家仲裁论坛提交了3个Oracle相关的域名仲裁申请,并试图获得这3个域名的控制权。

Oracle-logo

这3个被仲裁的域名分别是oralce.com、orcale.com以及oracel.com。根据whois信息查询,这3个争议域名的首次注册时间均为1999年5月。
Oracle公司也称为“甲骨文股份有限公司”,1977年成立于加利福利亚,目前是全球最大的企业级软件公司。这3个域名与Oracle非常相似,很容易使人产生混淆。
接下来,美国仲裁法院会对这3个域名进行调查,如果这3个域名符合仲裁条例,将会被转移到Oracle公司名下。

基于Oracle 12c Data Guard & Far Sync的低资源消耗两地三数据中心容灾方案

下载 <基于Oracle 12c Data Guard & Far Sync的低资源消耗两地三数据中心容灾方案》

 

 

Oracle ASM磁盘头部破坏实验

如果自己搞不定可以找诗檀软件专业ORACLE数据库修复团队成员帮您恢复!

诗檀软件专业数据库修复团队

服务热线 : 13764045638    QQ号:47079569    邮箱:service@parnassusdata.com

  1. 创建external磁盘组DATA1

2.	备份磁盘头
[root@asm asm]# dd if=/dev/asm-diskf of=/asm/diskf1.bak bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 3.71699 seconds, 28.2 MB/s


3.	清除磁盘头
[root@asm asm]# dd if=/dev/zero of=/dev/asm-diskf bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.0391271 seconds, 2.7 GB/s


4.	尝试mount
SQL> alter diskgroup DATA1 mount;
alter diskgroup DATA1 mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15017: diskgroup "DATA1" cannot be mounted
ORA-15063: ASM discovered an insufficient number of disks for diskgroup
"DATA1"

5.	查看alert日志
SQL> alter diskgroup DATA1 mount
NOTE: cache registered group DATA1 number=3 incarn=0xf1c89c27
NOTE: cache began mount (first) of group DATA1 number=3 incarn=0xf1c89c27
NOTE: Assigning number (3,4) to disk (/dev/asm-diskj)
NOTE: Assigning number (3,3) to disk (/dev/asm-diski)
NOTE: Assigning number (3,2) to disk (/dev/asm-diskh)
NOTE: Assigning number (3,1) to disk (/dev/asm-diskg)
Fri Apr 03 09:11:26 2015
ERROR: no read quorum in group: required 1, found 0 disks
NOTE: cache dismounting (clean) group 3/0xF1C89C27 (DATA1)
NOTE: messaging CKPT to quiesce pins Unix process pid: 7276, image: oracle@asm (TNS V1-V3)
NOTE: dbwr not being msg'd to dismount
NOTE: lgwr not being msg'd to dismount
NOTE: cache dismounted group 3/0xF1C89C27 (DATA1)
NOTE: cache ending mount (fail) of group DATA1 number=3 incarn=0xf1c89c27
NOTE: cache deleting context for group DATA1 3/0xf1c89c27
Fri Apr 03 09:11:26 2015
NOTE: No asm libraries found in the system
ASM Health Checker found 1 new failures
GMON dismounting group 3 at 21 for pid 20, osid 7276
NOTE: Disk  in mode 0x8 marked for de-assignment
NOTE: Disk  in mode 0x8 marked for de-assignment
NOTE: Disk  in mode 0x8 marked for de-assignment
NOTE: Disk  in mode 0x8 marked for de-assignment
ERROR: diskgroup DATA1 was not mounted
ORA-15032: not all alterations performed
ORA-15017: diskgroup "DATA1" cannot be mounted
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA1"
ERROR: alter diskgroup DATA1 mount
Fri Apr 03 09:18:00 2015


6.	恢复磁盘头
[root@asm asm]# dd if=/asm/diskf1.bak of=/dev/asm-diskf bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.0391271 seconds, 2.7 GB/s

7.	尝试挂载磁盘组
SQL> alter diskgroup DATA1 mount;

Diskgroup altered.





2. NORMAL
1. 创建normal磁盘组DATA2

 

 

2.	备份磁盘头
[root@asm asm]# dd if=/dev/asm-diskf of=/asm/diskf2.bak bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.187849 seconds, 558 MB/s

3.	破坏磁盘头
[root@asm asm]# dd if=/dev/zero of=/dev/asm-diskf bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.0262667 seconds, 4.0 GB/s

4.	查看磁盘组状态
SQL> select group_number,name,state,type from v$asm_diskgroup;

GROUP_NUMBER NAME		    STATE	TYPE
------------ ------------------------------            -----------     ------
	   1 DATA			    MOUNTED	NORMAL
	   2 ORADATA			    MOUNTED	EXTERN
	   3 DATA2			    MOUNTED	NORMAL

5.	Dismount磁盘组
SQL> alter diskgroup data2 dismount;

Diskgroup altered.

6.	尝试mount磁盘组
SQL> alter diskgroup data2 mount;
alter diskgroup data2 mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15040: diskgroup is incomplete
ORA-15042: ASM disk "0" is missing from group number "3"

7.	查看alert日志
SQL> alter diskgroup data2 mount
NOTE: cache registered group DATA2 number=3 incarn=0x62589c78
NOTE: cache began mount (first) of group DATA2 number=3 incarn=0x62589c78
NOTE: Assigning number (3,4) to disk (/dev/asm-diskj)
NOTE: Assigning number (3,3) to disk (/dev/asm-diski)
NOTE: Assigning number (3,2) to disk (/dev/asm-diskh)
NOTE: Assigning number (3,1) to disk (/dev/asm-diskg)
Fri Apr 03 09:33:36 2015
NOTE: group DATA2: updated PST location: disk 0001 (PST copy 0)
NOTE: group DATA2: updated PST location: disk 0002 (PST copy 1)
NOTE: group DATA2: updated PST location: disk 0003 (PST copy 2)
NOTE: GMON heartbeating for grp 3
GMON querying group 3 at 38 for pid 20, osid 7681
NOTE: Assigning number (3,0) to disk ()
GMON querying group 3 at 39 for pid 20, osid 7681
NOTE: cache dismounting (clean) group 3/0x62589C78 (DATA2)
NOTE: messaging CKPT to quiesce pins Unix process pid: 7681, image: oracle@asm (TNS V1-V3)
NOTE: dbwr not being msg'd to dismount
NOTE: lgwr not being msg'd to dismount
NOTE: cache dismounted group 3/0x62589C78 (DATA2)
NOTE: cache ending mount (fail) of group DATA2 number=3 incarn=0x62589c78
NOTE: cache deleting context for group DATA2 3/0x62589c78
GMON dismounting group 3 at 40 for pid 20, osid 7681
NOTE: Disk  in mode 0x8 marked for de-assignment
NOTE: Disk  in mode 0x8 marked for de-assignment
NOTE: Disk  in mode 0x8 marked for de-assignment
NOTE: Disk  in mode 0x8 marked for de-assignment
NOTE: Disk  in mode 0x8 marked for de-assignment
ERROR: diskgroup DATA2 was not mounted
ORA-15032: not all alterations performed
ORA-15040: diskgroup is incomplete
ORA-15042: ASM disk "0" is missing from group number "3"
ERROR: alter diskgroup data2 mount
Fri Apr 03 09:33:43 2015
ASM Health Checker found 1 new failures
Fri Apr 03 09:39:05 2015



8.	恢复磁盘头
[root@asm asm]# dd if=/asm/diskf2.bak of=/dev/asm-diskf bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.095314 seconds, 1.1 GB/s

9.	再次尝试mount磁盘组
SQL> alter diskgroup data2 mount;

Diskgroup altered.


3 创建HIGH磁盘组DATA3

 

 

2.	备份磁盘头
[root@asm asm]# dd if=/dev/asm-diskf of=/asm/diskf3.bak bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.171521 seconds, 611 MB/s

3.	清除磁盘头
[root@asm asm]# dd if=/dev/zero of=/dev/asm-diskf bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.0213577 seconds, 4.9 GB/s

4.	查看磁盘组状态
SQL> select group_number,name,state,type from v$asm_diskgroup;

GROUP_NUMBER NAME			    STATE	TYPE
------------ ------------------------------ ----------- ------
	   1 DATA			    MOUNTED	NORMAL
	   2 ORADATA			    MOUNTED	EXTERN
	   3 DATA3			    MOUNTED	HIGH

5.	Dismount磁盘组DATA3
SQL> alter diskgroup data3 dismount;

Diskgroup altered.


6.	Mount磁盘组
SQL> alter diskgroup data3 mount;
alter diskgroup data3 mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15040: diskgroup is incomplete
ORA-15042: ASM disk "0" is missing from group number "3"

7.	查看alert日志
SQL> alter diskgroup data3 mount
NOTE: cache registered group DATA3 number=3 incarn=0x36489cbc
NOTE: cache began mount (first) of group DATA3 number=3 incarn=0x36489cbc
NOTE: Assigning number (3,4) to disk (/dev/asm-diskj)
NOTE: Assigning number (3,3) to disk (/dev/asm-diski)
NOTE: Assigning number (3,2) to disk (/dev/asm-diskh)
NOTE: Assigning number (3,1) to disk (/dev/asm-diskg)
Fri Apr 03 09:52:35 2015
WARNING: GMON has insufficient disks to maintain consensus. minimum required is 5
NOTE: group DATA3: updated PST location: disk 0001 (PST copy 0)
NOTE: group DATA3: updated PST location: disk 0002 (PST copy 1)
NOTE: group DATA3: updated PST location: disk 0003 (PST copy 2)
NOTE: group DATA3: updated PST location: disk 0004 (PST copy 3)
NOTE: group DATA3: updated PST location: disk 0001 (PST copy 0)
NOTE: group DATA3: updated PST location: disk 0002 (PST copy 1)
NOTE: group DATA3: updated PST location: disk 0003 (PST copy 2)
NOTE: group DATA3: updated PST location: disk 0004 (PST copy 3)
NOTE: GMON heartbeating for grp 3
GMON querying group 3 at 57 for pid 20, osid 8015
NOTE: group DATA3: updated PST location: disk 0001 (PST copy 0)
NOTE: group DATA3: updated PST location: disk 0002 (PST copy 1)
NOTE: group DATA3: updated PST location: disk 0003 (PST copy 2)
NOTE: group DATA3: updated PST location: disk 0004 (PST copy 3)
NOTE: Assigning number (3,0) to disk ()
GMON querying group 3 at 58 for pid 20, osid 8015
NOTE: group DATA3: updated PST location: disk 0001 (PST copy 0)
NOTE: group DATA3: updated PST location: disk 0002 (PST copy 1)
NOTE: group DATA3: updated PST location: disk 0003 (PST copy 2)
NOTE: group DATA3: updated PST location: disk 0004 (PST copy 3)
NOTE: cache dismounting (clean) group 3/0x36489CBC (DATA3)
NOTE: messaging CKPT to quiesce pins Unix process pid: 8015, image: oracle@asm (TNS V1-V3)
NOTE: dbwr not being msg'd to dismount
NOTE: lgwr not being msg'd to dismount
NOTE: cache dismounted group 3/0x36489CBC (DATA3)
NOTE: cache ending mount (fail) of group DATA3 number=3 incarn=0x36489cbc
NOTE: cache deleting context for group DATA3 3/0x36489cbc
GMON dismounting group 3 at 59 for pid 20, osid 8015
NOTE: Disk  in mode 0x8 marked for de-assignment
NOTE: Disk  in mode 0x8 marked for de-assignment
NOTE: Disk  in mode 0x8 marked for de-assignment
NOTE: Disk  in mode 0x8 marked for de-assignment
NOTE: Disk  in mode 0x8 marked for de-assignment
ERROR: diskgroup DATA3 was not mounted
ORA-15032: not all alterations performed
ORA-15040: diskgroup is incomplete
ORA-15042: ASM disk "0" is missing from group number "3"
ERROR: alter diskgroup data3 mount
Fri Apr 03 09:52:43 2015
ASM Health Checker found 1 new failures
Fri Apr 03 09:55:08 2015


8.	恢复磁盘头
[root@asm asm]# dd if=/asm/diskf3.bak of=/dev/asm-diskf bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.0911406 seconds, 1.2 GB/s

9.	再次mount磁盘组
SQL> alter diskgroup data3 mount;               

Diskgroup altered.


Oracle的实例管理

Oracle的实例管理

5.1 目标

本节中,您应该能够:

  • 启动/关闭Oracle实例
  • 检视用来设定Oracle实例的参数
  • 管理Oracle实例的内存组件

 

5.2 Oracle实例管理

一台Oracle Database服务器包含了一个Oracle实例与一个Oracle数据库。而一个Oracle实例则是由许多内存区与后台进程组成。

一个Oracle数据库包含了数据文件、控制文件及重做日志文件。

 

您必须先启动实例,如此使用者才能存取数据库。启动数据库实例时,会读取初始化参数文件以设定实例、配置内存区以及启动后台进程。

 

如果已经启动实例,而且也开启了数据库,使用者就能存取数据库。

[Read more…]

沪ICP备14014813号-2

沪公网安备 31010802001379号