小布老师oracle视频讲座笔记(二)
Oracle Process Structure
Oracle takes advantage of various types of processes:
—User process: Started at the time a database user requests connection to the Oracle server
—Server process: Connects to the Oracle instance and is started when a user establishes a session
—Background processes: Started when an Oracle instance is started
User Process: A progrm that requests interaction with the Oracle server, Must first establish a connection, Does not interact directly with the Oracle server.
Server Process: A program that directly interacts with the Oracle Server
—Fulfills calls generated and returns results
—Can be deficated or shared server
IPC: Inter Process Communication, 包括共享内存、队列、信号量等几种形式。
Background Process
Maintains and enforces relationships between physical and memory structures:
—Mandatory background processes
DBWn PMON CKPT LGWR SMON
—Optional background processes
ARCn LMDn QMNn CJQ0 LMON RECO Dnnn LMS Snnn
LCKn Pnnn
DBWn(Database Writer), DBWn writes when:
—Checkpoint occurs
—Dirty buffers reach threshold
—There are no free buffers
—Timeout occurs
—RAC ping request is made
—Tablespace OFFLINE
—Tablespace READ ONLY
—Table DROP or TRUNCATE
—Tablespace BEGIN BACKUP
Log Witer(LGWN), LGWR writes:
—At commit
—When one-third full
—When there is 1MB of redo
--Every three seconds
--Before DBWn writes
System Monitor(SMON)
Responsibilities
—Instance recovery
—Rolls forward changes in noline redo log files
—Opens database fo
相关文档:
oracle表空间操作详解
1
2
3作者: 来源: 更新日期:2006-01-04
5
6
7建立表空间
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
fmobile输入参数,msg输出参数
--方法1
variable msg varchar2(100)
variable fmobile varchar2(100):='13424242890'
exec smsrun.PKG_SETNEIZHI.p_Whynomt(fmobile,msg)
print msg
--方法2
set serveroutput on;
declare
FMOBILE varchar2(100):='13424242890';
msg varchar2(100):= ......
select trim(leading | trailing | both ' ' from ' abc d ') from dual;
去掉字符串 ' abc d ' 的前面/后面/前后的空格
类似函数:ltrim, ......
如何定义游标类型
TYPE ref_type_name IS REF CURSOR [RETURN return_type];
声明游标变量
cursor_name ref_type_name;
从技术底层看,两者是相同的。普通plsql cursor在定义时是“静态”的。而Ref cursors可以动态打开。
例如下面例子:
Declare
type rc is ref cursor;
cursor c is select * from dual ......