
Oracle
文章平均质量分 63
CPP_CHEN
这个作者很懒,什么都没留下…
展开
-
Daily used tables, views in ORACLE SQL
Tables:Table name Descriptionall_views all_tables all_objects all_object_tables all_ind_columns all_indexes dba_ind_columns原创 2012-06-02 18:49:25 · 500 阅读 · 0 评论 -
Execution plan
1) Query recent executed SQL for user from V$SQLSQL>col sql_text format a50 truncateSQL>select /* recentsql */ sql_id, child_number, hash_value, address, executions, sql_text 2 from v$sql原创 2012-05-24 20:38:22 · 1754 阅读 · 0 评论 -
Daily used PL/SQL commands
1) Dump all console screen to a fileSQL>spool c:\log.txtSQL>execute sql ...SQL>spool off2) Modify the line size, page size to let the report more neat.SQL>set line 150SQL>set pagesize 999原创 2012-05-24 12:29:22 · 585 阅读 · 0 评论 -
Query index for a table
SQL> desc dba_ind_columns Name Null? Type ----------------------------------------------------------------- -------- ---------------原创 2012-05-26 22:49:19 · 633 阅读 · 0 评论 -
CrystalReport 2011 - JDBC driver not found
While create connection to Oracle XE database, CrystalReport 2010 reports "JDBC driver not found". Here is the solution to fix this prolem.1) copy "ojdbc6.jar" Oracle JDBC Driver to "C:\Program File原创 2012-06-28 13:11:31 · 2483 阅读 · 0 评论 -
String Aggregation Techniques
String Aggregation TechniquesOn occasion it is necessary to aggregate data from a number of rows into a single row, giving a list of data associated with a specific value. Using the SCOTT.EMP table转载 2012-07-23 14:51:54 · 623 阅读 · 0 评论 -
Find out all currenct connections in for Oracle SQL
Select from v$session and v$processselect substr(a.spid,1,9) pid, substr(b.sid,1,5) sid, substr(b.serial#,1,5) ser#, substr(b.machine,1,6) machine, substr(b原创 2012-08-02 11:57:12 · 638 阅读 · 0 评论 -
Find duplicates and remove uplidates
From the internet:1) Delete duplicatesdelete from twhere rowid in ( select rid from ( select rowid rid, row_number() over (partition by cust_seg_nbr or转载 2012-08-29 08:43:28 · 467 阅读 · 0 评论 -
ORA-01940: cannot drop a user that is currently connected
Problem:SQL> drop user ecrpuser cascade;drop user ecrpuser cascade*ERROR at line 1:ORA-01940: cannot drop a user that is currently connectedSolution:select sid||','||serial# from v$ses原创 2012-08-23 11:00:34 · 721 阅读 · 0 评论 -
upsert VS merge
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6618304976523ops$tkyte@ORA920.US.ORACLE.COM> create global temporary table ao 2 on commit PRESERVE ROWS 3 as 4 select *转载 2012-11-14 22:31:41 · 1446 阅读 · 0 评论 -
Just another way of debug logging in Oracle PL/SQL
SQL> create directory log_test as 'c:\ken\sql\learning';Directory created.SQL> grant read,write on directory log_test to public;Grant succeeded.FileLogTest.sql=================原创 2012-05-24 13:38:52 · 541 阅读 · 0 评论 -
Performance tune case - Suboptimal index and missing index
1) Sub-optimal index. SQL> -- Example 1: sub-optimal indexSQL>SQL> select /* KM1 */ job_id, department_id, last_name2 from employees3 where job_id = 'SA_REP'4 and department_id is null ;原创 2012-05-24 21:41:19 · 676 阅读 · 0 评论 -
First time to create JDBC connection to ORACLE SQL
MyEclipse 8.6.1, Oracle 11.1g standard edition, jdk1.6.0_31 are already installed.1) Locate the JDBC driver provided by ORACLE under [ORACLE_HOME]\jdbc\lib\ojdbc6.jar or download the drivers from o原创 2012-05-19 19:47:27 · 866 阅读 · 0 评论 -
Oracle Experts
Ask TomTom KyteJL Computer ConsultancyJonathan LewisMethod-RCary MillsapIxOraSteve AdamsEvergreen Database TechnologiesTim Gorman原创 2012-06-04 12:48:59 · 443 阅读 · 0 评论 -
Enable trace 10046 in Oracle PL/SQL
SQL> ALTER SESSION SET EVENTS '10046 trace name context forever, level 8';SQL> SQL STATEMENT GOES HERESQL> ALTER SESSION SET EVENTS '10046 trace name context off';Tips:1) Query the generat原创 2012-06-03 20:33:07 · 563 阅读 · 0 评论 -
ORA-01654: unable to extend index
This is a summary of the solution for issue "ORA-01654: unable to extend index ..." from internet.1) Check table space usage.SELECT UPPER(F.TABLESPACE_NAME) "TblSpName",D.TOT_GROOTTE_MB "Tbl原创 2012-05-18 10:06:33 · 4005 阅读 · 0 评论 -
PLS-00103: Encountered the symbol "CREATE"
I wrote a SQL script as below, while executing it, encountered 'PLS-00103: Encountered the symbol "CREATE"' error.logging.sql----DROP SEQUENCE pt_debug_sequence;CREATE SEQUENCE pt_debug_sequ原创 2012-05-18 10:14:25 · 14700 阅读 · 0 评论 -
How to execute an OS command in SQL*PLUS without leaving the session ?
SQL> help helpEnter Help [topic] for help. @ COPY PAUSE SHUTDOWN @@ DEFINE PRINT SPOOL /原创 2012-05-18 11:52:19 · 1010 阅读 · 0 评论 -
Use slient mode of SQL*PLUS in a script
C:\Users\chenk6>sqlplus -H...-S Sets silent mode which suppresses the display of the SQL*Plus banner, prompts, and echoing of commands....C:\原创 2012-05-18 12:11:36 · 631 阅读 · 0 评论 -
One case of DDL executed in PL/SQL
Please help me in resolving the error belowCode:=====DECLARE --count NUMBER;tname NVARCHAR2(255);indexname NVARCHAR2(255);tablename NVARCHAR2(255);--tname:= 'TABLE_PART_ACTION';转载 2012-05-18 19:55:58 · 990 阅读 · 0 评论 -
Oacle SQL error codes.
1) The table/sequence in the procedure does not exist which cause "Statement is ignored ..."SQL>@Logging.sqlLINE/COL ERROR-------- ---------------------------------------------------------原创 2012-05-18 19:47:07 · 970 阅读 · 0 评论 -
DDL, DML, DCL and TCL
DDL(Data Definition Language):(DDL) statements are used to define the database structure or schema. Some examples:[*]CREATE - to create objects in the database [*]ALTER - alters the structure转载 2012-05-18 19:52:32 · 636 阅读 · 0 评论 -
Install Oracle 11g R2 in Centos 6 X64
If the prereuisite CV_ASSUME_DISTID=OEL4 to CV_ASSUME_DISTID=OEL6原创 2014-07-24 10:41:29 · 1370 阅读 · 0 评论