MYSQL5.6 OCP 1Z0-883 5.6題庫及解析二

11.You are using replication and the binary logfiles on your master server consume a lot of disk space.

Which two steps should you perform to safely remove some of the older binarylog files?

A.Ensure that none of the attached slaves are using any of the binary logs youwant to delete.

B.Use the command PURGE BINARY LOGS and specify a binary log file name or adate and time to remove unused files.

C.Execute the PURGE BINARY LOGE NOT USED command.

D.Remove all of the binary log files that have a modification date earlier thantoday.

E.Edit the .index file to remove the files you want to delete.

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

答案:AB

分析:

A

是必須要保證的,你的刪除的肯定不能正被slave使用啦苍糠。

PURGE LOGS

語法PURGE { BINARY | MASTER } LOGS { TO

'log_name' | BEFORE datetime_expr }左刽,所做操作會對.index文件進行自動更新。因此B正確刃滓,E錯仁烹。

C

錯,無此語法咧虎。

D

錯卓缰,具體清理到什么位置需要按照SHOW SLAVE STATUS來查看,而不是武斷地確定刪除早于今天的binary log文件砰诵。


12.Which two statements are true about InnoDBauto-increment locking?

A.The auto-increment lock can be a table-level lock.

B.InnoDB never uses table-level locks.

C.Some settings for innodb_autoinc_lock_mode can help reduce locking.

D.InnoDB always protects auto-increment updates with a table-level lock.

E.InnoDB does not use locks to enforce auto-increment uniqueness.

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

答案:A, C

分析:

auto-increment的AUTO-INC鎖是一個表級鎖征唬,因此A正確,B和E錯誤茁彭,总寒。

C

正確,根據(jù)數(shù)據(jù)庫參數(shù)innodb_autoinc_lock_mode的設(shè)置理肺,插入操作會根據(jù)模式和所用語句的不同選用相應(yīng)的鎖摄闸。innodb_autoinc_lock_mode = 2的時候善镰,將不使用表級鎖和輕量mutex鎖,不過在基于語句復(fù)制(SBR: Statement Based Replication)時年枕,會有交錯序列風險媳禁。參考:http://dev.mysql.com/doc/refman/ ... ement-handling.htmlhttp://dev.mysql.com/doc/refman/ ... t-configurable.html


13.Consider the Mysql Enterprise Audit plugin.

A CSV file called data.csv has 100 rows of data.

The stored procedure prepare_db() has 10 auditable statements.

You run the following statements in the mydb database:


Mysql> CALL prepare_db();

Mysql> LOAD DATA INFILE '/tmp/data.cav' INTO TABLE mytable;

Mysql> SHOW TABLES;

How many events are added to the audit log as a result of the precedingstatements?

A.102; top-level statements are logged, but LOAD DATA INFILE is logged as aseparate event.

B.3; only the top-level statements are logged.

C.111; top-level statements and all lower-level statements are logged.

D.12; only top-level statements and stored procedure events are logged.

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

答案:B

分析:

audit.log

文件中每個<AUDIT_RECORD>元素代表了一個事件,如客戶連接或關(guān)閉連接事件画切,執(zhí)行SQL語句等竣稽。僅頂層語句會被記錄下來,存儲程序(如觸發(fā)器或存儲過程)中的語句不會被記錄霍弹。命令如LOAD DATA INFILE在進行操作時毫别,其對文件內(nèi)容進行進行操作的具體細節(jié)不會被記錄。因此典格,A, C, D錯岛宦,B正確。參考:http://dev.mysql.com/doc/refman/ ... ogging-control.html


14.You execute the following statement in aMicrosoft Windows environment. There are no conflicts in the path namedefinitions.

C: \> mysqld

–-install Mysql56 –-defaults–file=C:\my–opts.cnf

What is the expected outcome?

A.Mysqld acts as an MSI installer and installs the Mysql 5.6 version, with thec:\my-opts.cnf?

configuration file.

B.Mysql is installed as the Windows service name Mysql56, and usesc:\my-opts.cnf as the


