diff --git a/core/lib/Drupal/Core/Database/Connection.php b/core/lib/Drupal/Core/Database/Connection.php
index 803689b..abecfd6 100644
--- a/core/lib/Drupal/Core/Database/Connection.php
+++ b/core/lib/Drupal/Core/Database/Connection.php
@@ -523,7 +523,7 @@ public function makeComment($comments) {
    *
    * For example, the comment:
    * @code
-   * db_update('example')
+   * \Drupal::database()->update('example')
    *  ->condition('id', $id)
    *  ->fields(array('field2' => 10))
    *  ->comment('Exploit * / DROP TABLE node; --')
diff --git a/core/lib/Drupal/Core/Database/database.api.php b/core/lib/Drupal/Core/Database/database.api.php
index 45a5618..00134a2 100644
--- a/core/lib/Drupal/Core/Database/database.api.php
+++ b/core/lib/Drupal/Core/Database/database.api.php
@@ -190,7 +190,7 @@
  *   // The transaction is still open here.
  *
  *   if ($id % 2 == 0) {
- *     db_update('example')
+ *     \Drupal::database()->update('example')
  *       ->condition('id', $id)
  *       ->fields(array('field2' => 10))
  *       ->execute();
diff --git a/core/lib/Drupal/Core/Entity/entity.api.php b/core/lib/Drupal/Core/Entity/entity.api.php
index 5387c7e..19d4161 100644
--- a/core/lib/Drupal/Core/Entity/entity.api.php
+++ b/core/lib/Drupal/Core/Entity/entity.api.php
@@ -991,7 +991,7 @@ function hook_ENTITY_TYPE_insert(Drupal\Core\Entity\EntityInterface $entity) {
  */
 function hook_entity_update(Drupal\Core\Entity\EntityInterface $entity) {
   // Update the entity's entry in a fictional table of all entities.
-  db_update('example_entity')
+  \Drupal::database()->update('example_entity')
     ->fields([
       'updated' => REQUEST_TIME,
     ])
@@ -1015,7 +1015,7 @@ function hook_entity_update(Drupal\Core\Entity\EntityInterface $entity) {
  */
 function hook_ENTITY_TYPE_update(Drupal\Core\Entity\EntityInterface $entity) {
   // Update the entity's entry in a fictional table of this type of entity.
-  db_update('example_entity')
+  \Drupal::database()->update('example_entity')
     ->fields([
       'updated' => REQUEST_TIME,
     ])
diff --git a/core/modules/aggregator/src/Tests/AggregatorCronTest.php b/core/modules/aggregator/src/Tests/AggregatorCronTest.php
index 9ebb2d2..aab7de0 100644
--- a/core/modules/aggregator/src/Tests/AggregatorCronTest.php
+++ b/core/modules/aggregator/src/Tests/AggregatorCronTest.php
@@ -24,7 +24,7 @@ public function testCron() {
 
     // Test feed locking when queued for update.
     $this->deleteFeedItems($feed);
-    db_update('aggregator_feed')
+    \Drupal::database()->update('aggregator_feed')
       ->condition('fid', $feed->id())
       ->fields([
         'queued' => REQUEST_TIME,
@@ -32,7 +32,7 @@ public function testCron() {
       ->execute();
     $this->cronRun();
     $this->assertEqual(0, db_query('SELECT COUNT(*) FROM {aggregator_item} WHERE fid = :fid', [':fid' => $feed->id()])->fetchField());
-    db_update('aggregator_feed')
+    \Drupal::database()->update('aggregator_feed')
       ->condition('fid', $feed->id())
       ->fields([
         'queued' => 0,
diff --git a/core/modules/aggregator/src/Tests/UpdateFeedItemTest.php b/core/modules/aggregator/src/Tests/UpdateFeedItemTest.php
index 67e96f1..bdef06b 100644
--- a/core/modules/aggregator/src/Tests/UpdateFeedItemTest.php
+++ b/core/modules/aggregator/src/Tests/UpdateFeedItemTest.php
@@ -49,7 +49,7 @@ public function testUpdateFeedItem() {
 
     // Sleep for 3 second.
     sleep(3);
-    db_update('aggregator_feed')
+    \Drupal::database()->update('aggregator_feed')
       ->condition('fid', $feed->id())
       ->fields([
         'checked' => 0,
diff --git a/core/modules/file/src/Tests/FileFieldRevisionTest.php b/core/modules/file/src/Tests/FileFieldRevisionTest.php
index 7de496f..5bab905 100644
--- a/core/modules/file/src/Tests/FileFieldRevisionTest.php
+++ b/core/modules/file/src/Tests/FileFieldRevisionTest.php
@@ -112,7 +112,7 @@ public function testRevisions() {
     // Call file_cron() to clean up the file. Make sure the changed timestamp
     // of the file is older than the system.file.temporary_maximum_age
     // configuration value.
-    db_update('file_managed')
+    \Drupal::database()->update('file_managed')
       ->fields([
         'changed' => REQUEST_TIME - ($this->config('system.file')->get('temporary_maximum_age') + 1),
       ])
@@ -128,7 +128,7 @@ public function testRevisions() {
     // Call file_cron() to clean up the file. Make sure the changed timestamp
     // of the file is older than the system.file.temporary_maximum_age
     // configuration value.
-    db_update('file_managed')
+    /\Drupal::database()->update('file_managed')
       ->fields([
         'changed' => REQUEST_TIME - ($this->config('system.file')->get('temporary_maximum_age') + 1),
       ])
diff --git a/core/modules/file/tests/src/Kernel/DeleteTest.php b/core/modules/file/tests/src/Kernel/DeleteTest.php
index 3b868c0..c139d41 100644
--- a/core/modules/file/tests/src/Kernel/DeleteTest.php
+++ b/core/modules/file/tests/src/Kernel/DeleteTest.php
@@ -55,7 +55,7 @@ public function testInUse() {
     // Call file_cron() to clean up the file. Make sure the changed timestamp
     // of the file is older than the system.file.temporary_maximum_age
     // configuration value.
-    db_update('file_managed')
+    \Drupal::database()->update('file_managed')
       ->fields([
         'changed' => REQUEST_TIME - ($this->config('system.file')->get('temporary_maximum_age') + 1),
       ])
diff --git a/core/modules/file/tests/src/Kernel/UsageTest.php b/core/modules/file/tests/src/Kernel/UsageTest.php
index 672de0f..fc84e3c 100644
--- a/core/modules/file/tests/src/Kernel/UsageTest.php
+++ b/core/modules/file/tests/src/Kernel/UsageTest.php
@@ -127,7 +127,7 @@ public function testRemoveUsage() {
   public function createTempFiles() {
     // Temporary file that is old.
     $temp_old = file_save_data('');
-    db_update('file_managed')
+    \Drupal::database()->update('file_managed')
       ->fields([
         'status' => 0,
         'changed' => REQUEST_TIME - $this->config('system.file')->get('temporary_maximum_age') - 1,
@@ -138,7 +138,7 @@ public function createTempFiles() {
 
     // Temporary file that is new.
     $temp_new = file_save_data('');
-    db_update('file_managed')
+    \Drupal::database()->update('file_managed')
       ->fields(['status' => 0])
       ->condition('fid', $temp_new->id())
       ->execute();
@@ -146,7 +146,7 @@ public function createTempFiles() {
 
     // Permanent file that is old.
     $perm_old = file_save_data('');
-    db_update('file_managed')
+    \Drupal::database()->update('file_managed')
       ->fields(['changed' => REQUEST_TIME - $this->config('system.file')->get('temporary_maximum_age') - 1])
       ->condition('fid', $temp_old->id())
       ->execute();
diff --git a/core/modules/locale/locale.translation.inc b/core/modules/locale/locale.translation.inc
index 571f7d2..8dd2552 100644
--- a/core/modules/locale/locale.translation.inc
+++ b/core/modules/locale/locale.translation.inc
@@ -342,7 +342,7 @@ function locale_cron_fill_queue() {
 
     // Update the last_checked timestamp of the project+language that will
     // be checked for updates.
-    db_update('locale_file')
+    \Drupal::database()->update('locale_file')
       ->fields(['last_checked' => REQUEST_TIME])
       ->condition('project', $file->project)
       ->condition('langcode', $file->langcode)
diff --git a/core/modules/locale/src/Tests/LocaleUpdateCronTest.php b/core/modules/locale/src/Tests/LocaleUpdateCronTest.php
index 78a14ec..b994fab 100644
--- a/core/modules/locale/src/Tests/LocaleUpdateCronTest.php
+++ b/core/modules/locale/src/Tests/LocaleUpdateCronTest.php
@@ -47,7 +47,7 @@ public function testUpdateCron() {
 
     // Prepare for test: Simulate that the file has not been checked for a long
     // time. Set the last_check timestamp to zero.
-    $query = db_update('locale_file');
+    $query = \Drupal::database()->update('locale_file');
     $query->fields(['last_checked' => 0]);
     $query->condition('project', 'contrib_module_two');
     $query->condition('langcode', 'de');
diff --git a/core/modules/node/src/Tests/NodeAdminTest.php b/core/modules/node/src/Tests/NodeAdminTest.php
index 8bf54cc..9348b18 100644
--- a/core/modules/node/src/Tests/NodeAdminTest.php
+++ b/core/modules/node/src/Tests/NodeAdminTest.php
@@ -69,7 +69,7 @@ public function testContentAdminSort() {
     foreach (['dd', 'aa', 'DD', 'bb', 'cc', 'CC', 'AA', 'BB'] as $prefix) {
       $changed += 1000;
       $node = $this->drupalCreateNode(['title' => $prefix . $this->randomMachineName(6)]);
-      db_update('node_field_data')
+      \Drupal::database()->update('node_field_data')
         ->fields(['changed' => $changed])
         ->condition('nid', $node->id())
         ->execute();
diff --git a/core/modules/node/src/Tests/NodeBlockFunctionalTest.php b/core/modules/node/src/Tests/NodeBlockFunctionalTest.php
index 5a2e40a..77db887 100644
--- a/core/modules/node/src/Tests/NodeBlockFunctionalTest.php
+++ b/core/modules/node/src/Tests/NodeBlockFunctionalTest.php
@@ -70,13 +70,13 @@ public function testRecentNodeBlock() {
     $node3 = $this->drupalCreateNode($default_settings);
 
     // Change the changed time for node so that we can test ordering.
-    db_update('node_field_data')
+    \Drupal::database()->update('node_field_data')
       ->fields([
         'changed' => $node1->getChangedTime() + 100,
       ])
       ->condition('nid', $node2->id())
       ->execute();
-    db_update('node_field_data')
+    \Drupal::database()->update('node_field_data')
       ->fields([
         'changed' => $node1->getChangedTime() + 200,
       ])
diff --git a/core/modules/node/src/Tests/NodeRevisionsTest.php b/core/modules/node/src/Tests/NodeRevisionsTest.php
index 1982266..449a779 100644
--- a/core/modules/node/src/Tests/NodeRevisionsTest.php
+++ b/core/modules/node/src/Tests/NodeRevisionsTest.php
@@ -200,7 +200,7 @@ public function testRevisions() {
     // Set the revision timestamp to an older date to make sure that the
     // confirmation message correctly displays the stored revision date.
     $old_revision_date = REQUEST_TIME - 86400;
-    db_update('node_revision')
+    \Drupal::database()->update('node_revision')
       ->condition('vid', $nodes[2]->getRevisionId())
       ->fields([
         'revision_timestamp' => $old_revision_date,
diff --git a/core/modules/path/path.api.php b/core/modules/path/path.api.php
index df20b95..429c1e1 100644
--- a/core/modules/path/path.api.php
+++ b/core/modules/path/path.api.php
@@ -39,7 +39,7 @@ function hook_path_insert($path) {
  */
 function hook_path_update($path) {
   if ($path['alias'] != $path['original']['alias']) {
-    db_update('mytable')
+    \Drupal::database()->update('mytable')
       ->fields(['alias' => $path['alias']])
       ->condition('pid', $path['pid'])
       ->execute();
diff --git a/core/modules/search/search.module b/core/modules/search/search.module
index ae99a87..8eeb41c 100644
--- a/core/modules/search/search.module
+++ b/core/modules/search/search.module
@@ -571,7 +571,7 @@ function search_index($type, $sid, $langcode, $text) {
  *   $type and $sid is marked.
  */
 function search_mark_for_reindex($type = NULL, $sid = NULL, $langcode = NULL) {
-  $query = db_update('search_dataset')
+  $query = \Drupal::database()->update('search_dataset')
     ->fields(['reindex' => REQUEST_TIME])
     // Only mark items that were not previously marked for reindex, so that
     // marked items maintain their priority by request time.
diff --git a/core/modules/tracker/tracker.module b/core/modules/tracker/tracker.module
index dbde704..24078c5 100644
--- a/core/modules/tracker/tracker.module
+++ b/core/modules/tracker/tracker.module
@@ -269,7 +269,7 @@ function _tracker_add($nid, $uid, $changed) {
     ])
     ->execute();
   // Update the times for all the other users tracking the post.
-  db_update('tracker_user')
+  \Drupal::database()->update('tracker_user')
     ->condition('nid', $nid)
     ->fields([
       'changed' => $changed,
@@ -353,14 +353,14 @@ function _tracker_remove($nid, $uid = NULL, $changed = NULL) {
 
       // And then we push the out the new changed timestamp to our denormalized
       // tables.
-      db_update('tracker_node')
+      \Drupal::database()->update('tracker_node')
         ->fields([
           'changed' => $changed,
           'published' => $node->isPublished(),
         ])
         ->condition('nid', $nid)
         ->execute();
-      db_update('tracker_node')
+      \Drupal::database()->update('tracker_node')
         ->fields([
           'changed' => $changed,
           'published' => $node->isPublished(),
diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php
index 364dd1a..6f509d8 100644
--- a/core/modules/user/user.api.php
+++ b/core/modules/user/user.api.php
@@ -55,7 +55,7 @@ function hook_user_cancel($edit, $account, $method) {
         ->execute();
       node_mass_update($nodes, ['uid' => 0], NULL, TRUE);
       // Anonymize old revisions.
-      db_update('node_field_revision')
+      \Drupal::database()->update('node_field_revision')
         ->fields(['uid' => 0])
         ->condition('uid', $account->id())
         ->execute();
