Archive for the ‘oracle’ Category

OUI-15038 Occurs During The Oracle10.2.0.4 Upgrade on Linux x86-64

星期二, 08月 5th, 2008

今天从10.2.0.3 往10.2.0.4 升级时候遇到如下错
Symptoms

Checking for Oracle Home incompatibilities ....
Check complete. The overall result of this check is: Not executed <<
OUI-15038: Unable to execute rule 'CheckCompatibility' from ruleset 'CompatibilityChecks'. The
underlying test 'oracle.sysman.oip.oipc.oipcz.OipczCompatibilityChecks.checkProductCompatibility'
has thrown an unhandled exception [For input string: "18446744073709551615"]. If the exception
results in a failure of the test and the exception needs to be propagated, then encapsulate the
exception in the result object and return the result.
Recommendation: Choose a new Oracle Home or a home that contains Oracle Database 11g Release 1
software for installing this product.

metalink Note:468051.1 解释了这个问题

(阅读全文……)

DBA Books 循序渐进Oracle

星期四, 07月 24th, 2008

Eygle 是个大师

Eygle 的书深入浅出,分析充分

Eygle 的书得买正版的

推荐 此书 基于三点原因

1) 如果分不清 Instance_name, Service_name, database_name ,读此书

2) 如果想了解Oracle字符集的基本知识,很有用的只是啊,读此书

3) 如果想了解数据迁移,读此书

上周三桂问我一个问题,关于数据迁移的,据说这种业务,非常多。 读读此书吧。

置顶:《循序渐进Oracle》一书及相关信息

作者:eygle |English Version 【转载时请以超链接形式标明文章和作者信息及本声明
链接:

PLSQL开发笔记和小结zz

星期六, 07月 19th, 2008

PLSQL开发笔记和小结

这个同学的博客看过好几次,写的不错。推荐一下。

ORACLE EXPLAIN PLAN的总结zz

星期三, 07月 2nd, 2008

ORACLE EXPLAIN PLAN的总结

值得一读。Oracle的explain plan不如db2来的舒服。。。

Oracle Managing Database Performance Fundamental Q&A

星期二, 07月 1st, 2008

1/If you create a table and a procedure that refers to it, and then change the
definition of the table, what will happen when you try to run the procedure?

D. The procedure may or may not compile, depending on the nature
of the change.

Ex,Oracle will attempt to recompile automatically, but this may or may not
succeed.

2/If a SELECT statement attempts to use an UNUSABLE index, what will
happen?
D. It depends on the SKIP_UNUSABLE_INDEXES parameter.
Ex,The instance parameter SKIP_UNUSABLE_INDEXES controls this behavior.
Depending on this, the statements will either fail or run by resorting to full
table scans.

3/You determine that an index is unusable, and decide to rebuild it. Which of
the following statements, if any, are correct?
B. A rebuild may require double the disk space while it is in progress
Ex, A rebuild needs space for both the old and the new index while it is in
progress.

4/You can analyze an index with the ANALYZE INDEX command, or with
the DBMS_STATS.GATHER_INDEX_STATS procedure. Which view will be
populated after this?
B. DBA_INDEXES
Ex,This view could also have been populated by analyzing the table on which
the index is based.

5/Object statistics are gathered and become out of date. What will cause them to
be gathered again?
B. You can configure a Scheduler job to gather statistics automatically.
C. You can always force the gathering of statistics by using the ANALYZE
command.
Ex,B and C. The Scheduler can be configured to run a statistics gathering job
automatically, or the statistics can be gathered interactively at any time.

6/From where are dynamic performance views populated?

A. The instance
B. The controlfile
Ex,A and B. Dynamic performance views are populated from either the instance
or the controlfile.

7/When you shut down an instance, what happens to the information in the
dynamic performance views?
A. It is lost.
Ex,A. Information in the dynamic performance views exists only for the lifetime
of the instance: it is lost on shutdown, no matter how it occurs.

8/If a primary key index becomes unusable, what will the effect be upon an
application that uses it?
A. SELECT will succeed, but perhaps at reduced performance.
Ex,A. If the SKIP_UNUSABLE_INDEXES instance parameter is on default, then
SELECT statements will still succeed, by resorting to full table scans. Most
DML statements will fail in this situation. The only exception is UPDATE
statements that do not affect the key columns.

