
oracle
一卒
面朝大海,春暖花开
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Pending Statistics
Oracle11.2开始,可以使用下面方式搜集统计信息: 1、搜集统计信息完成后,自动发布(默认方式PUBLISH) 2、保存新的统计信息,并且待定发布 以待定方式保存新的统计信息,允许你检验新的统计信息,如果统计信息满足需求,再将其发布。 为了检查统计信息搜集完成后是否自动发布,使用DBMS_STATS,如下: SQL> SELECT DBMS_STA原创 2013-11-29 14:27:29 · 727 阅读 · 0 评论 -
/var/tmp/目录无.oracle导致listener启动失败
在测试设备上,原先错误操作,对/var/tmp/目录的权限做过修改,今天在这个测试设备上恢复启动一个oracle数据库,启动监听时报错: [oracle@localhost admin]$ lsnrctl start LSNRCTLfor Linux: Version 10.2.0.2.0 - Production on 04-JAN-201210:10:11 Copy原创 2013-12-04 15:51:45 · 1676 阅读 · 0 评论 -
oracle dual表
dual表是一个小表,属于sys但是可以被所有用户使用。用户编写的程序可以引用来保证一个已知的结果。当一个值仅仅返回一次,dual表非常有用,例如,查询当前的日期和时间。 dual表只有一列和一行数据,数据为"X",如下:SQL> desc dual Name Null? Type ----------原创 2013-12-05 11:08:48 · 1135 阅读 · 0 评论 -
oracle 选择数据块大小
选择数据块大小A block size of 8 KB is optimal for most systems.However, OLTP systems occasionally use smaller block sizes and DSSsystems occasionally use larger block sizes. This section discussesconsidera翻译 2013-12-05 11:10:19 · 2060 阅读 · 0 评论 -
oracle实现对表dml错误记录日志
DBMS_ERRLOG提供了一个存储过程CREATE_ERROR_LOG,这个存储过程创建一个错误日志表,当DML出错时,操作不会终止和回滚,而是将相关的错误写到错误日志表中。 CREATE_ERROR_LOG不支持一些数据类型:LONG, CLOB,BLOB,BFILE, and ADT。 简单示例:SQL> create unique index ind原创 2013-12-05 11:12:24 · 1292 阅读 · 0 评论 -
Error accessing PRODUCT_USER_PROFILE
$sqlplus / as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Thu Dec 5 14:33:44 2013Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise原创 2013-12-05 14:51:15 · 1553 阅读 · 0 评论 -
rebuild 索引遭遇ORA-02243
rebuild index 是,rebuild要紧跟索引名后面,在其他选项前面,否则会报错:SQL> alter index IND_ABC rebuild;Index altered.SQL> alter index IND_ABC online rebuild;alter index IND_ABC online rebuild原创 2013-12-12 16:53:13 · 3606 阅读 · 0 评论 -
11g active data guard实现备库rman备份
11g active data guard实现备库rman备份,这样可以在不影响主库对外服务的情况下,实现数据库的备份。测试如下:SQL> select OPEN_MODE,PROTECTION_MODE,PROTECTION_LEVEL,DATABASE_ROLE from v$database;OPEN_MODE PROTECTION_MODE PR原创 2014-03-04 17:05:23 · 1471 阅读 · 0 评论 -
测试join using遭遇ORA-25154
SQL> create table aa(a number,b number);Table created.SQL> create table bb(b number,c number);Table created.SQL> insert into aa values(1,2);1 row created.SQL> insert into aa va原创 2014-03-11 16:54:20 · 1644 阅读 · 0 评论 -
11G重建scott
oracle提供了scott用户的重建脚本,11G利用脚本创建scott简单操作如下:SQL> select * from dba_users where username='SCOTT'; ------之前已手动删除scottno rows selectedSQL> exitDisconnected from Oracle Database 11g原创 2014-03-24 10:46:56 · 996 阅读 · 0 评论 -
解决oracle 11g安装导致数据库无法自动搜集统计信息
近期发现个别数据库无法自动收集统计信息,部分视图查询结果如下:SQL> select client_name,status from dba_autotask_client where client_name = 'auto optimizer stats collection'; CLIENT_NAME原创 2014-12-01 10:39:36 · 1162 阅读 · 0 评论 -
impdp遭遇ORA-39001、ORA-39000,ORA-39142
expdp/impdp由于源数据版本高于目标数据库版本,遭遇ORA-39001、ORA-39000,ORA-39142,解决只需要expdp导出时加上目标数据的version,具体问题及解决如下:导入报错:[oracle@orcle02 ~]$ impdp scott/tiger directory=expdp dumpfile=wxlun1212.dmp logfile=wxl原创 2014-12-12 13:30:01 · 34378 阅读 · 0 评论 -
Row Chaining and Row Migration
Row Chaining and Row Migration行链接和行迁移Introduction------------介绍This article discusses the difference between row chaining andmigration.Guidelines are given on how to detect and resolve翻译 2013-12-03 16:37:40 · 911 阅读 · 0 评论 -
ORA-00600: internal error code, arguments: [opifal.1]
oracle版本:10.2.0.2 并做已做data guard操作系统:linux rhat 5.6 x64最近在主库oracle alert日志发现,最近半个月,几乎每天都会产生一次ora 600错误,如下:Errors in file/oracle/admin/hycrm/bdump/hycrm_s000_27823.trc:ORA-00600: internal e原创 2013-12-04 09:06:51 · 1265 阅读 · 0 评论 -
删除分区表所在表空间遇到ora-14401错误
数据库:oracle11.2.0.3删除分区表所在表空间遇到ora14401错误: SYS@vimop01_b>drop tablespaceUSER_TS_MONI_11B including contents and datafiles;drop tablespace USER_TS_MONI_11B including contents anddatafiles*原创 2013-12-04 09:05:06 · 1547 阅读 · 0 评论 -
创建分区位图索引测试
先创建一个分区表,如下:SQL> create table test_part_index 2 ( 3 id NUMBER, 4 time DATE not null 5 ) 6 partition by range(TIME) 7 ( 8 partitionPT_201原创 2013-11-29 14:56:45 · 1919 阅读 · 0 评论 -
ORA-01536: space quota exceeded for tablespace
问题:ORA-01536: space quota exceeded for tablespace 'HOME-A'解决方法:alter user 你的用户名 quota unlimited on 你建表的表空间的名字;例如:alter user HOME_A quota unlimited on "HOME-A";原创 2013-11-29 14:29:49 · 997 阅读 · 0 评论 -
Using Flashback Drop and Managing the Recycle Bin
Using Flashback Drop and Managing the Recycle Bin使用闪回删除和管理回收站When you drop a table, the database does not immediately remove the space associated with the table. The database renames the table翻译 2013-12-06 16:49:08 · 1064 阅读 · 0 评论 -
导入数据IMP-00058 ORA-00904
将源库分区表数据迁移到历史库中碰到IMP-00058 ORA-00904错误,具体操作及解决如下:$imp \'/ as sysdba\' STATISTICS=NONEDATA_ONLY=y file=/backup/wxlun20130911.dmplog=/backup/wxlun20130911.implog fromuser=wxlun touser=wxlun_his原创 2013-11-29 14:58:40 · 2855 阅读 · 0 评论 -
Oracle确定过期的统计信息
Youmust regularly gather statistics on database objects as thesedatabase objects are modified over time. To determine whether agiven database object needs new database statistics, OracleDatabase provi原创 2013-11-29 14:52:41 · 1668 阅读 · 0 评论 -
oracle 11gR2 创建无数据对象临时不分配segment
做实验发现oracle11gR2,创建无数据的table、index等对象,oracle为了节省空间,开始并不分配segment,而是等有dml操作时才会分配segment,即使dml回滚,分配的segment并不回收。简单实验如下:SQL> create table test(a number);Table created.SQL> create index ind_test原创 2013-12-03 10:32:47 · 869 阅读 · 0 评论 -
oracle终止session
有时候,oracle终止当前的session是必要的。例如,你想执行一个管理操作,需要终止所有非管理员的session。下面描述的是终止session的各个方面,包括以下: 1.标识哪些session需要终止 2.终止一个Active Session 3.终止一个Inactive Session 当一个session被终止,session的任何活动事务翻译 2013-12-03 16:54:48 · 3070 阅读 · 0 评论 -
可能导致index unusable的维护操作
Six types of maintenance operationscan mark index partitions INDEX UNUSABLE.In all cases, you must rebuild the index partitions when theoperation iscomplete. 1) Operations like Import Parti转载 2013-12-03 16:56:19 · 1432 阅读 · 0 评论 -
11gR2修改index状态为unusable,则删除index的segment
11gR2修改index状态为unusable,则相应的segment将会被删除,测试如需:SQL> create table MY_OBJECTS as select * from dba_objects;Table created.SQL> create index ind_object_id on my_objects(object_id);Index creat原创 2013-12-10 17:25:51 · 1470 阅读 · 0 评论 -
Shrinking a Locally Managed Temporary Tablespace
Shrinking a Locally Managed Temporary Tablespace Large sortoperations performed by the database may result in a temporarytablespace growing and occupying a considerable amount of diskspace. A翻译 2013-12-03 16:58:17 · 780 阅读 · 0 评论 -
varchar2转化nvarchar2类型乱码
开发人员有个需求,需将一个字符串,转成nvarchar2类型。但是测试是乱码,例句如下:SQL> select(selectutl_raw.cast_to_nvarchar2(utl_raw.cast_to_raw('i am nvarchar2string')) from dual) from dual;(SELECTUTL_RAW.CAST_TO_NVARCHAR2(UTL_R原创 2013-12-03 17:00:50 · 5750 阅读 · 0 评论 -
impdp遭遇ORA-39029、ORA-31671、ORA-06512
[oracle@rac1 ~]$ impdp \'/ as sysdba \' directory=expdp dumpfile=wxlun0402.dmp logfile=wxlun0402.impdplog REMAP_TABLESPACE=wxlun:wxlun_DATA REMAP_SCHEMA=wxlun:wxlun0402Import: Release 11.2.0.3.原创 2015-04-02 16:57:47 · 4740 阅读 · 0 评论