Oracle或sql2005分页
/// <summary>
/// 返回分页SQL语句
/// </summary>
/// <param name="selectSql">查询SQL语句</param>
/// <param name="PageIndex">当前页码</param>
/// <param name="PageSize">一页多少条记录</param>
/// <returns></returns>
public static string getPageSplitSQL(string selectSql, int PageIndex, int PageSize)
{
string StartSelectSql = @" select * from (select aa.*, rownum r from (";
int CurrentReadRows = PageIndex * PageSize;
int startRow = (CurrentReadRows - PageSize) < 0 ? 0 : (CurrentReadRows - PageSize);
int endRow = CurrentReadRows == 0 ? PageSize : CurrentReadRows;
string EndSelectSql = string.Format(") aa where rownum <= {1}) bb where r >{0} ", startRow, endRow);
return StartSelectSql + selectSql + EndSelectSql;
}
相关文档:
ORACLE里锁有以下几种模式:
0:none
1:null 空
2:Row-S 行共享(RS):共享表锁,sub share
3:Row-X 行独占(RX):用于行的修改,sub exclusive
4:Share 共享锁(S):阻止其他DML操作,share
5:S/Row-X 共享行独占(SRX):阻止其他事务操作,share/sub exclusive
6:exclusive 独占(X):独立访问使用,exclusive
......
一,Oracle数据库用户简介
在Oracle数据库中任何对象都属于一个特定用户,或者说一个用户与同名的模式相关联。
要连接到Oracle数据库需要一个用户帐户,根据需要授予的操作权限。
1,默认数据库用户模式:
Sys:数据库字典(存储被管理对象所有信息)和视图存储在该模式中。系统级用户。 ......
1)建立操作系统目录e:\test,准备数据文件dept.txt并置于e:\test之下
"10","ACCOUNTING","NEW
YORK"
"20","RESEARCH","DALLAS"
"30","SALES","CHICAGO"
"40","OPERATIONS","BOSTON"
2)创 ......
原创于2007年04月12日,2009年10月15日迁移至此。
windows xp,数据库oracle 10.2.0。1
没有备份,基本上是默认安装,好像还不是归档模式
症状:sqlplus只有sysdba用户能进去,其他用户进去一概报:ora-01033:oracle正在初始化或关闭
而且sysdba用户进去之后能执行select sysdate from dual,但是执行select use ......