configuration file

C.An error message is issued because

–-install is not a validoption for mysqld.

D.A running Mysql 5.6 installation has its runtime configuration updated withthe server variables?

set in c:\my-opts.cnf.

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

答案:B

分析:首先mysqld是作為MySQL服務(wù)端主程序來運行的耍缴,它并不負責MSI安裝的過程砾肺,因此A錯。通過mysqld --install可以進行Windows服務(wù)注冊防嗡,同時--defaults-file用于設(shè)置啟動服務(wù)端時使用的配置文件变汪,B正確。請注意--install命令項僅存在于Windows版MySQL的mysqld命令中蚁趁,如果你是在Linux上安裝MySQL是無法找到mysqld對應(yīng)的--install命令項的裙盾。

C

錯誤,因為其對于Windows版的mysqld是有效項他嫡。

D

錯番官,因此這命令不是用于安裝時的配置。參考:

http://dev.mysql.com/doc/refman/5.7/en/windows-start-service.html



15钢属、Which two methods will clearor reset the collected events in the tables?

Consider the events_% tables in performance Schema.?

Which two methods will clear or reset the collected events in the tables?

A.Using DELETE statements, for example, DELETE FROMperformance_schema.events_watis_current;

B.Using the statement RESET PERFORMANCE CACHE;

C.Using the statement FLUSH PERFORMANCE CACHE;

D.Using TRUNCATE statements, for example, TRUNATE TABLEperformance_schema.events_waits_current;

E.Disabling and re-enabling all instruments

F.Restarting Mysql

答案:DE


16.?What are fourcapabilities of the mysql client program?

A.Creating and dropping databases

B.Creating, dropping, and modifying tables and indexes

C.Shutting down the server by using the SHUTDOWN command

D.Creating and administering users

E.Displaying replication status information

F.Initiating a binary backup of the database by using the START BACKUP command

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

答案:A,B,D,E

分析:首先我們需要分清楚MySQL和mysql這兩個詞的概念徘熔,MySQL是指MySQL整個數(shù)據(jù)庫和其軟件,而mysql則是其軟件中涵蓋的一個客戶端工具淆党。本題考的是對這些客戶端工具使用酷师。在使用mysql命令行工具登陸服務(wù)端后,可以執(zhí)行的命令也非常多宁否,比如建立和刪除數(shù)據(jù)庫窒升,表和索引的增刪改等。你也可以使用mysql客戶端工具來建立用戶慕匠,并進行對用戶的權(quán)限和訪問進行管理饱须。當然在Master-Slave Replication的主庫和從庫,你也可以使用show

master status及show slave status來查看復(fù)制的狀態(tài)情況台谊。因此, ABDE都是正確的蓉媳。至于關(guān)閉MySQL Server譬挚,這有多種方式,其中一種是使用mysqladmin客戶端工具shutdown命令來實現(xiàn)的,mysql客戶端工具不負責這事。而備份,邏輯備份可使用mysqldump 或mysqlpump(從MySQL 5.7.6開始)适袜。而binary backup則可以使用mysqlbackup(如果你的MySQL是企業(yè)版的話)或使用copy表文件的方式來進行備份摧莽,而不是在mysql命令行工具中鍵入START BACKUP命令顷锰。參考:http://dev.mysql.com/doc/refman/5.7/en/programs-client.htmlhttp://dev.mysql.com/doc/refman/5.7/en/show-slave-status.htmlhttp://dev.mysql.com/doc/refman/5.7/en/mysqladmin.htmlhttp://dev.mysql.com/doc/refman/5.7/en/backup-methods.html


17.Assume that you want to know which MysqlServer options were set to custom values.

Which two methods would you use to find out?

A.Check the configuration files in the order in which they are read by theMysql Server and compare them with default values.

B.Check the command-line options provided for the Mysql Server and compare themwith default values.

C.Check the output of SHOW GLOBAL VARIABLES and compare it with default values.

D.Query the INFORMATION_SCHEMA.GLOBAL_VARIABLES table and compare the resultwith default values.

