使用的命令: db2 list tablespaces show detail db2 list tablespace containers for [Tablespace ID] [show detail] 说明:在语句末尾添加show detail,则能查看表空间大小以及使用的信息 以下是具体实现案例: 在日常使用db2的过程中,有时候我们需要查询db2表空间所存储的位置来判断磁盘空间是否还够用,下面为查询表空间TEMPTS16K的位置 db2inst1@Linux:/opt> db2 li
默认DB2 缓冲池信息监控是OFF, 需要开启(DB2表空间是由缓冲池分配的) CollBufferpool : ============ The CollBufferpool collector collects information for the DB2UDB_BUFFERPOOL application class and provides the values for monitoring DB2 buffer pools. Note: For the CollBufferpool
--尽量少用触发器,否则数据库增长很快,特别是关于登陆的数据表字段不要用出发器,一周左右能使得数据库增长1G的空间. --数据库表空间大小查询脚本 IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[#Data]') AND type in (N'U'))DROP TABLE [dbo].[#Data] create table #Data(name varchar(100),row varchar
DB2表空间扩容 1 - Detect what tablespace has size issues db2 list tablespaces show detail 2 - Check the percentage of use from the tablespace db2 list tablespace containers for <tablespace_id> show detail 3 - Calculating the size of free space needed Now
Db2 connect to xxx Db2 “LIST TABLESPACES SHOW DETAIL” Tablespace ID = 7 Name = TSASNAA Type = Database managed space Contents = All permanent data. Large table space. State = 0x0000 Detailed explanation:[@more@] Normal Total pages = 14800 Useable pag
DB2的备份恢复有点坑,当源系统和目标系统的路径设置不同时,要手动进行重定向恢复,本文是我一次实战操作之后总结的过程,仅供参考. 一.发出重定向恢复命令 DB2 RESTORE DB TO "C:" INTO NEWDB REDIRECT 其中,OLDDB是旧数据库.备份的数据库名称,NEWDB是新数据库名称,不用事先创建也可以,C:\OLDDBbak是备份文件放置的目录,20150717164847是 备份文件的时间戳,具体可看备份文件的名字OLDDB.0.DB2.NODE0000.
-- Create the user create user lesdba identified by les_321 default tablespace USERS temporary tablespace TEMP profile DEFAULT password expire;-- Grant/Revoke role privileges grant connect to lesdba;grant dba to lesdba;grant resource to lesdba;-- Gra
话不多说,直接上运行计划: SQL> set lines 500; SQL> set pagesize 9999; SQL> set long 9999; SQL> select * from table(dbms_xplan.display_cursor('41348610',null,'advanced')); PLAN_TABLE_OUTPUT ------------------------------------------------------------------
直接上语句 查所有数据库占用空间大小 select TABLE_SCHEMA, concat(truncate(sum(data_length)/1024/1024,2),' MB') as data_size, concat(truncate(sum(index_length)/1024/1024,2),'MB') as index_size from information_schema.tables group by TABLE_SCHEMA order by data_length de
创建用户和表空间: 1.登录linux,以oracle用户登录(如果是root用户登录的,登录后用 su - oracle命令切换成oracle用户) 2.以sysdba方式来打开sqlplus,命令如下: sqlplus / as sysdba 3.创建临时表空间: --查询临时表空间文件的绝对路径.如果需要的话,可以通过查询来写定绝对路径.一般用${ORACLE_HOME}就可以了 select name from v$tempfile; create temporary tablespac