$ dbaguide.com / cheat-sheets / mysql / ocp-8.0

MySQL OCP 8.0 DBA Exam Topic Map

7 exam domains, essential commands, and high-frequency exam traps for 1Z0-908 — at a glance

Oracle 1Z0-908 · MySQL 8.0
Updated: October 2026 · Study Guide
Exam Code
1Z0-908 · multiple choice
Credential
OCP · MySQL 8.0 Database Administrator
Coverage
7 domains · Architecture → High Availability
Duration / Questions / Pass
Varies by source → confirm at education.oracle.com
Retirement Date
Nov 16, 2026 · final exam window
01

Architecture Mimari

TopicWhat You Need to Know
Client ConnectionsTCP/IP 3306, X Protocol 33060, Unix socket (Linux), named pipe / shared memory (Windows). On Linux localhost → socket; 127.0.0.1 → TCP. Force TCP with --protocol=TCP.
Data StorageTransactional Data Dictionary stored in InnoDB (mysql.ibd). No .frm / .TRG / .par files. Metadata serialized as SDI inside .ibd → inspect via ibd2sdi.
InnoDB Filesibdata1 (system TS, change buffer) · file_per_table .ibd (default ON) · general TS · undo_001/002 · ibtmp1 + session temp · doublewrite #ib_*.dblwr (8.0.20+) · redo: ib_logfile* → 8.0.30+ #innodb_redo/
Buffers & CachesGlobal: innodb_buffer_pool_size, innodb_log_buffer_size, table_open_cache, key_buffer_size (MyISAM).
Per-session: sort_buffer_size, join_buffer_size, read_buffer_size, tmp_table_size.
Data DictionaryINFORMATION_SCHEMA consists of views over internal DD tables. DD tables cannot be accessed directly. Cached table stats: information_schema_stats_expiry (86400s).
Quick Discovery
SELECT SPACE, NAME, ROW_FORMAT, SPACE_TYPE FROM information_schema.INNODB_TABLESPACES; SHOW VARIABLES LIKE 'innodb_buffer_pool%'; SELECT @@innodb_redo_log_capacity; -- 8.0.30+
Exam Pitfall: Query Cache was completely removed in MySQL 8.0 — all query_cache_* variables produce errors. Eliminate any answer choice suggesting the query cache.
Memory Sizing Formula: Total Memory ≈ global buffers + (max_connections × per-session buffers). Increasing session buffers multiplies across active client connections.
02

Installation & Configuration Install & Config

TopicWhat You Need to Know
InstallationRPM/DEB repo, generic tarball, MSI, Docker. mysqld --initialize → random temporary root password written to error log; --initialize-insecure → empty root password.
Generated Filesdatadir (/var/lib/mysql), auto.cnf (server_uuid), auto-generated ca.pem / server-cert.pem, mysqld-auto.cnf (SET PERSIST), error log.
Start / Stopsystemctl start mysqld, mysqld_safe, SQL SHUTDOWN / RESTART, mysqladmin shutdown.
Upgrades8.0.16+ upgrades are executed automatically by the server; mysql_upgrade is deprecated. --upgrade=AUTO|NONE|MINIMAL|FORCE. Pre-check: MySQL Shell util.checkForServerUpgrade(). In-place vs logical.
Option FilesOrder: /etc/my.cnf → /etc/mysql/my.cnf → SYSCONFDIR/my.cnf → $MYSQL_HOME/my.cnf → ~/.my.cnf → ~/.mylogin.cnf. Last read wins. --defaults-file, --defaults-extra-file, --no-defaults, my_print_defaults.
VariablesSET GLOBAL → lost on restart · SET PERSIST → immediate + persistent · SET PERSIST_ONLY → read-only vars, applied on next restart · RESET PERSIST. Audit via performance_schema.variables_info.
Multi-InstanceRequires dedicated datadir, port, socket, pid-file, server_id per instance. Managed via mysqld_multi + [mysqldN] groups or systemd mysqld@N.
Persisted Config & Obfuscated Login
SET PERSIST max_connections = 500; SET PERSIST_ONLY innodb_log_file_size = 1073741824; SELECT VARIABLE_NAME, VARIABLE_SOURCE FROM performance_schema.variables_info WHERE VARIABLE_SOURCE = 'PERSISTED'; # ~/.mylogin.cnf (obfuscated) $ mysql_config_editor set --login-path=dba \ --user=root --host=localhost --password
Exam Pitfall: If the same option is repeated across files, the last read option takes precedence. mysqld-auto.cnf (SET PERSIST) is processed after all standard option files.
03

Security Hardening & RBAC