答案:C, D (for MySQL 5.6) C (for MySQL 5.7)

分析;

MySQL Server

配置項由多處設(shè)置組成,由于Server的主程序為mysqld,因此其命令項設(shè)置也主要是看mysqld對應(yīng)的項的設(shè)置闷尿。在命令項設(shè)置后,啟動后相應(yīng)項反應(yīng)在數(shù)據(jù)庫上女坑,就是那些Global Variables全局變量了填具,當用戶會話訪問時,其Session Variables則會copy自全局變量值匆骗,之后用戶可以根據(jù)需要使用SET命令來修改會話變量劳景。當然如果有足夠的權(quán)限,用戶也可以修改全局變量碉就,不過這種修改僅應(yīng)用于正在運行MySQL Server盟广,且對之后新登陸會話有效,一旦Server重啟就打回原形了铝噩。此題中衡蚂,主要是希望查看啟動后,使用的全局變量和其默認值修改情況骏庸,一般在啟動初始化時,我們可以提前通過mysqld的命令行項上直接修改年叮,或使用配置文件來進行啟動時候的項的默認修改具被。但是A, B都是錯的,因為你無法確認MySQL Server的全局變量在啟動后是否有人為被再次修改過只损。

C

正確一姿,因為show global variables可以了解當前所有全局變量值,從而和默認值進行比較跃惫。請注意:show variables指的是查看當前會話變量叮叹,因此一定要加上global。

D

在MySQL 5.6版本中正確爆存,因為其global

variables值存放于此表中蛉顽。不過在5.7版本,GLOBAL_VARIABLES這張表被移至performance_schema下先较,原先INFORMATION_SCHEMA.GLOBAL_VARIABLES將成為空表并被棄用携冤。參考:http://dev.mysql.com/doc/refman/5.7/en/option-files.htmlhttp://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html


18.You install a copy of Mysql 5.6.13 on a

brand new Linux server by using RPM packages. The server starts successfully as

verified by the following commands:?

$ pidof mysqld

3132

$ tail

–n2 /var/lib.mysql/hostname.err

2013-08-18 08:18:38 3132 [Note] /usr/sbin/mysqld: ready for connections.

Version: '5.6.13-enterprise-commercial-advanced' socket: '/tmp/mysql.sock'port: 3306

Mysql Enterprise Server

–Advanced Edition (Commercial)

You attempt to log in as the root user with the following command:?

$ mysql

–u root

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:NO)

Which statement is true about this scenario?

A.The RPM installation script sets a default password of password for newinstallations.

B.The local root user must log in with a blank password initially: mysql

–u root –p.

C.New security measures mean that the mysql_secure_installation script must berun first on all new installations.

D.The mysql_install_db post-installation script used

–-random-passwords.

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

答案:D

分析:

MySQL5.6 Linux RPM

包安裝中會調(diào)用帶有--random-passwords參數(shù)項的mysql_install_db腳本命令, 為root用戶生成一個隨機密碼悼粮,并保存在$HOME/.mysql_secret文件中。

A

錯曾棕,生成的是一個隨機密碼扣猫,而非默認密碼。B錯翘地,因為本地root用戶已經(jīng)有一個生成的密碼了申尤,因此空密碼是不能登陸成功的。

C

錯衙耕,mysql_secure_installation是一個非必要腳本昧穿,在MySQL安裝完成后,你可以運行此腳本來進一步增強其安全策略臭杰。參考:http://dev.mysql.com/doc/refman/

... stallation-rpm.htmlhttp://dev.mysql.com/doc/refman/

... e-installation.html


19.A Mysql Server has been running an existing

application successfully for six months.

The my.cnf is adjusted to contain the following

additional configuration:

[mysqld]

default-authentication-plugin=sha256_password

The Mysql Server is restarted without error.

What effect will the new configuration have in

existing accounts?

A.They will have their passwords updated on

start-up to sha256_password format

B.They will have to change their password the next

time they login to the server

C.They are not affected by this configuration

change

