oracle 的两个替换函数 REPLACE TRANSLATE
replace就是一般意义上的字符串替换,translate只是一个字符替换对应的一个字符,下面有手册说明,还有例子 O(∩_∩)O哈哈~
REPLACE
Syntax
Purpose
REPLACE returns char with every occurrence of search_string replaced with replacement_string. If replacement_string is omitted or null, then all occurrences of search_string are removed. If search_string is null, then char is returned.
Both search_string and replacement_string, as well as char, can be any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB. The string returned is in the same character set as char. The function returns VARCHAR2 if the first argument is not a LOB and returns CLOB if the first argument is a LOB.
REPLACE provides functionality related to that provided by the TRANSLATE function. TRANSLATE provides single-character, one-to-one substitution. REPLACE lets you substitute one string for another as well as to remove character strings.
Examples
The following example replaces occurrences of J with BL:
SELECT REPLACE('JACK and JUE','J','BL') "Changes"
from DUAL;
Changes
--------------
BLACK and BLUE
TRANSLATE
Syntax
PurposeTRANSLATE returns expr with all occurrences of each character in from_string replaced by its corresponding character in to_string.
Characters in expr that are not in from_string are not replaced. If expr is a character string, then you must enclose it in single
quotation marks. The argument from_string can contain more characters than to_string. In this case, the extra characters at the
end of from_string have no corresponding characters in to_string. If these extra characters appear in char, then they are removed
from the return value.
You cannot use an empty string for to_string to remove all characters in from_string from the return value. Oracle Database
interprets the empty string as null, and if this function has a null argument, then it returns null.
TRANSLATE provides functionality related to that provided by the REPLACE function
相关文档:
使用unrecoverable创建表
create table new_emp as select * from emp unrecoverable;
create table new_emp as select * from emp nologging;
推荐使用logging或者nologging.
将表移动到新的数据段或新的表空间
通过移动来实现存储参数的修改
alter table emp move storage(initial 1m next 512k mimexte ......
1. 修改redo log file大小
SQL> select group#,status from v$log;
SQL> alter database add logfile group 4 'F:\oracle\product\10.2.0\oradata\orcl\REDO04.LOG' size 512m;
SQL> alter system switch logfile;
SQL> select group#,status from v$log;
2. 修改large_pool_size大小
SQL> alter  ......
SQLProgress是一个小巧的操作数据库的工具,所有的版本都不超过3M,包括现在最新的34版本。33以及以前的版本需要安装BDE才能运行,从34开始,只支持Oracle数据库,采用ODAC作为数据库访问的接口,只需要一个不到3M的可执行文件就可以对数据库进行操作,其他什么都用安装。该版本是在SQLProgress1.01.33基础上修改的,33是BD ......
以前只知道java能调用oracle存储过程和函数,但今天我发现原来oracle也可以调用java
测试环境oracle 10g
call dbms_java.set_output(5000);
--首先在oracle中编译java文件 以下是个简单的
create or replace and compile java source named helloworld as
public class hellowor ......
1、从表中随机取记录
select * from (select * from staff order by dbms_random.random)
where rownum < 4
表示从STAFF表中随机取3条记录
2、产生随机数
SELECT DBMS_RANDOM.RANDOM from DUAL;
  ......