High Weight
TopicWhat You Need to Know
Accounts'user'@'host' — most specific host matches first. CREATE USER, ALTER USER, RENAME USER, DROP USER.
Auth PluginsDefault: caching_sha2_password. Legacy: mysql_native_password. auth_socket, sha256_password; Enterprise: LDAP, PAM, Kerberos.
RolesCREATE ROLE → GRANT role TO user. Roles are inactive by default: activate via SET DEFAULT ROLE or activate_all_roles_on_login=ON. mandatory_roles.
PrivilegesGlobal / DB / table / column / routine levels. Dynamic privileges: BACKUP_ADMIN, SYSTEM_VARIABLES_ADMIN, CLONE_ADMIN… partial_revokes, WITH GRANT OPTION.
Passwordscomponent_validate_password, PASSWORD EXPIRE, password_history, FAILED_LOGIN_ATTEMPTS + PASSWORD_LOCK_TIME, dual passwords: RETAIN CURRENT PASSWORD.
Transport SSLrequire_secure_transport=ON, REQUIRE SSL|X509, tls_version. SSL certificates auto-generated during data directory initialization.
Encryption (TDE)InnoDB TDE requires a keyring component/plugin. ENCRYPTION='Y', default_table_encryption, binlog_encryption, redo/undo encryption. ALTER INSTANCE ROTATE INNODB MASTER KEY.
OS & SQLiRun under OS user mysql, configure secure_file_priv, set local_infile=OFF. Mitigate SQLi with prepared statements. Enterprise Firewall: RECORDING → PROTECTING / DETECTING.
Role-Based Account Provisioning
CREATE ROLE 'app_ro'; GRANT SELECT ON shop.* TO 'app_ro'; CREATE USER 'ali'@'10.0.%' IDENTIFIED BY 'S3cr3t!' PASSWORD EXPIRE INTERVAL 90 DAY FAILED_LOGIN_ATTEMPTS 5 PASSWORD_LOCK_TIME 1; GRANT 'app_ro' TO 'ali'@'10.0.%'; SET DEFAULT ROLE ALL TO 'ali'@'10.0.%';
Exam Pitfall: In MySQL 8.0, GRANT ... IDENTIFIED BY cannot create users — you must run CREATE USER first. Older client libraries without caching_sha2 support fail to connect.
MySQL OCP 8.0 Exam Topic Map · Monitoring, Query Optimization & Backup
04

Monitoring & Maintenance Monitoring

TopicWhat You Need to Know
Error Loglog_error, log_error_verbosity (1–3, default 2), log_error_services (components for JSON sink).
General / Slow Loggeneral_log · slow_query_log, long_query_time (default 10s), log_queries_not_using_indexes, min_examined_row_limit. log_output=FILE|TABLE. Analysis: mysqldumpslow.
Binary LogEnabled by default in 8.0. binlog_format=ROW, binlog_expire_logs_seconds (30 days), PURGE BINARY LOGS, FLUSH BINARY LOGS.
AuditMySQL Enterprise Audit: audit_log plugin, JSON/XML formats, rule-based filtering with audit_log_filter_set_filter().
Threads & StatusSHOW PROCESSLIST, performance_schema.threads, sys.processlist, KILL [QUERY]. Status: Threads_connected, Threads_running, Aborted_connects, Max_used_connections.
Enterprise MonitorService Manager + Agent architecture, Advisors, events, Query Analyzer, real-time dashboards.
Capacity PlanningDATA_LENGTH + INDEX_LENGTH, DATA_FREE (I_S.TABLES), INNODB_TABLESPACES.FILE_SIZE, sys.schema_table_statistics; track historical growth trends.
Locksperformance_schema.data_locks / data_lock_waits (new in 8.0), metadata_locks, sys.innodb_lock_waits, innodb_lock_wait_timeout (50s), innodb_print_all_deadlocks.
Who is Blocking Whom?
SELECT waiting_pid, waiting_query, blocking_pid, blocking_query, wait_age, sql_kill_blocking_query FROM sys.innodb_lock_waits; -- Metadata lock (waiting for DDL): SELECT * FROM sys.schema_table_lock_waits; -- Recent deadlock information: SHOW ENGINE INNODB STATUS\G
Exam Pitfall: information_schema.INNODB_LOCKS and INNODB_LOCK_WAITS were removed in 8.0 → replaced by performance_schema.data_locks and data_lock_waits.
05

Query Optimization Optimizer & Indexes

