SQL占用TEMP
--16指的是blocksizeselect distinct tu.username,machine,sid,tablespace,blocks*16/1024 "USE(MB)",segtype,tu.sql_id,sql_textfrom(select username,session_addr,sqladdr,sqlhash,sql_id,tablespace,sum(blocks)...
TEMP表空间使用率
11G下:select tablespace_name,round(free_space/1024/1024/1024,2) "free(GB)",round(tablespace_size/1024/1024/1024,2) "total(GB)",round(nvl(free_space,0)*100/tablespace_size,3) "Free percent"from dba_t...
重新创建undotbs
1 SQL>startuo mount2 SQL>alter system set undo_management=manual scope=spfile;3 SQL>shutdown4 SQL>startup mount;5 SQL> alter database datafile '/home/oracle/oracle/oradata/star/undotbs01.dbf' off...
ora-01031
[oracle@oracle ~]$ sqlplus / as sysdbaORA-01031: insufficient privileges[oracle@oracle ~]$ sqlplus sys/oracle as sysdbaConnected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Pr...
asm新增加diskgroup不能自动mount
需要在pfile里写入新增加的diskgroupvi /home/oracle/oracle/product/10.2.0/db_1/dbs/init+ASM2.orasm_diskgroups='ORADATA','FLASHDATA','ARCHIVEDATA'archivedata为create diskgroup
ORA 01506
RAC启动ASM的时候提示:SQL> startupORA-01506: missing or illegal database name cat $ORACLE_HOME/dbs/init+ASM1.ora的时候发现是空值 从rac2的机器上scp $ORACLE_HOME/dbs/init+ASM2.ora rac1:$...
srvctl错误libpthread.so.0
即使将CRS_HOME/bin/srvctl中ASSUM注释掉,依然报错[oracle@rac1 bin]$ which srvctl~/oracle/product/10.2.0/db_1/bin/srvctl发现srvctl的目录是在db_1下更改.bash_profile,将CRS_HOME/bin至于ORACLE_HOME/bin之...
asm删除磁盘组的磁盘及磁盘组本身
asm删除磁盘组的磁盘及磁盘组本身 export ORALCE_SID=+ASM sqlplus /nolog conn /as sysdba; alter diskgroup asmdata dismount;SQL>create diskgroup asmdata disk '/dev/raw/raw1' name ASM01,'/dev/raw/raw2...
查看归档日志内容
1 更改初始化文件 alter system set utl_file_dir=xxx scope=spfile;2 生成数据字典文件 begin dbms_logmnr_d.build( dictionary_filename => 'log.txt', dictionary_l...
oracle归档日志清除
RMAN操作:1 rman target /2 delete archivelog all;(删除所有日志) delete archivelog all completed before 'sysdate-7';(删除7天前日志) delete archivelog from time 'sysdate-7';(删除7天前到现在...
rownum
在oracle中,按特定条件查询前N条记录,用个rownum就搞定了。select * from emp where rownum<=5而且书中也告诫,不能对rownum用">",这也就意味着,如果你想用select * from emp where rownum>5则是失败的rownum背后...
rman基本优化
1 oracle数据库的优化 1 设置larger pool参数 alter system set large_pool_size=64m; 2 如果存在增量备份的话,为了提高数据库增量备份的性能,建议开启数据块变化跟踪的功能 alte...
oracle回收站基本应用
oracle 10G有一个好功能,就是recycle,这个东西可以帮助我们找回删除掉得table,就像windows的回收站一样,而且比windows的回收站更高级,就是当表空间不够时,oracle会自动去清理回收站查看回收站: show rec...
分区索引分类及创建
分区索引分2大类: 1 把索引信息建立在各个分区上,这叫局部索引分区 2 把索引集中起来,叫全局索引global索引 1 索引信息的存放位置与父表的partition(分区)信息完全不想干,设置父表是不是分区表...
释放undo表空间
1 查看undo表空间使用情况 select tablespace_name,bytes/1024/1024 from dba_data_files where tablespace_name='UNDOTBS1.DBF';2 创建新的undo表空间 create undo tablespace xxx;3 更改参数文件&nbs...
分区表其他操作
添加一个分区alter table part_tablename add partition part_name values less than(xxx) tablespace xxx;查询一个分区select * from part_tablename partition (part_name);修改分区里的数据update part_tabl...
SP2-0612
SP2-0612: 生成 AUTOTRACE STATISTICS 报告时出错方法:SQL>alter system set O7_DICTIONARY_ACCESSIBILITY=true scope=spfile;SQL>grant all on plan_table to public;SQL>grant select any table to test;SQL>gra...
分区表创建
范围分区表创建:create table part_test(id int,name varchar2(50))partition by range(id)( partition part_1 values less than(10) tablespace xxx, partition part_2 values less than(20) tablespac...
分区表的类别
分区表类型:范围分区 范围分区就是对数据表中的某个值的范围进行分区,根据某个值的范围,决定将该数据存储在哪个分区上,如根据业务记录的创建日期进行分区等hash分区(散列分区) 散列分区是通过分区编...
oracle 表空间利用率
表空间使用select d.tablespace_name,(d.bytes-f.bytes)/1024/1024 used from (select tablespace_name,sum(bytes) bytes from dba_free_space group by tablespace_name) f,(select tablespace_name,sum(bytes) byt...