Oralce中Procedure如果返回结果集,并在SQLPLUS中打印出来。
用惯了sql server ,觉得在Oracle中存储过程中返回结果集有点麻烦。期待着某个未来,Oralce也支持在存储过程中直接调用select语句。下面举例演示一下如何在SQL*PLUS中调用存储过程并返回结果集。 1. 自定义一个ref cursor的变量SQL> create or replace package types 2 as 3 type cursorType is ref cursor; 4 end; 5 /Package created. 2. 建立一个存储过程,有一参数返回ref cursor 。SQL> create or replace procedure ref_cursor(p_cursor out types.cursorType) 2 is 3 begin 4 open p_c
oracle数据块的内部结构分析
数据块包含三层:Cache layer、Transaction layer、Data layerCache layer 1, Block format 数据块格式(标识那一版本Oracle产品的块,Oracle7 or Oracle8) cache header提供损坏数据检查信息,确保数据块被正确的读写。 2, Type 类型(table、index、header and so on) 3, SCN 4, Data Block Adrress 5, Sequence number (seq#) 6, Flag 标识这个块的状态 C=committed B=rollback 等等 The Cache Layer is 20 bytes and is described by the structure kcbh. Transaction layer 1, commo
数据库sys帐号的密码文件认证模式
该实验的目的是使用密码文件认证的方式进入sys帐号.Windows系统下 1、密码文件存放的位置:$ORACLE_HOMEdatabase2 密码文件命名规则:pwd$ORACLE_SID.oraLinux系统下 1、密码文件存放的位置: $ORACLE_HOME/dbs/2 密码文件命名规则:orapw$ORACLE_SID要想使用密码文件作认证,首先必须更改oracle初始参数,如下alter system set remote_login_passwordfile=EXCLUSIVE scope=spfile; 建立密码文件orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=oracle [@more@]