--把p_string的值动态切分为表的行数据
create or replace type split_rec as object (
id varchar2(50),
userId varchar2(32767)
);
create or replace type split_tbl as table of split_rec;
CREATE OR REPLACE FUNCTION splitstr(id in varchar2,p_string IN VARCHAR2, p_delimiter IN VARCHAR2 := ',')
RETURN split_tbl PIPELINED
AS
v_length NUMBER := LENGTH(p_string);
v_start NUMBER := 1;
v_index NUMBER;
v_rec split_rec;
BEGIN
v_rec := split_rec(id,'');
WHILE(v_start <= v_length)
LOOP
v_index := INSTR(p_string, p_delimiter, v_start);
IF v_index = 0
&n ......
ORACLE错误一览表,方便大家查询!
ORA-00001: 违反唯一约束条件 (.)
ORA-00017: 请求会话以设置跟踪事件
ORA-00018: 超出最大会话数
ORA-00019: 超出最大会话许可数
ORA-00020: 超出最大进程数 ()
ORA-00021: 会话附属于其它某些进程;无法转换会话
ORA-00022: 无效的会话 ID;访问被拒绝
ORA-00023: 会话引用进程私用内存;无法分离会话
ORA-00024: 单一进程模式下不允许从多个进程注册
ORA-00025: 无法分配
ORA-00026: 丢失或无效的会话 ID
ORA-00027: 无法删去当前会话
ORA-00028: 您的会话己被删去
ORA-00029: 会话不是用户会话
ORA-00030: 用户会话 ID 不存在。
ORA-00031: 标记要删去的会话
ORA-00032: 无效的会话移植口令
ORA-00033: 当前的会话具有空的移植口令
ORA-00034: 无法在当前 PL/SQL 会话中
ORA-00035: LICENSE_MAX_USERS 不能小于当前用户数
ORA-00036: 超过递归 SQL () 级的最大值
ORA-00037: 无法转换到属于不同服务器组的会话
ORA-00038: 无法创建会话: 服务器组属于其它用户
ORA-00050: 获取入队时操作系统出错
ORA-00051: 等待资源超时
ORA-00052: 超出最大入队资源数 ()
ORA-0005 ......
Select bu.f_Comechannel,Count(Distinct x.f_username) x ,Sum(bs.f_Paymoney) pmoney
from T_BASE_USER_FIRST_TRADE_LOTTY x
Inner Join t_Base_Userinfo bu On bu.f_Username = x.f_username
Inner Join t_Base_Succprouser bs On bs.f_Username = x.f_username
Where x.f_lotid IN (9)
And bs.f_lotid IN (9)
And x.f_tradetime Between to_date('2009-01-01','yyyy-mm-dd') And to_date('2009-09-26','yyyy-mm-dd')
And bs.f_Expectenddate Between to_date('2009-01-01','yyyy-mm-dd') And to_date('2009-09-26','yyyy-mm-dd')
Group By bu.f_Comechannel
和
SELECT COUNT (distinct b.f_username) num, SUM (b.f_paymoney) allmoney
from t_base_succprouser b
WHERE b.f_lotid IN (9)
AND b.f_username IN
(
SELECT c.f_username
from t_base_user_first_trade_lotty c
WHERE c.f_tr ......
查询数据库当前进程的连接数:
select count(*) from v$process;
查看数据库当前会话的连接数:
elect count(*) from v$session;
查看数据库的并发连接数:
select count(*) from v$session where status='ACTIVE';
查看当前数据库建立的会话情况:
select sid,serial#,username,program,machine,status from v$session;
查询数据库允许的最大连接数:
select value from v$parameter where name = 'processes';
或者:show parameter processes;
修改数据库允许的最大连接数:
alter system set processes = 300 scope = spfile;
(需要重启数据库才能实现连接数的修改)
重启数据库:
shutdown immediate;
startup;
查看当前有哪些用户正在使用数据:
select osuser,a.username,cpu_time/executions/1000000||'s',sql_fulltext,machine
from v$session a,v$sqlarea&nb ......
--查看oracle数据库字符集:
select userenv('language') from dual;
--修改oracle数据库字符集:(在SQL Plus中)
sql> conn / as sysdba;
sql> shutdown immediate;
database closed.
database dismounted.
oracle instance shut down.
sql> startup mount;
oracle instance started.
total system global area 135337420 bytes
fixed size 452044 bytes
variable size 109051904 bytes
database buffers 25165824 bytes
redo buffers 667648 bytes
database mounted.
sql> alter system enable restricted session;
system altere ......
orcl92是DBA身份的进入ORACLE,要建立normal的用户的步骤如下:
1. 先建表空间: 第一步:在Oracle Enterprise Manager Console中
第二步:找到存储
第三步:找到表空间,创建表空间
注意点:一般测试用的表空间,可以取名为test,我建了一个jay的
大小:测试用可先选个50MB,以后不够用时,可再增加
2.创建用户:找到Users
注意:1.Default tablespace:选上对应的表空间,如test,或jay等
&nb ......