exp query
C:Documents and SettingsAdministrator>exp userid=scott/tiger tables=(emp,test_emp) query= "where to_char(hiredate,'yyyy') <='2007'"Export: Release 9.2.0.8.0 - Production on 星期二 12月 23 16:23:50 2008Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining options已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集即将导出指定的表通过常规路径 .... . 正在导
Unload data to a flat file from Oracle database
From : asktom http://asktom.oracle.com/tkyte/flat/[@more@]How Can I unload data to a flat file Many times we are asked "Does anyone know an easy way of dumping the data from an Oracle table into a delimited(comma, tab etc) ascii file?" "Does anyone know an easy way to unload data in a format for sqlldr to reload later?" Well here is a way to do it into Excel or any spreadsheet that understands the industry standard SYLK file format: http://asktom.oracle.com/pls/ask/f?p=4950:8
oracle DBMS_LOCK.SLEEP()的使用
From : http://hi.baidu.com/dbachina/blog/item/12134e4ea50aabced1c86a57.html[@more@]1创建测试表CREATE TABLE tbl_tt (ID NUMBER(4),addtime DATE);2开始测试BEGIN FOR i IN 1 .. 10 LOOP INSERT INTO tbl_tt VALUES (i, SYSDATE); COMMIT; DBMS_LOCK.sleep (5); END LOOP;END;/3查询数据 ID ADDTIME---------- ------------------- 1 2008-01-14 13:10:20 2 2008-01-14 13:10:26 3 2008-01-14 13:10:31 4 2008-01-14 13:10:36 5 2008-01-14 13:10:41
SQLPLUS 操作大全
From : http://hi.baidu.com/dbaeyes/blog/item/5702d18b4d9732799e2fb428.html[@more@]SQLPLUS 操作大全附录B SQL*PLUSSql*plus 中使用绑定变量:sql> variable x number;sql> exec :x := 7788;sql> SELECT empno,ename from scott.emp where empno=:x;SQL*PLUS 是Oracle提供的一个工具程序,它不仅可以用于测试,运行SQL语句和PL/SQL块,而且还可以用于管理Oracle数据库,1.启动sql*plus为了使用sql*plus,必须首先要启动sql*plus。Oracle不仅提供了命令行和图形界面的sql*plus,而且还可以在web浏览器中运行.(1)在命令运行sql
Oracle Display the process of the procedure ( oracle pipe , dbms_output , prompt )
From : asktom http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1968769482859[@more@]It is because prior to 9i -- a stored procedure call would goto the database, run the procedure from start to finish and then return to the client. The client has no ability to get results from the stored procedure until its totally done. It is one message over, one message back. The stored procedure runs in the server, not on the client so the stored procedure cannot really do any I/O
一条很 巧妙的 SQL 语句
From : http://www.itpub.net/viewthread.php?tid=1083104&page=1#pid12057097[@more@]关于取连续数据请教,谢谢!drop table test;create table test (id1 int,id2 int ,id3 int);insert into test (id1 ,id2,id3) values (1,45,89); insert into test (id1 ,id2,id3) values (2,45,89); insert into test (id1 ,id2,id3) values (3,45,89); insert into test (id1 ,id2,id3) values (8,45,89); insert into test (id1 ,id2,id3) values (12,45,89);insert into test (id1 ,id2,id3) values (36,45,89);insert into test (id1 ,id2,id3
One very useful script
by myself[@more@]test_orcl.batREM set oracle_sid=orclsqlplus /@orcl as sysdba @d:scripttest_orcl.sqlpuasetest_orcl.sqlcol host_name for a20select host_name,startup_time,status,database_status from v$instance;exit
HowTo Restore RMAN Disk backups of RAC
From : metalink[@more@]Subject: HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another Node Doc ID: Note:415579.1Type: HOWTO Last Revision Date: 20-NOV-2007Status: MODERATEDIn this Document Goal SolutionThis document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process, and therefore has not been subject to an independent technical review.Applies to: Oracle Server - Enterprise Edition - Version: 9.2.0.0 to 10.2.0.0Information in this document app
How To Use Automatic Shared Memory Management
From : metalink[@more@]Subject: How To Use Automatic Shared Memory Management (ASMM) In Oracle10g Doc ID: Note:295626.1Type: BULLETIN Last Revision Date: 10-SEP-2008Status: PUBLISHEDChecked for relevance on 28-8-2007. PURPOSEThe main goal of this document is to show you how to put in place the ASMM facility introduced with Oracle10g, how to configure it, and also some examples on how to monitor its activity.SCOPE & APPLICATIONAll the DBAs and users concerned with Database Administration acti
SKIP_UNUSABLE_INDEXES Initialization
From : metalink[@more@]Subject: SKIP_UNUSABLE_INDEXES Initialization Parameter in Oracle Database 10g Doc ID: Note:281500.1Type: HOWTO Last Revision Date: 05-MAR-2008Status: PUBLISHEDIn this Document Goal Solution ReferencesApplies to: Oracle Server - Enterprise Edition - Version: Information in this document applies to any platform.GoalThis article discusses about the initialization parameter SKIP_UNUSABLE_INDEXES in Oracle Database 10gSetting this parameter to TRUE disables error reporting
XML Database ( XDB)
oracle schema : xdbFrom : http://www.oracle.com/technology/tech/xml/index.html[@more@]
字符,字节和编码
From : http://www.regexlab.com/zh/encoding.htm[@more@]字符,字节和编码[原创文章,转载请保留或注明出处:http://www.regexlab.com/zh/encoding.htm]级别:中级摘要:本文介绍了字符与编码的发展过程,相关概念的正确理解。举例说明了一些实际应用中,编码的实现方法。然后,本文讲述了通常对字符与编码的几种误解,由于这些误解而导致乱码产生的原因,以及消除乱码的办法。本文的内容涵盖了“中文问题”,“乱码问题”。掌握编码问题的关键是正确地理解相关概念,编码所涉及的技术其实是很简单的。因此,阅读本文时需要慢读多想,多思
Oracle Date Function 讲解和事例
From WEB[@more@]1 year=1*12 months1 day=24 hours=24*(1*60mins)=24*60*(1*60 seconds)1 week =7 days注意:黑色字体是 oracle 8i,9i都可以使用的函数,蓝色字体是 Oracle9i新增的部分。 请大家在使用时,注意版本限制。add_monthscurrent_datecurrent_timestampdatimezoneextract(datetime)last_daymonths_betweennew_timenext_dayroundSYSDATEsystimestampTO_DATEtrunc()1: Add_Months语法:Add_Months(d,n) 函数 -- n可正可负作用: Add_Months(d,n) 返回日期 D 加上n 月的日期Example:A:下个月的今天select add_months(sysdate,1
ORA-01795: 列表中的最大表达式数为 1000解决方法
v_update_string := 'UPDATE tmp_cashflow set match_id = ' || v_match_id || ' where cashflow_id in (' || p_cashflow_string || ')'; [@more@]ORA-01795: maximum number of expressions in a list is 1000ORA-06512: at line 1ORA-06512: at "MOARUSR.P_EXCP", line 227ORA-06512: at "MOARUSR.P_FEED", line 1057ORA-01795: maximum number of expressions in a list is 1000ORA-06512: at line 1ORA-06512: at "MOARUSR.P_EXCP", line 227ORA-06512: at "MOARUSR.P_MATCH", line 1480ORA
Oracle Histograms
From Oracle Documents Oracle9i Database Performance Tuning Guide and ReferenceRelease 2 (9.2)Part Number A96533-02[@more@]Using HistogramsThe cost-based optimizer can use data value histograms to get accurate estimates of the distribution of column data. A histogram partitions the values in the column into bands, so that all column values in a band fall within the same range. Histograms provide improved selectivity estimates in the presence of data skew, resulting in optimal execution plans with
My questions in OTN Database Forums
http://forums.oracle.com/forums/thread.jspa?threadID=712341&tstart=0 http://forums.oracle.com/forums/thread.jspa?messageID=2781868�[@more@]
难以忘怀DBA误操作
From : AnySQL.net http://www.anysql.net/dba/critical_dba_mistakes.html 最近流行自我恢过, 有人在ITPub上有人问DBA生涯中最难人忘怀的误操作. 最常见的有如下几类: rm误删除文件, 解决办法可以参考Fenng的贴子, 这其中良好的习惯和权限管理显得很重要, 必要时写些角本来进行删除操作, 不容易范错. 连错数据库, 这种事发生的事也比较多. 如要连Standby的连到Primary了, 结果将生产库关闭了(这事这儿也发生过). 要连本机的连到生产库了, 要连测试库的连到生产库了, 连错库后用初始化角本去初始化造成了大问题. 拷贝粘贴问题
Parallel Query Wait Events
From : http://www.xianguo.com/go.php?fi=181586102SCOPE & APPLICATION-------------------This is intended as a reference for anyone involved in database tuning. At the moment we consider the following PX wait events as idle: - "PX Idle Wait"- "PX Deq: Execution Msg"- "PX Deq: Table Q Normal"- "PX Deq Credit: send blkd"- "PX Deq: Execute Reply"- "PX Deq Credit: need buffer"- "PX Deq: Signal ACK"- "PX Deque wait"In 9
做DBA 一定要谨慎小心地执行每一个命令
2008.08.13 凌晨一时左右,我在自己的测试环境下,做试验。由于空间不够,我就想把 /home/oracle/10gR2/db/dbs/ 下的归档日志清除。/home/oracle>lsab_+ASM1.dat arch1_180_636200046.dbf arch1_188_636200046.dbf arch2_64_636200046.dbf initdw.oraarch1_173_636200046.dbf arch1_181_636200046.dbf arch1_189_636200046.dbf arch2_65_636200046.dbf init.oraarch1_174_636200046.dbf arch1_182_636200046.dbf arch1_190_636200046.dbf arch2_66_636200046.dbf initrac1.oraarch1_175_636200046.dbf arch1_1
How to Determine if Dictionary Statistics are RDBMS-Generated or User-Defined
The column USER_STATS from DBA_TABLES, ALL_TABLES, USER_TABLES displays: YES, when statistics are entered directly by a user. NO, when statistics are generated by RDBMS through an ANALYZE statement.It is the same column in: DBA_ALL_TABLES for object and relational tables statistics, DBA_OBJECT_TABLES for object tables statistics, DBA_TAB_PARTITIONS for table partitions statistics, DBA_TAB_SUBPARTITIONS for table subpartitions statistics, DBA_INDEXES for indexes statistics,