TopicWhat You Need to Know
EXPLAIN VariantsEXPLAIN (tabular), FORMAT=JSON (costs), FORMAT=TREE (8.0.16), EXPLAIN ANALYZE (8.0.18 — actually executes the query).
OptimizerCost-based; mysql.server_cost / engine_cost. optimizer_switch, optimizer_trace, hints like /*+ INDEX(t idx) */, hash joins (8.0.18+).
8.0 Index FeaturesInvisible indexes (test before drop), descending indexes, functional indexes (8.0.13), histograms: ANALYZE TABLE t UPDATE HISTOGRAM ON c.
Index DesignClustered PK → secondary indexes append PK columns. Leftmost prefix rule, covering indexes, prefix indexing, FULLTEXT, SPATIAL.
Index Statisticsinnodb_stats_persistent=ON, innodb_stats_persistent_sample_pages (20), ANALYZE TABLE, mysql.innodb_index_stats, SHOW INDEX → Cardinality.
Query AnalysisMEM Query Analyzer, events_statements_summary_by_digest, sys.statements_with_full_table_scans, sys.schema_unused_indexes, sys.schema_redundant_indexes.
EXPLAIN type — from best to worst
systemconsteq_refreffulltextref_or_nullindex_mergeunique_subqueryindex_subqueryrangeindexALL
Extra ValueMeaning & Impact
Using indexCovering index — table row access avoided
Using index conditionICP (Index Condition Pushdown) — filter pushed to engine
Using filesortExtra sorting pass — ORDER BY not satisfied by index
Using temporaryTemporary table — GROUP BY / DISTINCT / UNION
Test Index Before Dropping
ALTER TABLE orders ALTER INDEX idx_old INVISIBLE; EXPLAIN ANALYZE SELECT * FROM orders WHERE cust_id = 42; CREATE INDEX idx_fx ON users ((LOWER(email)));
Exam Pitfall: Primary keys cannot be made invisible. Histograms are not indexes — they provide selectivity estimates for non-indexed columns and do not auto-update.
06

Backup & Recovery Logical & Physical

High Weight
ToolTypeKey Capabilities
mysqldumpLogical--single-transaction (consistent hot InnoDB backup), --source-data=2, --routines --events, --set-gtid-purged
mysqlpumpLogicalMulti-threaded (--default-parallelism); deprecated in 8.0.34
Shell util.*LogicaldumpInstance(), dumpSchemas(), loadDump() — multi-threaded, compressed, chunked
MEBPhysicalmysqlbackup: backup-and-apply-log, --incremental, backup-to-image, validate, copy-back · Hot for InnoDB
Raw / SnapshotPhysicalCold copy (server stopped), LVM/ZFS snapshots, transportable tablespaces: FLUSH TABLES t FOR EXPORT
CLONE pluginPhysical8.0.17+: CLONE INSTANCE FROM — provision new replica/cluster member in seconds
mysqlbinlogBinlog--read-from-remote-server --raw --stop-never for real-time remote binlog streaming
Core Concepts
Hot / Warm / ColdRead+write available / Read-only available / Server stopped
Full / Incr. / Diff.Entire database / Changes since last backup / Changes since last full backup
Logical vs PhysicalSQL statements, portable, slower restore / Raw file copy, fast restore, requires same OS/version
Point-in-Time Recovery (PITR)
$ mysqldump --single-transaction --source-data=2 \ --routines --events --all-databases > full.sql # 1) Restore full baseline backup $ mysql < full.sql # 2) Replay binary logs up to the exact incident timestamp $ mysqlbinlog --start-position=157 \ --stop-datetime="2026-10-13 09:59:59" \ binlog.000042 binlog.000043 | mysql
Exam Pitfall: --single-transaction does not guarantee consistency for MyISAM tables. In 8.0.26+, --master-data was renamed to --source-data.
MySQL OCP 8.0 Exam Topic Map · High Availability & Exam Preparation Plan
07

High Availability Replication · Group Replication · InnoDB Cluster

