Jan*_*Jan 5 sql-server storage azure-sql-database tempdb
我们在 S3 层上运行 V12 Azure 数据库实例。数据库上仍有大约 100GB 的可用空间。当使用在不同的非 azure SQL 服务器上运行的 SSIS 加载 85MB XML 文件,并将其直接插入到 azure 数据库中时,插入会在目标数据库上崩溃,并出现以下错误。
数据库“tempdb”已达到其大小配额。对数据进行分区或删除、删除索引或查阅文档以获取可能的解决方案。
tempdb 是否有任何限制或者知道为什么这可能会崩溃?85MB 的文件不可能填满数据库的剩余空间。似乎tempdb
隐藏起来了,我如何监控它的使用情况?
小智 1
您可以运行以下命令来检索有关哪些任务(在 Azure V12 数据库中)正在使用 Tempdb(从您的 userDB 运行)的信息:
\n\nSELECT es.host_name , es.login_name , es.program_name\n , st.dbid as QueryExecContextDBID, DB_NAME(st.dbid) as QueryExecContextDBNAME\n , st.objectid as ModuleObjectId\n , SUBSTRING(st.text, er.statement_start_offset/2 + 1\n ,(CASE WHEN er.statement_end_offset = -1 \n THEN LEN(CONVERT(nvarchar(max),st.text))*2 \n ELSE er.statement_end_offset\n END - er.statement_start_offset)/2\n ) as Query_Text\n , tsu.session_id ,tsu.request_id, tsu.exec_context_id\n , (tsu.user_objects_alloc_page_count - tsu.user_objects_dealloc_page_count) as OutStanding_user_objects_page_counts\n ,\xc2\xa0(tsu.internal_objects_alloc_page_count - tsu.internal_objects_dealloc_page_count) as OutStanding_internal_objects_page_counts\n ,\xc2\xa0er.start_time, er.command, er.open_transaction_count\n , er.percent_complete, er.estimated_completion_time\n , er.cpu_time, er.total_elapsed_time, er.reads,er.writes\n , er.logical_reads, er.granted_query_memory\xc2\xa0\nFROM tempdb.sys.dm_db_task_space_usage tsu\xc2\xa0\xc2\xa0\nJOIN sys.dm_exec_requests er \n ON tsu.session_id = er.session_id \n AND tsu.request_id = er.request_id\xc2\xa0\xc2\xa0\nJOIN sys.dm_exec_sessions es \n ON tsu.session_id = es.session_id \xc2\xa0\xc2\xa0\nCROSS APPLY sys.dm_exec_sql_text(er.sql_handle) st\xc2\xa0\nWHERE (tsu.internal_objects_alloc_page_count \n +tsu.user_objects_alloc_page_count) > 0\xc2\xa0\nORDER BY (tsu.user_objects_alloc_page_count -\n tsu.user_objects_dealloc_page_count)\n + (tsu.internal_objects_alloc_page_count - \n tsu.internal_objects_dealloc_page_count) DESC\xc2\xa0\xc2\xa0\n
Run Code Online (Sandbox Code Playgroud)\n