Oracle数据库数据恢复、性能优化来问问AskMaclean - ParnassusData诗檀软件旗下网站

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

205

积分

19

好友

29

主题
发表于 2016-6-25 18:23:21 | 查看: 649| 回复: 0
本帖最后由 biotwang 于 2016-6-25 18:27 编辑

【dbdao.com MySQL OCP认证专题】- MySQL 5.6 - OCP 考题讲解

3.

You inherit a legacy database system when the previous DBA Bob, leaves the company. You are notified that users are getting the following error:
  1. mysql> CALL film_in_stock (40, 2, @count);
  2. ERROR 1449 (HY000): The user specified as a definer ('bob'@'localhost') does not exist
复制代码
How would you identify all stored procedures that pose the same problem?
A.
Execute SELECT * FROM mysql.routines WHERE DEFINER='bob@localhost';.
B.
Execute SHOW ROUTINES WHERE DEFINER='bob@localhost'.
C.
Execute SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE DEFINER='bob@localhost';.
D.
Execute SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER='bob' and HOST='localhost';.
E.
Examine the Mysql error log for other ERROR 1449 messages.

----------------------------------------------------------------------------------
答案:C

分析:
routines表在库INFORMATION_SCHEMA下,因此A错。
可以登陆MySQL后,使用? show命令查看show语法。可知show无routine语句,B错。
dbdao_mysql_item_id649_1_wm.png

可使用以下命令来查看routines:
  1. pager less;
  2. select * from information_schema.routines\G
复制代码
dbdao_mysql_item_id649_2_wm.png

可知C正确.
INFORMATION_SCHEMA.PROCESSLIST表中仅显示了当前正在运行的线程信息,D错。
Mysql error log是对报错信息的记录,并不会有所有存储过程的记录,E错。
您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化来问问AskMaclean - ParnassusData诗檀软件旗下网站

GMT+8, 2018-11-16 15:57 , Processed in 0.068418 second(s), 25 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569