GNU/Linux >> Linux Esercitazione >  >> Panels >> Plesk

Come trovare tabelle di grandi dimensioni nel database SQL

Come trovare tabelle di grandi dimensioni nel database MS SQL
Se il database sembra essere più grande di quanto ti aspetti, questo articolo ti mostrerà come visualizzare un elenco delle tabelle del database MS SQL in ordine di dimensione ed elencare la dimensione associata della tabella.

Questa procedura richiede l'installazione di Microsoft SQL Server Management Studio sul computer. Microsoft SQL Server Mangement Studio Express 2014 è disponibile gratuitamente da Microsoft e può essere scaricato tramite questo collegamento:http://www.microsoft.com/en-us/download/details.aspx?id=42299 (fare clic su Scarica e selezionare MgmtStudio 32 bit o 64 bit, in base al processore del tuo computer)

SQL Server Management Studio

  1. Apri e accedi a Microsoft SQL Server Management Studio
  2. Fai clic con il pulsante destro del mouse sul database
  3. Passa il mouse sopra Rapporti
  4. Passa il mouse sopra Rapporti standard
  5. Seleziona Utilizzo disco in base alle tabelle principali

Query SQL

  1. Apri e accedi a Microsoft SQL Server Management Studio
  2. Fai clic su Nuova query pulsante
  3. Copia il seguente script nella pagina Nuova query sostituendo [DatabaseName] con il nome del tuo database USE [DatabaseName] GO CREATE TABLE # temp ( table_name sysname , row_count INT , reserved_size VARCHAR (50), data_size VARCHAR (50), index_size VARCHAR (50), unused_size VARCHAR (50)) SET NOCOUNT ON INSERT # temp EXEC sp_msforeachtable 'sp_spaceused ' '?' '' SELECT a.table_name, a.row_count, COUNT (*) AS col_count, a.data_size FROM # temp a INNER JOIN information_schema.columns b ON a.table_name collate database_default = b.table_name collate database_default GROUP BY a.table_name, a.row_count, a.data_size ORDER BY CAST ( REPLACE (a.data_size, ' KB' , '' ) AS integer ) DESC DROP TABLE # temp
  4. Fai clic su Esegui pulsante


Plesk
  1. Come copiare tabelle MySQL tra database

  2. Come eseguire il backup e il ripristino del database Postgres

  3. Come modificare il livello di compatibilità del database SQL

  4. Come modificare i campi nelle tabelle del database con phpMyAdmin

  5. Come eseguire query SQL su un database con phpMyAdmin

Come riparare un database MySQL?

Come ottimizzare un database MySQL?

Come importare il mio file .sql in un database PostgreSQL?

Come creare un backup del database SQL con script

Come ripristinare manualmente un database MSSQL in SQL Management Studio (SSMS)

Come ripristinare un database MySQL da .SQL Backup