易截截图软件、单文件、免安装、纯绿色、仅160KB

Oracle Sql技巧 Upsert, Multitable Insert, Undrop

UpSert功能:
MERGE <hint> INTO <table_name>
USING <table_view_or_query>
ON (<condition>)
WHEN MATCHED THEN <update_clause>
WHEN NOT MATCHED THEN <insert_clause>;
MultiTable Inserts功能:
Multitable inserts allow a single INSERT INTO .. SELECT statement to conditionally, or non-conditionally, insert into multiple tables. This
statement reduces table scans and PL/SQL code necessary for performing multiple conditional inserts compared to previous versions. It's
main use is for the ETL process in data warehouses where it can be parallelized and/or convert non-relational data into a relational format:
-- Unconditional insert into ALL tables
INSERT ALL
INTO sal_history VALUES(empid,hiredate,sal)
INTO mgr_history VALUES(empid,mgr,sysdate)
SELECT employee_id EMPID, hire_date HIREDATE, salary SAL, manager_id MGR
from employees WHERE employee_id > 200;
-- Pivoting insert to split non-relational data
INSERT ALL
INTO Sales_info VALUES (employee_id,week_id,sales_MON)
INTO Sales_info VALUES (employee_id,week_id,sales_TUE)
INTO Sales_info VALUES (employee_id,week_id,sales_WED)
INTO Sales_info VALUES (employee_id,week_id,sales_THUR)
INTO Sales_info VALUES (employee_id,week_id, sales_FRI)
SELECT EMPLOYEE_ID, week_id, sales_MON, sales_TUE,
sales_WED, sales_THUR,sales_FRI
from Sales_source_data;
-- Conditionally insert into ALL tables
INSERT ALL
WHEN SAL>10000 THEN
INTO sal_history VALUES(EMPID,HIREDATE,SAL)
WHEN MGR>200 THEN
INTO mgr_history VALUES(EMPID,MGR,SYSDATE)
SELECT employee_id EMPID, hire_date HIREDATE, salary SAL, manager_id MGR
from employees WHERE employee_id > 200;
-- Insert into the FIRST table with a matching condition
INSERT FIRST
WHEN SAL > 25000THEN
INTO special_sal VALUES(DEPTID,SAL)
WHEN HIREDATE like ('%00%') THEN
INTO hiredate_history_00 VALUES(DEPTID,HIREDATE)
WHEN HIREDATE like ('%99%') THEN
INTO hiredate_history_99 VALUES(DEPTID,HIREDATE)
ELSE
INTO hiredate_hi


相关文档:

用命令行(CMD)中启动和关闭ORACLE服务


用命令行(CMD)中启动和关闭ORACLE服务
 
 
监听启动
lsnrctl start
监听停止
lsnrctl stop
启动Oracle
net start oracleservicesid
停止Oracle
net stop oracleservicesid
 
net命令是win系统命令!其它的服务启动和上面的类似!
......

Oracle启动时ORA 00600错误处理方法

oracle  startup时 报错ORA-00600: 内部错误代码,参数: [kcratr1_lostwrt], [], [], [], [], [], [], []
原因可能是非法关机或掉电造成,以下是出现的问题及解决方法:
C:\Documents and Settings\Administrator>sqlplus
请输入用户名:  /as sysdba
SQL> startup
ORA-01081: 无法启动已在运行的 ORACLE ......

Redhat Linux oracle 10g em 按钮乱码解决

网上有很多的资料,参考itput(http://space.itpub.net/471666/viewspace-215923)的。
OS : Redhat
DB : Oracle 10.2.0.4.0
1.修改jdk 下面的字体。
[oracle@a ~]$ cd $ORACLE_HOME/jdk/jre/lib/
[oracle@a ~]]$ mv font.properties font.properties_bak
[oracle@a ~]]$
[oracle@a ~]]$ cp font.properties.zh_CN.R ......

SQL 知识

--------------------------------查询系统库中是否有库(有库就删除此库)----------------------------------------------------
use master
if exists(select * from databases where name='库名')
drop database 库名
__________________________  建数据库建表的基本格式  __________________ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号