由于备机新升级了硬盘,一时还没把dg(data guard)装好,就断开了主机和备机的网络,今天在手工switch logfile的时候,当切出到低18个的时候,就挂住了,长时间没有相应。 检查alertlog中,发现在不断写出如下的报错: [crayon-676dbce8b0c9345332276 […]
创建视图时引用表的权限问题
在做imp的时候,发现log中有以下报错:
1 2 3 4 5 6 7 8 |
…… IMP-00041: Warning: object created with compilation warnings "CREATE FORCE VIEW "MYUESR"."V_VIEW01" ("ICPCOD" "E") AS " "select user02.IcpCode" "from user01.icp icp,user01.custcontact custcontact" "where user02.id = custcontact.id(+)" …… |
通过直接在数据库查询,发现报错没有权限,但是select却是能够操作:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
SQL> select * from V_VIEW01 where rownum<10; select * from V_VIEW01 where rownum<10 * ERROR at line 1: ORA-04063: view "MYUESR.V_VIEW01" has errors SQL> show error view V_VIEW01 Errors for VIEW V_VIEW01: LINE/COL ERROR -------- ----------------------------------------------------------------- 0/0 ORA-01031: insufficient privileges SQL> SQL> select count(*) from user01.icp; COUNT(*) ---------- 976 SQL> select count(*) from user01.custcontact; COUNT(*) ---------- 1310 |
奇怪的是,MYUESR已经有dba权限,难道还不能建 […]
BUG:truncate分区后,segment大小没降低
今天遇到了一个的问题,一个分区表,当我truncate完一个分区,通过查看dba_segments.bytes竟然没有空间被释放:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
SQL> select * from v$version; BANNER ---------------------------------------------------------------- Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production PL/SQL Release 9.2.0.6.0 - Production CORE 9.2.0.6.0 Production TNS for HPUX: Version 9.2.0.6.0 - Production NLSRTL Version 9.2.0.6.0 - Production SQL> CREATE TABLE xxx 2 (aa varchar2(20), 3 bb number ) tablespace tt 4 PARTITION BY RANGE (bb) 5 (PARTITION xxx_p1 6 VALUES LESS THAN (10000), 7 PARTITION xxx_p2 8 VALUES LESS THAN (40000), 9 PARTITION xxx_p3 10 VALUES LESS THAN (80000), 11 PARTITION xxx_p4 12 VALUES LESS THAN (100000), 13 PARTITION xxx_max 14 values less than (maxvalue) 15 ); Table created. SQL> select TABLESPACE_NAME from user_tab_partitions where table_name='XXX'; TABLESPACE_NAME ------------------------------ TT TT TT TT TT SQL> select INITIAL_EXTENT,EXTENTS,BYTES from user_segments where segment_name='XXX'; INITIAL_EXTENT EXTENTS BYTES -------------- ---------- ---------- 65536 1 65536 65536 1 65536 65536 1 65536 65536 1 65536 65536 1 65536 SQL> insert into xxx select 'aa',rownum from dba_objects; 97390 rows created. SQL> insert into xxx select * from xxx; 97390 rows created. SQL> insert into xxx select aa,rownum from xxx; 194780 rows created. SQL> commit; Commit complete. SQL> select INITIAL_EXTENT,EXTENTS,BYTES from user_segments where segment_name='XXX'; INITIAL_EXTENT EXTENTS BYTES -------------- ---------- ---------- 65536 7 458752 65536 17 2097152 65536 17 2097152 65536 13 851968 65536 17 2097152 SQL> alter table xxx truncate partition xxx_p1; Table truncated. SQL> select INITIAL_EXTENT,EXTENTS,BYTES from user_segments where segment_name='XXX'; INITIAL_EXTENT EXTENTS BYTES -------------- ---------- ---------- 65536 7 458752 ######truncate该分区,空间没释放 65536 17 2097152 65536 17 2097152 65536 13 851968 65536 17 2097152 SQL> alter table xxx truncate partition xxx_p2; Table truncated. SQL> select INITIAL_EXTENT,EXTENTS,BYTES from user_segments where segment_name='XXX'; INITIAL_EXTENT EXTENTS BYTES -------------- ---------- ---------- 65536 7 458752 65536 17 2097152 ######truncate该分区,空间没释放 65536 17 2097152 65536 13 851968 65536 17 2097152 |
但是在我机器上的数据库中进行测试,却是有正常的结果: [crayon-676dbce8b45d7532 […]
谈谈容灾
今天来谈谈关于容灾的一些事情,其实网上很多关于容灾的方案、白皮书等等,各个厂家也有自己主推的容灾工具。在这里,我结合自己的工作经验,简单的谈谈我理解的数据库容灾。 容灾,要考虑投资额度,能承受多少最大的支出;要考虑能接受的损失范围,保证我最小业务运行有哪些条件;要考虑容灾的距离,是本地容灾还是异地容 […]
因为hosts文件无法实现侦听动态注册
今天一个同事来求助sqlplus+sid登录不上的问题,测试登录,发现有ora-12514的报错:
1 2 3 4 5 6 7 8 9 |
oracle@my_testdb01:/oracle > sqlplus myuser/mypasswd@mysid SQL*Plus: Release 9.2.0.4.0 - Production on Wed Sep 5 15:36:06 2007 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. ERROR: ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect descriptor |
检查了sqlnet.ora文件,发现NAMES.DIRECTORY_PATH= (TNSNAMES),是使用tsnnames,继续检查 […]
配置dp备份报错fail to load MML
今天在配置dp时,dp中报错: 用手工测试也有类似的报错:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
RMAN> run{ 2> allocate channel t1 type 'sbt_tape' ; 3> allocate channel t2 type 'sbt_tape' ; 4> backup datafile 3 5> format 'test_bk_%u_%p_%s.RMN' 6> include current controlfile; 7> } RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03009: failure of allocate command on t1 channel at 09/01/2007 04:25:21 ORA-19554: error allocating device, device type: SBT_TAPE, device name: ORA-27211: Failed to load Media Management Library Additional information: 2 RMAN> ################################ ###### 但是备份到disk却没有问题 ################################ RMAN> RMAN> RMAN> RMAN> run{ 2> allocate channel t1 type disk ; 3> allocate channel t2 type disk ; 4> backup datafile 2 5> format '/iarch/test_bk_%u_%p_%s.RMN' 6> include current controlfile; 7> } allocated channel: t1 channel t1: sid=58 devtype=DISK allocated channel: t2 channel t2: sid=70 devtype=DISK Starting backup at 01-SEP-07 channel t1: starting full datafile backupset channel t1: specifying datafile(s) in backupset including current controlfile in backupset channel t1: starting piece 1 at 01-SEP-07 channel t2: starting full datafile backupset channel t2: specifying datafile(s) in backupset input datafile fno=00002 name=/dev/vg_iora01/rdata_1g_001 channel t2: starting piece 1 at 01-SEP-07 channel t1: finished piece 1 at 01-SEP-07 piece handle=/iarch/test_bk_01iqqmc8_1_1.RMN comment=NONE channel t1: backup set complete, elapsed time: 00:00:04 channel t2: finished piece 1 at 01-SEP-07 piece handle=/iarch/test_bk_02iqqmca_1_2.RMN comment=NONE channel t2: backup set complete, elapsed time: 00:00:37 Finished backup at 01-SEP-07 released channel: t1 released channel: t2 RMAN> |
检查了lib库中的link也是已经建立了:
1 2 |
gd_idb02:[/oracle/app/oracle/product/9.2.0/lib$]ll libobk.sl lrwxrwxrwx 1 oracle dba 36 Sep 3 10:01 libobk.sl -> /opt/omni/lib/libob2oracle8ale_64bit.sl |
后来查了相关的文档,才发现那个link的微妙差别,原来在64位的 […]
DBA要有良好的工作作风
dba不仅仅要有扎实的基础,良好的心态,更要有个良好的工作作风。 1、无论什么时候,要保证业务不受影响。你可以做清理,可以做优化,可以做备份,但是前提是这些操作不能影响到业务操作,需要预估这些操作的时间,会否延时到业务高峰期。这不仅要求dba了解数据库,也要了解业务,一个月中哪几天是业务高峰期;一天 […]
trace的一些小结
1. 使用autotrace: set autotrace ON | ON EXPLAIN | ON STATISTICS | TRACEONLY | TRACEONLY EXPLAIN set autotrace off 2. 使用set events context : alter sessio […]
数据库安装交接文档
数据安装完之后,数据库安装人员就可以把数据库交付给维护人员或者应用部署人员,但是往往很多时候没有交接文档,缺乏必要的信息,在后续的工作中造成了不少不便。在这里,我选取了一些比较重要的数据库信息——主机名称、操作系统版本、数据库安装用户名、数据库安装用户密码、数据库安装用户主目录、数据库安装用户环境变 […]
oracle 11g 慢慢的走近了我们……
oracle 11g在上周五在oracle 的官方网站已经提供下载了:下载地址(11g db software) 目前的版本还是for linux x86的。还没有看到其他平台的11g。 不过,今天又看到11g的在线文档也发布了,其地址是:下载地址(online document) oracle 1 […]
IMP-00060:type does not exist or has different identifier
今天在做一个数据库迁移的时候,在imp的时候出现了一个奇怪的报错: …… . . importing table “APPLY_SERV_BAK070713” 1542 rows imported . . importing table “APPLY_SERV_BAK070724” 1546 row […]
oracle的lifetime support政策
从今年的7月开始,oracle将对9i的版本不再提供标准支持服务(premier support),进入为期3年的延伸支持服务期(extended support)。也就是说,按照规定,从今年7月开始不再免费的提供新的patch,如果有需要,将在原来的服务费用基础上,第一年加收10%的费用提供支持, […]