D.They all connect via the secure

sha256_password algorithm without any configuration change.

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

答案:C分析:

default-authentication-plugin

的作用是為了在create user時默認其所使用的密碼加密格式粤咪。其和已經(jīng)建立的用戶所使用的密碼格式無關(guān),因此A,B錯渴杆。在客戶端工具進行連接時寥枝,服務(wù)端會在mysql.user表中進行匹配,以了解對應(yīng)登陸用戶所使用的密碼格式磁奖,并以此授權(quán)方式進行登陸驗證囊拜,因此D錯。參考:http://dev.mysql.com/doc/refman/

... ication-plugin.html


20比搭、In a design situation, there

are multiple character sets that can properly encode your data.

Which three should influence your choice of

character set?

A.Syntax when writing queries involving JOINS

B.Syntax when writing queries involving JOINS

C.Memory usage when working with the data

D.Character set mapping index hash size

E.Disk usage when storing data

答案:CDE

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末冠跷,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子身诺,更是在濱河造成了極大的恐慌蜜托,老刑警劉巖,帶你破解...
    沈念sama閱讀 211,743評論 6 492
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件霉赡,死亡現(xiàn)場離奇詭異橄务,居然都是意外死亡,警方通過查閱死者的電腦和手機穴亏,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,296評論 3 385
  • 文/潘曉璐 我一進店門蜂挪,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人嗓化,你說我怎么就攤上這事棠涮。” “怎么了刺覆?”我有些...
    開封第一講書人閱讀 157,285評論 0 348
  • 文/不壞的土叔 我叫張陵严肪,是天一觀的道長。 經(jīng)常有香客問我,道長诬垂,這世上最難降的妖魔是什么劲室? 我笑而不...
    開封第一講書人閱讀 56,485評論 1 283
  • 正文 為了忘掉前任,我火速辦了婚禮结窘,結(jié)果婚禮上很洋,老公的妹妹穿的比我還像新娘。我一直安慰自己隧枫,他們只是感情好喉磁,可當我...
    茶點故事閱讀 65,581評論 6 386
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著官脓,像睡著了一般协怒。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上卑笨,一...
    開封第一講書人閱讀 49,821評論 1 290
  • 那天孕暇,我揣著相機與錄音,去河邊找鬼赤兴。 笑死妖滔,一個胖子當著我的面吹牛,可吹牛的內(nèi)容都是我干的桶良。 我是一名探鬼主播座舍,決...
    沈念sama閱讀 38,960評論 3 408
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼陨帆!你這毒婦竟也來了曲秉?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 37,719評論 0 266
  • 序言:老撾萬榮一對情侶失蹤疲牵,失蹤者是張志新(化名)和其女友劉穎承二,沒想到半個月后,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體纲爸,經(jīng)...
    沈念sama閱讀 44,186評論 1 303
  • 正文 獨居荒郊野嶺守林人離奇死亡矢洲,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 36,516評論 2 327
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了缩焦。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 38,650評論 1 340
  • 序言:一個原本活蹦亂跳的男人離奇死亡责静,死狀恐怖袁滥,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情灾螃,我是刑警寧澤题翻,帶...
    沈念sama閱讀 34,329評論 4 330
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響嵌赠,放射性物質(zhì)發(fā)生泄漏塑荒。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 39,936評論 3 313
  • 文/蒙蒙 一姜挺、第九天 我趴在偏房一處隱蔽的房頂上張望齿税。 院中可真熱鬧,春花似錦炊豪、人聲如沸凌箕。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,757評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽牵舱。三九已至,卻和暖如春缺虐,著一層夾襖步出監(jiān)牢的瞬間芜壁,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 31,991評論 1 266
  • 我被黑心中介騙來泰國打工高氮, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留慧妄,地道東北人。 一個月前我還...
    沈念sama閱讀 46,370評論 2 360
  • 正文 我出身青樓纫溃,卻偏偏與公主長得像腰涧,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子紊浩,可洞房花燭夜當晚...
    茶點故事閱讀 43,527評論 2 349