使用_allow_resetlogs_corruption隐藏参数跳过数据库一致性检查
SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;System altered.SQL> shutdown immediateORA-01109: database not openDatabase dismounted.ORACLE instance shut down.SQL> startup mount;ORACLE instance started.Total System Global Area 432013312 bytesFixed Size 2021344 bytesVariable Size 150997024 bytesDatabase Buffers 276824064 bytesRedo Buffers 2170880 bytesDatabase mounted.SQL> alter database open resetl
ORA-39142 incompatible version
今天在将oracle11g的数据导入到oracle10g的时候,出现了如下错误.ORA-39142 incompatible version 错误!!![oracle@oracle10g u01]$ impdp meso/oracle directory=temp_dir dumpfile=meso.dmp Import: Release 1...
gather stats的小程序
create or replace procedure get_table_history_statsisbegin dbms_stats.gather_schema_stats(ownname=>'HISSAAS'); insert into table_history_stats select table_name,num_rows,BLOCKS,empty_blocks,AVG_SPACE,avg_row_len, to_date(to_char(sysdate,'yyyy/mm/dd'),'yyyy/mm/dd') from user_tables where num_rows<>0; commit; end get_table_history_stats;[@more@]
oracle创建定时任务之dbms_job
先定义jobvariable job number然后在执行如下语句begin sys.dbms_job.submit(job=>:job, what=>'get_table_history_stats;', next_date=>to_date('17-10-2012 06:09:00','dd-mm-yyyy hh24:mi:ss'), interval=>'sysdate+1'); commit;end;[@more@]
隐藏参数查询和dictionary view
1.查询隐藏参数SQL> alter session set sql_trace=true;Session altered.SQL> show parameter db_nameNAME TYPE VALUE------------------------------------ ---------------------- ------------------------------db_name string testSQL> alter session set sql_trace=false;Session altered.查看trace文件D:appdiagrdbmstesttesttrace>tkprof test_ora_5816.trc abcd.txtTKPROF: Release 11.2.0.1.0 - Developme
查看数据库中tablespace和datafile的使用情况。
by tablespace(使用单位G):select a.tablespace_name,(all_size-b.unuse_size) use_size,b.unuse_size,a.all_size,round((a.all_size-b.unuse_size)/a.all_size,2) usage from (select tablespace_name,round(sum(bytes)/1024/1024/1024,2) all_size from dba_data_files group by tablespace_name) a,(select tablespace_name,round(sum(bytes)/1024/1024/1024,2) unuse_size from dba_free_space group by tablespace_name) bwhere a.tablespace_name=b.tablespace_nameby datafile(使用单位G):select a.tablespace_name,a.file_name,(
oracle11gR2 Timed out waiting for the CRS stack to start
今天在vmserver+linux5.4上折腾oracle11gR2 RAC,发现总是出现Timed out waiting for the CRS stack to start这个错误。最开始的时候有在虚拟机中加入了disk.locking = "false" diskLib.dataCacheMaxSize = "0" diskLib.dataCacheMaxReadAheadSize = "0" diskLib.dataCacheMinReadAheadSize = "0" diskLib.dataCachePageSize = "4096" diskLib.maxUnsyncedWrites = "0"后来在虚拟机中加入:scsi1.sharedBus = "VIRTUAL"就可以了。然后执行/u01/app/11.2.0/grid/crs/
安装oracle10g 检查条件一直卡在88%
今天在redhat linux 5.4安装oracle10g 检查条件的时候一直卡在88%上,原来/etc/hosts文件中间ip和电脑名称写反了。本来是: ip 电脑名称,写成了: 电脑名称 ip 所以一直卡在哪里。[@more@]
oracle instance and listener自动启动
(1).[root@DbEsb-12 ~]# vi /etc/oratab #esbdb:/opt/oracle/product/11.2.0/dbhome_1:N将"N"修改为"Y"esbdb:/opt/oracle/product/11.2.0/dbhome_1:Y(2).[oracle@DbEsb-12 ~]$ vi /opt/oracle/product/11.2.0/dbhome_1/bin/dbstart将 ORACLE_HOME_LISTNER=$1修改为:ORACLE_HOME_LISTNER=$ORACLE_HOME[oracle@DbEsb-12 ~]$ vi /opt/oracle/product/11.2.0/dbhome_1/bin/dbshut将 ORACLE_HOME_LISTNER=$1修改为:ORACLE_HOME_LISTNER=$ORACLE_HOME(3).在rc.loca中添加如下语句:[root@DbEsb-12 ~]# vi /etc/rc.d/rc.loc
ORA-01502 index is in unusable state
SQL> show parameter skipNAME TYPE VALUE------------------------------------ ----------- ------------------------------skip_unusable_indexes boolean TRUE默认情况下skip_unusable_indexes=trueSQL> cre...
ORA-01502 index is in unusable state
SQL> show parameter skipNAME TYPE VALUE------------------------------------ ----------- ------------------------------skip_unusable_indexes boolean TRUE默认情况下skip_unusable_indexes=trueSQL> create table tt (id int,name varchar2(100)) 2 ;Table created.SQL> create table tt1 (id int,name varchar2(100)) 2 ;Table created.SQL> create unique index tt_index on tt (id);Index created.创建 unique indexSQL> alter table tt add pr
将lob类型的index移动到其它tablespace
ALTER TABLE DICT_KEYVALUETYPE MOVE TABLESPACE CHSIS_DATA LOB (TYPEXML) STORE AS (TABLESPACE CHSIS_DATA);移动脚本:select 'alter table '|| table_name || ' move tablespace chsis_data lob('||column_name||') store as (tablespace chsis_data);' from user_lobs where tablespace_name='USERS'[@more@]
为lob类型分配extents
首先查询 dba_lobs得到相关信息。SQL> select table_name,column_name,segment_name from dba_lobs where table_name='ESB_MF_INFORMATION';TABLE_NAME COLUMN_NAME SEGMENT_NAME-------------------- ------------------------- -------------------------------------------------------ESB_MF_INFORMATION EXCEPTION_DATA SYS_LOB0000078584C00009$$ESB_MF_INFORMATION RUNTIME_EXCEPTION SYS_LOB0000078584C00008$$然后根据出来的信息alter table ESBAGENT.ESB_MF_INFORMATION
listener 中的一点解释
Normal 0 0 2 false false false MicrosoftInternetExplorer4 <style.st1\:*{behavior.:url(#ieooui) }</style....
os认证以及口令文件的(引用warehouse的)
http://www.itpub.net/thread-906008-1-1.html [@more@]
防止普通用户drop and truncate table
CREATE OR REPLACE TRIGGER trg_dropdeny BEFORE DROP OR TRUNCATE ON DATABASEBEGIN IF sys.login_user<>'SYSTEM' and sys.login_user<>'SYS' THEN raise_application_erro...
非分区表转换为分区表和partition index
/* Style Definitions */ table.MsoNormalTable {mso-style-name:表格內文; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} 非分区表转换为分区表 1)
partition table(2)
st1:*{behavior:url(#ieooui) } /* Style Definitions */ table.MsoNormalTable {mso-style-name:表格內文; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} table.Mso
partition table(1)
st1:*{behavior:url(#ieooui) } /* Style Definitions */ table.MsoNormalTable {mso-style-name:表格內文; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} table.MsoTab
partition table and partition index
Normal 0 0 2 false false false MicrosoftInternetExplorer4 <style.st1\:*{behavior.:url(#ieooui) }</style.<styl...