Highest Weight
Replication Architecture
Use CasesRead scale-out, failover targets, offloading backup overhead, geo-redundancy, analytics isolation.
ModesAsync (default), semi-sync (rpl_semi_sync_source plugin — requires ≥1 replica ACK), GTID or binlog coordinates.
TopologiesSource → replica, chained (relay; log_replica_updates), multi-source (FOR CHANNEL), circular.
ThreadsSource: binlog dump · Replica: receiver (I/O) → relay log → applier (SQL) → workers (replica_parallel_workers, LOGICAL_CLOCK).
PrerequisitesUnique server_id, binary log enabled, dedicated user with REPLICATION SLAVE, for GTID: gtid_mode=ON + enforce_gtid_consistency=ON.
MonitoringSHOW REPLICA STATUS\G: Replica_IO_Running, Replica_SQL_Running, Seconds_Behind_Source, Last_SQL_Error. P_S: replication_connection_status, replication_applier_status_by_worker.
TroubleshootingSkip an errant GTID: inject an empty transaction matching the failed GTID. sql_replica_skip_counter only works when GTID is OFF. Broken replica → reseed with CLONE.
GTID Replication Setup (8.0.23+ syntax)
CHANGE REPLICATION SOURCE TO SOURCE_HOST='db1', SOURCE_USER='repl', SOURCE_PASSWORD='***', SOURCE_AUTO_POSITION=1, SOURCE_SSL=1; START REPLICA; -- Skip errant GTID transaction: STOP REPLICA; SET GTID_NEXT='uuid:1234'; BEGIN; COMMIT; SET GTID_NEXT='AUTOMATIC'; START REPLICA;
Group Replication & InnoDB Cluster
Group ReplicationPaxos-based (XCom) group communication; single-primary (default) or multi-primary mode. Certification-based conflict detection.
GR RequirementsInnoDB only, Primary Key on every table, GTID enabled, binlog_format=ROW, group communication port 33061.
Quorumn = 2f + 1 → 3 members tolerate 1 failure, 5 members tolerate 2 failures. Maximum 9 members.
InnoDB ClusterGroup Replication + MySQL Shell (AdminAPI) + MySQL Router. Router default ports: 6446 RW / 6447 RO (classic), 6448/6449 (X).
RecoveryDistributed recovery: incremental via binary logs or automatic CLONE. Full outage recovery: dba.rebootClusterFromCompleteOutage(). Loss of quorum: forceQuorumUsingPartitionOf().
Companion SolutionsInnoDB ReplicaSet (8.0.19+, async, manual failover), InnoDB ClusterSet (8.0.27+, multi-cluster disaster recovery).
MySQL Shell — AdminAPI (JS mode)
dba.checkInstanceConfiguration('admin@db1:3306') dba.configureInstance('admin@db1:3306') var c = dba.createCluster('prodCluster') c.addInstance('admin@db2:3306', {recoveryMethod: 'clone'}) c.status() // ONLINE / RECOVERING / UNREACHABLE c.setPrimaryInstance('db2:3306') c.rejoinInstance('db3:3306') $ mysqlrouter --bootstrap admin@db1:3306 --user=mysqlrouter
Exam Pitfall: Terminology transitioned between 8.0.22 and 8.0.26: MASTER→SOURCE, SLAVE→REPLICA. Both legacy and modern syntax may appear in questions — recognize both.
08

Exam Preparation Checklist

Set up lab: 3-node VM/Docker with InnoDB Clusterdba.createCluster → addInstance → RouterCritical
PITR rehearsal: restore dump + replay binlogmysqldump → mysqlbinlog --stop-datetimeCritical
Break & fix replicationduplicate key → empty GTID tx → START REPLICACritical
User & role scenariosroles inactive by default → SET DEFAULT ROLECritical
Option file precedence & SET PERSISTmy_print_defaults mysqldImportant
Read EXPLAIN output: type + ExtraEXPLAIN FORMAT=TREE / ANALYZEImportant
Lock triage (row + metadata locks)sys.innodb_lock_waitsImportant
TDE + keyring configurationALTER TABLE t ENCRYPTION='Y'Important
Enterprise tools conceptual understandingMEB · MEM · Audit · FirewallRecommended
Memorize crucial default valuesports 3306/33060/33061 · 6446/6447Recommended
Critical Must practice hands-on Important Practice at least once Recommended Understand conceptually
Strategy: Pay close attention to "Choose two" or "Choose three" prompts. Eliminate obvious false choices first; focus on version-specific features (8.0.x) and default values.
Time Constraint: 1Z0-908 retires on November 16, 2026. For subsequent cycles, follow Oracle's updated MySQL DBA learning path.
09

Essential Default Values to Memorize MySQL 8.0 defaults

Network & ConnectionsDefault
port3306
mysqlx_port33060
group_replication (XCom)33061
Router RW / RO (classic)6446 / 6447
max_connections151
wait_timeout28800s
default_authentication_plugincaching_sha2_password
InnoDB EngineDefault
innodb_buffer_pool_size128M
innodb_page_size16K
innodb_file_per_tableON
innodb_flush_log_at_trx_commit1
innodb_lock_wait_timeout50s
innodb_autoinc_lock_mode2 (interleaved)
transaction_isolationREPEATABLE-READ
Logs, Binlog & Character SetDefault
log_binON
binlog_formatROW
binlog_expire_logs_seconds2592000 (30 days)
sync_binlog1
long_query_time10s
gtid_modeOFF
character_set_serverutf8mb4 · utf8mb4_0900_ai_ci