查询 Oracle 当前登录用户权限

星期四, 06月 26th, 2008

 user_sys_privs 表存储了当前登录用户的system privileges。

C:\Documents and Settings\Administrator>sqlplus icmadmin/fvt6eip@icmnlsdb
SQL*Plus: Release 10.2.0.3.0 - Production on Fri Jun 27 05:26:11 2008
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from user_sys_privs;
USERNAME                       PRIVILEGE                                ADM
------------------------------ ---------------------------------------- ---
ICMADMIN                       CREATE SESSION                           NO
ICMADMIN                       CREATE ANY DIRECTORY                     NO
ICMADMIN                       CREATE TRIGGER                           NO
ICMADMIN                       CREATE TYPE                              NO

.......

user_tab_privs 表存储了当前登录用户的table privileges。

SQL> select * from user_tab_privs;
GRANTEE    OWNER      TABLE_NAME GRANTOR    PRIVILEGE            GRA HIE
---------- ---------- ---------- ---------- -------------------- --- ---
PUBLIC     ICMADMIN   PARTOFDOC1 ICMADMIN   SELECT               NO  NO
                      020001

PUBLIC     ICMADMIN   DOC1020001 ICMADMIN   SELECT               NO  NO
PUBLIC     ICMADMIN   ICMPARTS13 ICMADMIN   SELECT               NO  NO
                      79001

Oracle Controlfile Backup

星期四, 06月 26th, 2008

Controlfile is the most important file of Oracle database. It can be backup as trace.

Controlfile 可以使用trace来进行备份。

C:\Documents and Settings\Administrator>sqlplus sys/fvt6eip@icmnlsdb as sysdba
SQL*Plus: Release 10.2.0.3.0 – Production on Fri Jun 27 05:01:14 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – Production
With the Partitioning, OLAP and Data Mining options
SQL> alter database backup controlfile to trace;
Database altered.
SQL> show parameter user_dump_dest;
NAME TYPE
———————————— ——————————–
VALUE
——————————
user_dump_dest string
C:\ORACLE\PRODUCT\10.2.0\ADMIN
\ICMNLSDB\UDUMP

————————————————————————————–

# HJ’s comments
#Trace file location is C:\ORACLE\PRODUCT\10.2.0\ADMIN\ICMNLSDB\UDUMP

————————————————————————————–

SQL> host dir C:\ORACLE\PRODUCT\10.2.0\ADMIN\ICMNLSDB\UDUMP
Volume in drive C is C_Drive
Volume Serial Number is 34E8-5151

Directory of C:\ORACLE\PRODUCT\10.2.0\ADMIN\ICMNLSDB\UDUMP

06/27/2008 05:06 AM <DIR> .
06/27/2008 05:06 AM <DIR> ..
06/27/2008 05:03 AM 6,537 icmnlsdb_ora_3908.trc
06/27/2008 05:06 AM 0 sbtio.log
3 File(s) 8,033 bytes
2 Dir(s) 39,089,672,192 bytes free

————————————————————————————————-
(阅读全文……)

Oracle Database Creation SQL Scripts Explanation

星期二, 06月 24th, 2008

It’s a general list of db creation sql scripts as execution sequence.

@C:\oracle\admin\orcl\scripts\CreateDB.sql

CreateDB.sql connect to the instance with password file authentication, then startup nomount instance , create database with specify/default data files for SYSTEM,SYSAUX and others tablespaces. It build data directory also.

@C:\oracle\admin\orcl\scripts\CreateDBFiles.sql

CreateDBfiles.sql creates another tablespace, to be used as a default storage
location for user data.

@C:\oracle\admin\orcl\scripts\CreateDBCatalog.sql

CreateDBcatalog.sql generates the data dictionary views and the PL/SQL
supplied packages.

@C:\oracle\admin\orcl\scripts\emRepository.sql

emRepository.sql generates the Enterprise Manager Database Control tool

@C:\oracle\admin\orcl\scripts\postDBCreation.sql

postDBcreation.sql tidies everything up

Oracle 中的错误解释命令

星期六, 05月 31st, 2008
  • Oerr ora errorcode
  • Example

oracle@lnxoravm:194# oerr ora 1300
01300, 00000, “writable database required for specified LogMiner options”
// *Cause: Options were specified which required the database to be writable.
// *Action: Specify different options or open the database for write access.