Mysql基本知识与命令下:

Mysql基本知识与命令下

上次给大家分享的Mysql基本知识与命令上中,已经分享到数据定义语言,接下来给大家分享剩下的四类数据语言。
数据操作语言(DML)
关键字:INSERT、UPDATE、DELETE

  • 说明:数据操作语言在大多数操作数据库中都是增删改

  • 现在创建一张用于测试的表

     create table star(
     id int auto_increment,
     name varchar(20) not null,
     money float not null,
     province varchar(20) default null,
     age tinyint unsigned not null,
     sex tinyint not null,
     primary key(id)
     )engine=innodb default charset=utf8;
    
  • 插入数据

    • 方式1:不指定字段,添加数据的时候需要指定所有的字段值,

      insert into star values(1,'丽丽',100000,'湖南',22,0)
      

      可以一次性插入多个,每条数据都必须使用()扩起来,使用之间使用逗号隔开:

  • 方式2:指定字段,只需要传递指定字段值,通常使用这个方式,如:

    insert into star (name, money, age, sex, province)
    values("狗蛋", 100000,20,0,"北京"),
    ("小妹", 200000,20,0,"上海");
    

    在这里需要说一下,在指定插入数据字段的顺序的时候,后边输入的值要与前面指定的,name字段对应values的"狗蛋"要一致,与数据库里面的字顺序无关。

  • 当有一下字段的时候插入数据不用传值:

    • 自增的字段
    • 有默认值
    • 可以为空
  • 修改数据:

  • 示例:update star set money=888 where id=3;

  • 警告:修改的时候,一定不要忘了添加条件,否则就是修改所有的字段了

  • 删除数据:

  • 示例:delete from star where name=“狗蛋”;

  • 警告:删除操作一定不要了忘了加条件,否则就是删除所有的字段了,这个很严重,但是在真实的项目中,不会真的删除,大多使用逻辑删除。

数据查询语言(DQL)
关键字:SELECT … FROM … WHERE。

  • 基本查询:select * from star(表名);

  • 指定字段查询:select name, money from star;

  • 过滤重复的记录,使用“distinct”关键字:select distinct province from star;

    • 说明:使用distinct 指定的额字段不能重复,指定多个字段
  • 条件查询:

    • 条件

      条件说明
      >大于
      <小于
      >=大于等于
      <=小于等于
      =等于
      !=或 <>不等于
      and并且
      or或者
      [not] between m and n[不]在[m,n]的区间
      [not] in ()[不]在指定的集合中
      [not] like 条件模糊匹配,%表示任意字符
      is [not] NULL是否为空
    • 示例:

      select * from star where id > 2;
      select * from star where id >5 and age >30;
      select * from star where age between 30 and 40;
      select * from star where id in (2,4,6);
      select * from star where province like "湖%";
      select * from star where province is null;
      
  • 结果集排序(order by)

    select name, money from star order by money desc;
    select name, money, age from star order by age asc,money desc;
    
    • 说明:
      • 默认是升序asc,降序desc
      • 多个字段进行排序的时候,先安排第一个排序,相同的话再按照第二个进行排序
  • 限制结果集(limit)

     select * from star limit 3;#提取3条数据
     select * from star limit 3 offset 2;#跳过两条提取3条数据
     select * from star limit 2,3;#同上
    
    • 分页:

      每页 pagesize=10,page表示页码数,请写出对应的查询语句
      第一页:limit 0,10
      d第二页:limit 10,10
      第三页:limit 20,104页:limit 30,10
      
      page页:limit (page - 1)*pagesize,pagesize
      
  • 常用的聚合函数selec

    函数说明
    count统计个数
    sum求和
    max最大值
    min最小值
    avg平均值
    s
    • 示例:

      select count(*)  as c from star;    #可以给查询的字段起别名
      select max(money) as max_money from star;
      
  • 分组及过滤(重要)(group by…having)

    select sex from star group by sex;    #以性别进行分组
    select count(*) as c, sex from star group by sex;#分组以后并统计
    select count(*) as c, province from star group by province having c=1;#分组统计以后过滤
    
    

多表联合查询
在查询语言中,多表联合查询是非常重要的,也是用得最多的。

  • 首先创建两张表,用于举例,其中user的gid对应goods的id。

    create table user (
    id int(11) not null auto_increment,
    username varchar(20) default null,
    gid int(11) ,
    primary key(id));
    
    
    create table goods (
    id int(11) not null auto_increment,
    name varchar(40) default null,
    price float default null,
    category varchar(20) default null,
    primary key(id));
    
  • 隐式内连接,使用where来进行表的关联

    • 说明:查询哪个用户购买了什么商品
    • 示例: select username,name from user,goods where user.gid =goods.id;
  • 显示内连接

    • 说明:功能和隐式内连接一样,使用的关键字是join,一定要注意不是where,是on。
    • 示例:select username,name from user join goods on user.gid=goods.id;
  • 左外连接

    • 说明:使用left jion…on进行左连接,以左边的表为主,主要显示左边的表,右边的表有对应的数据就显示,没有话就显示null
    • 示例:select username,name from user left join goods on user.gid=goods.id;
  • 右外连接

    • 说明:使用right jion…on进行右连接,会显示右边的所有数据,左表有对应的数据的话就显示,没有的话就是null
    • 示例:select username,name from user right join goods on user.gid=goods.id;
  • 记录联合,使用union关键字,格式如下:

    • 格式:select 语句1 union select 语句2

    • 示例:select username,name from user right join goods on user.gid=goods.id union

      select username,name from user left join goods on user.gid=goods.id;

    • union all:将两边的查询结果直接拼接到一起

    • union:去重之后进行拼接

  • 联合更新

    • 示例: update user u, goods g set u.gid=3,g.price=g.price+0.1 where u.gid=g.id and u.id=2;
  • 子(嵌套)查询

    • select * from user where gid in (select id from goods);
    • 说明:条件是一个sql语句

数据事务语言(DTL)
就是指一组相关的SQL操作,我们所有的操作都是事务中的。在数据库中,执行业务的基本单位是【事务】,不是以某一条SQL。数据库在默认情况下,事务是都打开的,也就是说它一种处在事务当中的,一个事务的结束,代表着下一个事务的开启。
执行commit或者rollback指令时,会结束当前事务

  • 说明:用于测试的表的存储引擎必须是InnoDB

  • 关键字:COMMIT、ROLLBACK、SAVEPOINT

  • K开启事务:禁止自动提交

set autocommit = 0;

sql

  • 提交事务:整个事务过程没有出现问题
commit;
  • 操作回滚:事务出现了问题,然后进行回滚,事务开始之前的状态
rollback;
  • 事务的四大特性(ACID):
    atomic,原子性,事务是不可分割的,要么同时成功,要么同时失败;
    consistency,一致性,事务一旦结束,内存中的数据和数据库中的数据是保持一致;
    isolation,隔离性,事务之间互不干扰,一个事务的结束意味着下一个事务的开启;
    duration,持久性,事务一旦提交,则数据持久化到数据库中,永久保存

数据控制语言(DCL)
用来设置或者更改数据库用户或角色权限的语句,这些语句包括GRANT、DENY、REVOKE等语句,在默认状态下,只有sysadmin、dbcreator、db_owner或db_securityadmin等角色的成员才有权利执行数据控制语言。
关键字:GRANT、REVOKE

  • 查看授权

    • 格式:show grants [for ‘user’@‘localhost’]
    • 示例:show grants [for ‘root’@‘localhost’]
    • 说明:查看指定的用户权限,若不指定用户,则查看的是当前登录的用户
  • 创建用户

    • 格式:create user ‘user’@‘host’ identified by ‘password’
    • 示例:create user ‘user’@‘10.20.159.%’ identified by ‘123456’
    • 说明:%是通配符
  • 用户授权

    • 格式:grant 权限 privileges on 库.表 to “user”@‘host’ identified by ‘password’
    • 示例: grant all privileges on test.user to ‘user’@‘10.20.159.%’ identified by '123456‘ #赋予所有权限
    • 说明:
      • 权限可以是:insert,delete,update,select, all是所有的权限
      • 当不是赋予全部权限的时候,格式为:
      • grant 权限 on test.user to ‘user’@‘10.20.159.%’ identified by '123456‘
      • %表示的是任意主机
      • *表示的是所有的库和表
  • 刷新权限:flush privileges

  • 取消权限

    • 格式:revoke 权限 privileges on 库.表 from ‘user’@‘host’
    • 示例:revoke all privileges on test.* from ‘user’@‘10.20.159.%’;
  • 删除用户

    • 格式:drop user ‘user’@‘localhost’
    • 示例:drop user ‘user’@‘10.20.159.%’;

接下来再说说数据的备份和恢复

  • 备份:
    • 将数据库中的数据保存到文件中,使用管理员运行命令提示符,进入到Mysql的安装路径下的bin目录下就可以按照一下操作导出导入数据库。
    • 示例:mysqldump -u root -p test > test.sql,把test数据库导出为test.sql文件,文件就保存在bin目录下
    • 大家也可以使用navicate把数据库导出:右键->转储sql文件的,给大家分享一个链接,是关于navicate的按照和破解的,地址如下:https://blog.csdn.net/tqs314/article/details/80760401
  • 恢复:
    • 从保存的sql、文件中,解析执行sql语句
    • 示例:mysql -uroot -p test2 < test.sql,把test.sql文件数据导入到test数据库中
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
达梦数据库常⽤系统视图及查询语句 ⼀、常⽤的系统视图: dba_objects:显⽰数据库中所有的对象,例如想查询数据库中有没有某个对象 v$sessions:显⽰会话的具体信息,如执⾏的 sql 语句、主库名、当前会话状态、⽤户名等等 v$lock:查看当前数据库中锁的信息 v$mem_pool:显⽰所有的内存池信息 V$deadlock_histor::记录死锁的历史信息 V$TABLESPACE:显⽰表空间信息,不包括回滚表空间信息 V$TRX:显⽰所有活动事务的信息。通过该视图可以查看所有系统中所有的事务以及相关信息,如锁信息等。 ⼆、常⽤查询语句 1、查询数据库在线实例信息 select distinct NAME, HOST_NAME, SVR_VERSION, DB_VERSION, START_TIME, STATUS$, MODE$ from V$INSTANCE; 2、查看数据库常⽤参数值 select PARA_NAME,PARA_VALUE FROM V$DM_INI WHERE PARA_NAME IN('MEMORY_POOL','BUFFER','PORT_NUM','MAX_SESSIONS','MAX_SESS ION_STATEMENT','INSTANCE_NAME','BAK_PATH','SYSTEM_PATH','ARCH_INI'); 3、查询数据库初始化配置 select SF_GET_PAGE_SIZE() page_size, SF_GET_EXTENT_SIZE() extent_size, SF_GET_UNICODE_FLAG() unicode_flag, SF_GET_CASE_SENSITIVE _FLAG() case_sensitive_flag, SF_GET_SYSTEM_PATH() system_path; 4、查询数据库名称、数据库总⼤⼩、数据库是否启⽤归档 select NAME,STATUS$,ARCH_MODE, TOTAL_SIZE from SYS.V$DATABASE; 5、查询数据库连续运⾏时间 select (SYSDATE-START_TIME)*24 FROM V$INSTANCE; 6、查询数据库管理⽤户状态,默认表空间,是否存在被锁定 select D.USERNAME,A.CREATED,D.ACCOUNT_STATUS,D.DEFAULT_TABLESPACE,D.EXPIRY_DATE,D.LOCK_DATE FROM DBA_USERS D,ALL_USE RS A; 7、查询当前数据库的⽇志分组情况 select GROUP_ID,FILE_ID,PATH,CLIENT_PATH,RLOG_SIZE FROM SYS.V$RLOGFILE; 8、查询表空间信息 select T.NAME 表空间名称, D.PATH 表空⽂件路径, T.TYPE$ 表空间类型, T.STATUS$ 表空间状态, T. FILE_NUM 包含的⽂件数, D.TOTAL_SIZE*16/1024 总⼤⼩, D.FREE_SIZE*16/1024 空闲⼤⼩, TRUNC((TRUNC(D.TOTAL_SIZE-D.FREE_SIZE, 4)/D.TOTAL_SIZE)*100, 2) 使⽤率 FROM V$TABLESPACE T, V$DATAFILE D WHERE "GROUP_ID"=T.ID; 9、查询数据表所分配的空间⼤⼩,辅助查询表⽤户使⽤情况 select OWNER,TABLESPACE_NAME,SEGMENT_TYPE,SEGMENT_NAME,BLOCKS,BYTES/1024/1024 FROM DBA_SEGMENTS ORDER BY OWNER,SE GMENT_NAME; 10、查询表索引状态,便于确认表索引是否可⽤ select I.TABLE_OWNER,I.TABLE_NAME,O.OBJECT_NAME,O.OBJECT_TYPE,O.STATUS FROM USER_INDEXES I,USER_OBJECTS O WHERE O.OBJE CT_NAME=I.INDEX_NAME AND O.STATUS='INVALID'; 11、查询数据库归档信息 select ARCH_TYPE,ARCH_DEST FROM V$DM_ARCH_INI; select ARCH_NAME, ARCH_TYPE, ARCH_DEST, ARCH_FILE_SIZE, ARCH_SPACE_LIMIT, ARCH_TIMER_NAME, ARCH_IS_VALID from SYS.V$DM_AR CH_IN
EhLib 9.1.024 源码版本,自行编译 EhLib 9.1 Build 9.1.024 Professional Edition. ---------------------------------------------- The Library contains components and classes for Borland Delphi versions 7, 9, Developer Studio 2006, Delphi 2007, Embarcadero RAD Studio 2009-XE10.2, Lazarus. TABLE OF CONTENTS ----------------- Overview Installation Library Installation Help Demonstration Programs Registering and Prices Other information About author Where to start. ------------------- Start overview of the library with the main Demo project .\Demos\Bin\MainDemo.Exe. (Compiled Demo files are available in the Evaluation version of the library) If you've used previous versions of the library, then you can read a summary of the new features and changes in the file history-eng.html. More detail about new features in this version of the library can be found in the file - About EhLib 9.1 Eng.doc To install a new version of the library in the IDE, use the installation program .\Installer\EhLibInstaller.exe If, at the installation have any problems, write a letter to ehlib support address [email protected] You can also install the files in the library IDE manually, as described in Section 2. Installation Library After installation, make sure the operability of all installed components. To do this, open the IDE, compile and launch a major demonstration project .\Demos\MainDemo\Project1_XE2.dpr Read next file for full instructions of working with the library components: .\Hlp\ENG\"EhLib - Users guide.doc" Read about EhLib for Lazarus in the file - Lazarus<*>\readme.txt Overview -------- The Library contains several components and objects. TDBGridEh component TDBGridEh provides all functionality of TDBGrid and adds several new features as follows: Allows to select records, columns and rectangle areas. Special titles that can correspond to several/all columns. Footer that is able to show sum/count/other field values. Automatic column resizing to set grid width equal client width. Ability to change row and title height. Allows automatic broken of a single line long title and data row to a multiline. Title can act as button and, optionally show a sort marker. Automatically sortmarking. Ability to truncate long text with ellipsis. Lookup list can show several fields. Incremental search in lookup fields. Frozen columns. DateTime picker support for TDateField and TDateTimeField. Allows to show bitmaps from TImageList depending on field value. Allows to hide and track horizontal or vertical scrollbars. Allows to hide columns. Allows to show 3D frame for frozen, footer and data rows. Allows to draw memo fields. Multiline inplace editor. Proportional scrolling independently of sequenced of dataset. Automatically show checkboxes for Boolean fields. Allows to show checkboxes for other type of fields. Has a procedures to save and restore layout (visible columns, columns order, columns width, sortmarkers, row height) in/from registry or ini file. Allows to show hint (ToolTips) for text that don't fit in the cell. Allows to export data to Text, Csv, HTML, RTF, XLS and internal formats. Allows to import data from Text and internal formats. Can sort data in various dataset's. Can filter data in various dataset's. When DBGridEh is connected to DataSet of TMemTable type it allows: To view all data without moving active record. To display a tree-type structure of TMemTable records. To form list of values in dropdown list of SubTitle filter automatically. To create grouping records basing on the selected coulmns. TDBVertGridEh component Component to show one record from dataset in Vertical Orientation. Have a special column to show Field Captions Can customize inplace editor and data of the cell like in DBGridEh. TDBLookupComboboxEh component Provides all functionality of TDBLookupCombobox and adds several new features as follows: Can have flat style. Allows assign values as to KeyValue property just and to display Text property. Allows to type (assign) values to Text property not contained in data list (Style = csDropDownEh). Allows to hold KeyValue and Text as not affecting to each other values. Take effect when KeyField, ListField, ListSource, DataField and DataSource properties is empty. Drop down list can: Show titles, Have sizing grip, Automaticaly set width as sum of DisplayWidth of the list fields (Width = -1), Automaticaly drops on user pressed the key. Edit button can: Show DropDown, Ellipsis or Bitmap image. Have specified width. Have additional events: OnKeyValueChanged, OnButtonClick. TDBSumList component This component is intended for totaling sums and amounts of records in a TDataSet with dynamic changes. Component keeps a list of TDBSum objects, which contains types of group operations (goSum or goCount) and name sum field (goCount name of field is unnecessary). TPrintDBGridEh component TPrintDBGridEh provides properties and routines for preview and print of TDBGridEh component with several features: Ability to expand rows vertically until all text is printed. Ability to scale grid to fit it to page width. Ability to print/preview title for grid. Ability to print/preview page header and page footer where you can specify macros for current page, current date, current time and/or static text. Automatically print/preview multiselected area of TDBGridEh if it area is not empty. Ability to print/preview rich text before and after grid. TPreviewBox component TPreviewBox lets you create a customizable runtime preview. TPrinterPreview object TPrinterPreview lets you to record printable data in buffer for following output them on screen and to printer. TPrinterPreview have all functions and properties as in TPrinter object. You can use TPrinterPreview object similarly of TPrinter except some details. In TPrinter Printer.Canvas.Handle and Printer.Handle is the same but in TPrinterPreview PrinterPreview.Canvas.Handle represent the metafile in that is recored the data and PrinterPreview.Handle represent Printer.Handle. That is mean that you have to use PrinterPreview.Canvas.Handle for draw operation (DrawText, DrawTexteEx, e.t.c.) and use PrinterPreview.Handle in functions that return information about printer facilities (GetDeviceCaps, e.t.c.). Global function PrinterPreview returns default PrinterPreview object and shows data in default preview form. TDBEditEh component represents a single or multi-line edit control that can display and edit a field in a dataset or can works as non data-aware edit control. TDBDateTimeEditEh component represents a single-line date or time edit control that can display and edit a datetime field in a dataset or can works as non data-aware edit control. TDBComboBoxEh component represents a single or multi-line edit control that combines an edit box with a scrollable list and can display and edit a field in a dataset or can works as non data-aware combo edit control. TDBNumberEditEh component represents a single-line number edit control that can display and edit a numeric field in a dataset or can works as non data-aware edit control. TPropStorageEh, TIniPropStorageManEh, TRegPropStorageManEh components Components realize technology to store component properties to/from settings storage such as ini files, registry etc. TMemTableEh component dataset, which hold data in memory. Its possible consider as an array of records. Besides, it: Supports a special interface, which allows DBGridEh component to view all data without moving active record. Allows fetch data from TDataDriverEh object (DataDriver property). Allows unload change back in DataDriver, operative or postponed (in dependencies of the CachedUpdates property). Allows to create a master/detail relations on the client (filtering record) or on the external source (updating parameters [Params] and requiring data from DataDriver). Allows once-only (without the dynamic support) sort data, including Calculated and Lookup field. Allows create and fill data in design-time and save data in dfm file of the Form. Allows keep record in the manner of trees. Each record can have record elements-branches and itself be an element to other parental record. Component TDBGridEh supports to show the tree-type structure of these records. Allows to connect to the internal array of other TMemTableEh (via ExternalMemData property) and work with its data: sort, filter, edit. Has interface for requesting list of all unique values in one column of records array, ignoring local filter of the DataSet. TDBGridEh uses this property for automatic filling a list in DropDownBox of the subtitle filter cell. TDataDriverEh component carry out two tasks: Delivers data to TMemTableEh. Processes changed records of TMemTableEh (writes them in other dataset, or call events for processing the changes in program). TSQLDataDriverEh DataDriver that have four objects of the TSQLCommandEh type: SelectCommand, DeleteCommand, InsertCommand, UpdateCommand, GetrecCommand. TSQLDataDriverEh can not transfer queries to the server but it call global (for application) event which it is necessary to write to execute SQL expressions on the server. TBDEDataDriverEh, TIBXDataDriverEh, TDBXDataDriverEh and TADODataDriverEh Components. These are SQLDataDrivers that can deliver queries to the server using corresponding drivers of the access to datas. -------------------- 2. Installation Library -------------------- -------------------- 2.1 Installing library automatically -------------------- Run EhLibInstaller.exe program from "Installer" folder to install EhLib in Delphi/C++ Builder IDE. The program creates folders to keep EhLib binary and other requared files, copies requared files to created folders, compiles packages, register packages in IDE and write requared paths in registry. If you have executable installation program (for example, EhLibSetupD7Eval.exe) then you only need to run program and follow installation process. Setup automatically writes all units in necessary directory, installs packages and help files in IDE. -------------------- 2.2 Installing library manually ------------------- Follow next instructions to install files from EhLib archive: -- 2.2.1. For RAD Studio XE2 (Delphi) or higher: --------------------------------------------------------------------- Uninstall previous or evaluation version of EhLib (Old version) from Delphi IDE. Remove or copy to other directory files of old version to prevent crossing old and new version of EhLib (Including EhLib.bpl, EhLib.dcp or EhLibXX.bpl, EhLibXX.dcp, EhLibDataDriversXX, DclEhLibDataDriversXX files). These files can be located in the following folders on your computer C:\Users\All Users\Documents\RAD Studio\1X.0 C:\Users\All Users\Documents\Embarcadero\Studio\XX.0\Bpl C:\Users\All Users\Documents\Embarcadero\Studio\XX.0\Dcp Create new folder where source code and binary files will be kept (For example, C:\RAD_Studio_XE2\Components\EhLib). Hereinafter this folder will be call as "EhLib folder". Create new subfolder "Lib" in the "EhLib folder". Copy files from folders "Common", "RADStudioXE2" and "LangResources\Res" of EhLib archive into the folder "[EhLib folder]\Lib" as that all files were in one folder - "Lib". Default language resource of the library is English. If you want to change it to the other language do the next steps: - Select one of language file EhLibLangConsts.XXX.dfm - Copy this file to EhLibLangConsts.dfm file (with replacment of existing file) - In the first line of a new EhLibLangConsts.dfm file delete _XXX suffix in the name of object like this: object TEhLibLanguageConsts_ENU -> object TEhLibLanguageConsts Run RAD Studio IDE and Open EhLibProjGroup160.groupproj file from [EhLib folder]\Lib. Compile all packages of Prject Group. Install DclEhLibXX.Dpk and DclEhLibDataDriversXX.Dpk packages in IDE (Use Project/Install menu). Consistently compile packages EhLibXX.Dpk and EhLibDataDriversXX.Dpk in next modes: Win32\Debug Win64\Release Win64\Debug After compilation there should be created subfolders a Win32\Release, Win32\Debug, Win64\Release, Win64\Debug in the "[EhLib folder]\Lib" folder. Copy the *. dfm and *. res files from the "[Folder EhLib]\Lib" folder into the each of the next folders: Win32\Release, Win32\Debug, Win64\Release, Win64\Debug In the RAD Studio IDE add next paths: "[EhLib folder]\Lib\Win32\Release" path in the "Library path" for the Win32 platform. "[EhLib folder]\Lib\Win32\Debug" path in the "Debug dcu" for the Win32 platform. "[EhLib folder]\Lib\" path in the "Brasing path" for the Win32 platform. "[EhLib folder]\Lib\Win64\Release" path in the "Library path" for the Win64 platform. "[EhLib folder]\Lib\Win64\Debug" path in the "Debug dcu" for the Win64 platform. "[EhLib folder]\Lib\" path in the "Brasing path" for the Win64 platform. -- Copy DEMOS folder from the Archive EhLib to the "[EhLib Folder]". Open and compile any demo project for test. 2.2.2. Delphi 5.x - 7.x, Delphi 9.X Win32, BDS2006 Win32, Delphi2007, CodeGear RAD Studio 2009: ------------------------------------------------------------------------------- Uninstall previous or evaluation version of EhLib (Old version) from Delphi IDE. Remove or copy to other directory files of old version to prevent crossing old and new version of EhLib (Including EhLib.bpl, EhLib.dcp or EhLibXX.bpl, EhLibXX.dcp, EhLibDataDriversXX, DclEhLibDataDriversXX files). Create directory from which you will install EhLib library ('EhLib directory') (for example, C:\Delphi[X]\EhLib). Copy files from "Common", "Delphi[X]" | "BDS2006" and "LangResources\Res.Ansi" folders of the EhLib archive to 'EhLib directory'. Default language resource of the library is English. If you want to change it to the other language do the next steps: - Select one of language file EhLibLangConsts.XXX.dfm - Copy this file to EhLibLangConsts.dfm file (with replacment of existing file) - In the first line of a new EhLibLangConsts.dfm file delete _XXX suffix in the name of object like this: object TEhLibLanguageConsts_ENU -> object TEhLibLanguageConsts By default Delphi (5, 6 and 7) places compiled files to the <Delphi path>\Projects\Bpl directory and this directory already present in the search PATH. But if you overwrite default BPL directory then you need put compiled EhLibXX.BPL file into directory that is accessible through the search PATH (i.e. DOS "PATH" environment variable; for example, in the Windows\System directory). Add, (if needed) 'EhLib directory' in Tools->Environment Options->Library-> Library Path (For Delphi 9 in Tools->Options->Environment Options-> Delphi Options->Library - Win32->Library Path). Use "File\Open..." menu item of Delphi IDE to open the runtime package - EhLibXX.Dpk. In "Package..." window click "Compile" button to compile the package. After that open and compile EhLibDataDriversXX.Dpk. After compiling run-time packages install design-time packages DclEhLibXX.BPL and DclEhLibDataDriversXX.BPL into the IDE. For that use "File\Open..." menu item to open design-time package DclEhLibXX.Dpk. In "Package..." window click "Compile" button to compile the package and then click "Install" button to register EhLib components on the component palette. Open and install DclEhLibDataDriversXX.Dpk package. EhLib components have to appear on 'EhLib' page of components palette. 2.2.4. Delphi 9.X Vcl.Net, , BDS2006 Vcl.Net: ---------------------------------------- Uninstall previous or evaluation version of EhLib (Old version) from Delphi IDE. Remove or copy to other directory files of old version to prevent crossing old and new version of EhLib (Including Vcl.EhLib90.dll, Vcl.DclEhLib90.dll, Vcl.EhLibDataDrivers90.dll, Vcl.DclEhLibDataDrivers90.dll files). Create directory from which you will install EhLib library ('EhLib directory') (for example, C:\BDS\3.0\EhLibVclNet). Copy files from Common and Delphi9 directories of the EhLib archive to 'EhLib directory'. In Delphi IDE: Add, (if needed) 'EhLib directory' in Component->Installed .NET Components ...-> Assembly Search Paths. Add, (if needed) 'EhLib directory' in Tools->Options->Environment Options-> Delphi Options->Library - NET->Library Path. Use "File\Open..." menu item of Delphi IDE to open the runtime package - Vcl.EhLibXX.Dpk. In "Project Manager..." window, click right button above 'Vcl.EhLibXX.Dll' and select "Build" menu to compile package. After that, open and compile Vcl.EhLibDataDriversXX.Dpk, Vcl.DclEhLibXX.Dpk and Vcl.DclEhLibDataDriversXX.Dpk. Open menu "Component->Installed .NET Components ..."->.NET VCL Components. Press 'Add...' button. Locate 'Vcl.DclEhLibXX.dll' and press 'Open'. (By default, this file have to be located in 'EhLib directory' directory) Press 'Ok' in 'Installed .NET Components' Dialog. 4. Documentation and Help ------------------------- 4.1. This version of library doesn't have embedded help files for Delphi8 or Higher. But the online help is available on the ehlib home page - http://www.ehlib.com/online-help 4.2. Delphi 7.x: Copy the EhLib.hlp and EhLib.cnt files to the Delphi HELP subdirectory. Select Help|Customize to start the OpenHelp application. Add the EhLib.cnt file to the Contents page, add the EhLib.hlp file to the Index and Link pages. 5. Demonstration Programs and Projects -------------------------------------- Demonstration programs use tables from the DEMOS directory and ADO Data Access. Read description of Demo projects in the file Demos\Info Eng.doc 6. Registering and Prices ------------------------- The EhLib is a Commercial product. If you find it useful and want to receive the latest versions please register your evaluation copy. You can read detailed information about prices on ehlib home prices page http://www.ehlib.com/buy You can read detailed information about registration at https://secure.shareit.com/shareit/product.html?productid=102489 After registration you will receive (e-mail only) address of registered version for downloading and password for unpacking. By registering the components you get the following advantages: 1. You will get new versions of the library free within a year from the date of registration. 2. You will get technical support for the library all the time. 3. You encourage EhLib Team to make the library even better. 7. Other information ----------------- (1) Information for user who already have old version of TDBGridEH or TDBSumList or EhLib installed: Before installation this version of EhLib uninstall previous version of TDBGridEh or TDBSumList or EhLib from IDE and remove or copy this files to other directory to prevent crossing of new and old files. (2) If at compile-time under C++ Builder you get next error: [Linker Error] Unresolved external 'AlphaBlend' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\LIB\EHLIBB60.LIB|C:\VCL6\EhLib\Common\DBGridEh.pas then add msimg32.lib library in Linker options of your Project. It is placed at $(BCB)\lib\psdk\msimg32.lib 8. About Company ---------------- Contact as if you have any questions, comments or suggestions: EhLib Team
XMGR RDISK and UIDE DOS Device Drivers 1 Description XMGR RDISK and UIDE are a group of DOS device drivers for a PC system with an 80386+ CPU and using MS DOS V5 0+ or equivalent XMGR is a DOS driver which works as an "XMS manager" and provides up to 4 GB of XMS memory XMGR has direct support for V3 70+ UMBPCI by Uwe Sieber After UMBPCI enables upper memory XMGR loads there and will provide both upper and XMS memory to a DOS system XMGR uses an "I O Catcher" with UMBPCI Disk diskette I O above 640K is trapped by XMGR and done using a low memory area as UMBPCI "Shadow RAM" cannot do DMA XMGR also runs with JEMM386 or MS DOS EMM386 With EMM drivers XMGR using its B switch first boots in temporary space When upper memory gets enabled by the EMM driver XMGR loads there with no B copies all its boot data and takes over XMS work For a small XMS only system XMGR can also run entirely in low memory RDISK is a DOS RAM disk driver It creates a "fast" disk drive using 2 Megabytes to 2 GIGABYTES of XMS memory It loads as a system driver in CONFIG SYS or it can load later in AUTOEXEC BAT or by user command DOS can copy critical programs and data to the RAMdisk where they will be read or written at memory speed If loaded after CONFIG SYS RDISK files can be assigned to any free DOS drive letter using its : switch RDISK runs with V2 0 or V3 0 XMS managers 60 MB maximum for V2 0 XMS It uses only 656 to 752 bytes of upper memory depending on the system and it can also load in 640K DOS memory RDISK is a simple and small RAMdisk driver for use when resizing or other features are not needed UIDE is a DOS "Universal IDE" caching driver It intercepts "Int 13h" BIOS I O requests and caches data for up to 30 BIOS disks including A: or B: diskettes and including hard disks of any size UIDE can handle 48 bit LBA or 24 bit CHS I O calls by new or old DOS systems It will handle up to 10 "Legacy" or "Native PCI" IDE controllers UIDE "calls the BIOS" for diskettes and intercepts I O for "Int 13h" drivers loaded first thus UIDE caches ALL drives on a DOS system "ASPI" and other "non Int 13h" drivers are unsupported UIDE also detects and runs up to 8 SATA IDE and old "PIO mode" CD DVD drives It can cache CD DVD data and directories for MUCH greater speed and it will play audio CDs and handle "raw" trackwriter input audio and "raw" input is uncached UIDE caches 5 Megabytes to 4 GIGABYTES of data It can set up to four separate caches of its own "Common" User 1" "User 2" and "CD DVD" and it also permits caching requests from user drivers to "bring along" their OWN caches See the UIDE TXT file for full details UIDE uses 4816 bytes of upper DOS memory for 1 to 4 caches of any size All its data or cache tables use XMS memory A "stand alone" UIDE B switch no cache or diskettes can be used in test or diagnostic work and takes 3664 bytes of upper DOS memory If its N2 switch is given UIDE will omit all CD DVD logic saving 1744 bytes Its "CD DVD" cache can then become a 3rd user driver cache if needed UIDE"s H switch will load most of the driver into "free HMA" thus using only 928 bytes of memory 832 "stand alone" The small UHDD and UDVD2 drivers are also available for those who want only non caching drivers or a smaller size driver set for use on "boot" diskettes etc UHDD can cache 26 SATA IDE disks of any size on up to 10 controllers A: or B: diskettes included It now has all four UIDE caches takes 3280 bytes for caching and it can set a 1408 byte "stand alone" driver no cache with its B switch UHDD can put most of its code in HMA space with its H switch taking only 832 bytes 640 "stand alone" UDVD2 handles up to 6 SATA IDE or old PIO mode CD DVD drives it tests up to 10 controllers on loading and takes 2000 bytes or 144 with its H switch Caching by UHDD adds 96 bytes and UDVD2 "shares" UHDD"s I O buffer in XMS for input unsuited to UltraDMA If UHDD is not used UDVD2 will take 128K of XMS as its buffer or it handles such input in PIO mode if XMS is not available UHDD + UDVD2 require only 10K of disk file space and provide most UIDE features The small RDISKON COM program can "re enable" a DOS drive used by RDISK if a "format" command is accidentally issued to it This disables the drive on some systems Entering RDISKON L at a DOS command prompt where L is the desired drive letter A to Z will re enable the drive The small CC COM "Clear Cache" program can help verify files written by UIDE Entering CC at the DOS command prompt sends a BIOS "reset" to all disks making UIDE flush its "Common" cache Data from the disk NOT data still in cache can then be compared to the original output 2 NO Warranties XMGR RDISK and UIDE are offered at no cost "as is" "use at your own risk" and with NO warranties not even the implied warranty of FITNESS for any particular purpose nor of MERCHANTABILITY Driver questions and comments may be addressed to the E Mail of Johnson Lam <johnsonlam hk@gmail com> 3 Revision Summary 19 Oct 14 UHDD now "overlaps" cache work during UltraDMA disk output and the disk sector "gap" at I O end for greater speed UHDD M switch deleted 256 byte binary search buffer is now permanent Other drivers unchanged re dated only 27 Sep 14 UHDD now sets all 4 UIDE caches New UHDD M switch sets a 512 byte binary search buffer for more speed 26 Jan 14 UIDE error handling CD DVD media changes for "stand alone" mode is fixed UHDD offers "Common" & "CD DVD" caches 12 Jan 14 UIDE UD switch deleted many problems UIDE now offers "User 1" and "User 2" caches "Stand alone" UHDD UDVD2 re added for use as needed 12 Dec 13 UHDD UDVD2 deleted low use UIDE N2 dismisses CD DVD logic UIDE C switch added user caching improved 21 Nov 13 UHDD old style "stand alone" driver re added 14 Nov 13 UHDD UDVD2 "private" caches deleted unneeded and unused 25 Sep 13 BAD error fixed in UDVD2 re: locating UHDD MANY Thanks to Japheth for his tests and exact analysis 9 Sep 13 Possible but unlikely UHDD exit errors corrected UDVD2 UIDE now use all 32 CD DVD LBA bits in caching calls 2 Sep 13 Possible UDVD2 "media change" error fixed UHDD N1 size reduced 26 Aug 13 UHDD now has its "Common" cache and handles "private" user driver caches UDVD2 etc can now set a private cache 28 Jul 13 UHDD UIDE binary search buffer and F switch deleted 30 Apr 13 UHDD UDVD2 can now run without XMS lower speed for tests and FreeDOS "scripts" UDVD2 can now do "raw" input 15 Oct 12 UHDD UIDE again detect A: and B: diskettes from BIOS data NOT from "Int 13h" calls that FAIL with an LS 120 drive 2 Aug 12 UHDD "disk only" caching driver added UDVD2 caches CD DVD data if UHDD is also loaded UIDEJR deleted New UD switch in UDVD2 UIDE for CD DVD directory caching 9 Jul 12 UIDE UIDEJR device select error for master + slave CD DVD units on one IDE channel is corrected Many Thanks to Doug Beneway for finding this error 25 Jun 12 UIDE2 deleted: Not enough added speed complex to use 17 Jun 12 UIDE UIDE2 UIDEJR A switch init of 2 "Old IDE" channels and CD audio "Q" status data corrected Many Thanks to Japheth for his research and audio test program 29 May 12 UIDE and UIDE2 check for diskettes via Int 13h avoid DPTE tests if no PCI BIOS let the BIOS do I O for disks with bad DPTE data all re: VirtualBox BUGS 24 Feb 12 UIDE UIDE2 "64K DMA boundary error" fixed may affect only year 2000 chips or older 16 Oct 11 UIDE M switch deleted search buffer is always 512 bytes UIDE SYS back to 7 5K UIDE S dropped UIDE2 improved 7 Oct 11 All UIDE drivers updated to avoid BIOS "DPTE" ERRORS: Bad DPTE data for USB sticks Many Thanks to Daniel Nice 9 Sep 11 UIDE2 re added UIDE S and UIDE2 handle 6 CD DVD drives 22 Jul 11 UIDE E switch added for DOS emulators VirtualBox etc 20 May 11 UIDE S "short" UIDE added for systems with limited HMA 25 Apr 11 BAD "code mods" init error corrected for UIDE UIDEJR and RDISK XMGR not affected 5 Dec 10 UIDE UIDEJR R15 and R63 switches added to handle old DOS "games" Thanks Guillermo Grana Gomez 28 Nov 10 Minor updates: UIDEJR audio track number error corrected XMGR faster in protected mode Added XMGR and UIDE Z 15 Aug 10 UIDE audio track number error corrected Thanks Nagatoshi Uehara 10 Aug 10 UIDE binary search buffer added Using $ in CD DVD names fixed in UIDE UIDEJR Thanks Japheth 4 Jul 10 README file update XMGR UIDE can use "Native IDE" mode same as "Legacy" "Compatibility" for AHCI mainboards 28 Jun 10 XMGR updated for AHCI see the README sec 7 for details 10 Jun 10 UIDE now ignores "removable HARD disks" size reduced 16 Nov 09 UIDE now caches 4 GIGABYTES of data 6 Oct 09 UIDE and UIDEJR H requests HMA use "at the user"s risk" 2 Sep 09 README file updated FreeDOS users who desire full upper memory must omit UMBPCI and load JEMM386 JEMMEX only 23 Jun 09 RDISK now a COM file RDISK : switch RDISKON program added Corrected UIDE CD DVD handling of VDS errors 9 Jun 09 UIDE UIDEJR N3 switch added for no XMS memory Override of D: name by UIDE$ UIDEJR$ added for no CD DVD drives 15 May 09 Added RDISK 6 May 09 Added UIDEJR 1 May 09 Fixed XMGR "Port 92h" logic error Added XMGR PA and PN switches to control use of "Port 92h" 25 Apr 09 XMGR UIDE license and FreeDOS prohibition deleted drivers and sources are again available to all 4 Switch Options XMGR usually needs only its B switch if "booting" with an EMM driver All XMGR switch options are as follows: B Specifies "boot" mode XMGR loads in temporary memory until upper memory is enabled Without B XMGR loads stand alone in low memory or direct to upper memory with UMBPCI See the CONFIG SYS examples in section 5 Mn Specifies a temporary area for loading XMGR in "boot" mode or for UMBPCI upper memory I O before DOS posts a "workspace" buffer Values are: M1 64K M3 192K M5 320K M7 448K M2 128K M4 256K M6 384K M8 512K Without M M5 is assumed and the 320K area will be used NOTE: DOS systems may NOT load at address 0 and may leave temporary data anywhere in memory Mn helps to find a "safe" area for XMGR to use M is ignored if XMGR loads stand alone Nnn Specifies how many XMS "Handles" can be used by DOS programs The value nn may be 48 80 or 128 If N is omitted 48 "Handles" are used A big system doing much XMS work may need 80 or 128 "Handles" PA Specifies use or non use of PS 2 Port 92h logic to handle the PN system"s "A20" line PA indicates "Always" use Port 92h logic PN indicates "Never" use it and handle "A20" via normal keyboard port logic If P is omitted XMGR "asks the BIOS" if the system has Port 92h logic If not XMGR will use normal "A20" logic NOTE: If "A20" was enabled by DOS before XMGR loads XMGR does not handle it at all Tn Specifies the BIOS requests to use in getting extended memory as follows: T0 No "E820h" nor "E801h" requests T1 Memory list requests only Int 15h AX E820h T2 A dual area request only Int 15h AX E801h T3 "E820h" requests first then an "E801h" request T can usually be omitted causing T3 to be assumed In addition XMGR always uses an old 64 MB request to get T0 memory or if the requests denoted by T1 thru T3 are not successful Users may need to test T1 or T2 separately to see if their BIOS takes them A pre 1994 BIOS may not ignore T1 thru T3 correctly and may require T0 instead For old "QHIMEM" users T4 thru T7 may still be used and work the same as T0 thru T3 W Specifies use of the DOS "workspace" buffer for upper memory I O if loading with UMBPCI If W is omitted or if the DOS system does not have proper workspace logic XMGR sets its own buffer in low memory With PC DOS or EDR DOS W must be omitted Without UMBPCI W is ignored Z See Z for UIDE below RDISK uses only S size and : drive letter switches: Sn Specifies a desired RAM disk size in megabytes of XMS memory Values may be any number from 2 to 2047 S1024 or more creates a 1 to 2 GIGABYTE RAM disk If S is omitted or invalid a 25 MB RAM disk is created by default For old V2 0 XMS managers ROM DOS etc only S2 through S60 may be used See section 5 below for more details :L Specifies the DOS drive letter desired to access RDISK files L may be any available drive letter from A to Z e g :N assigns drive N: to all RDISK files If the drive letter is too high or already in use RDISK will abort and users may need "LASTDRIVE " in CONFIG SYS to set up more drives If RDISK is loaded by CONFIG SYS or if : is omitted the next free drive letter will be used UIDE usually needs only a H switch to use HMA space and a S switch to specify its cache size All UIDE switches are as follows: A Specifies ALTERNATE addressing for "legacy IDE" controllers The first legacy controller uses 01E8h 0168h addresses and a second if present uses 01F0h 0170h addresses A is only for "odd" mainboards with REVERSED addressing for the two legacy IDE controllers Without A the first legacy controller uses 01F0h 0170H and a second uses 01E8h 0168h as is normal for most PC mainboards B Requests a "basic" UltraDMA driver for disks and CDs DVDs no caching or diskette handling This may help for tests or diagnostics The B driver can request 128K of XMS as an UltraDMA I O buffer and it can load in the HMA The N2 switch can be given with B to "dismiss" all CD DVD logic Cnn Sets a separate "CD DVD" cache for higher CD DVD performance Values for nn are the same as for the S switch and permit up to 4 GB caches The "CD DVD" cache can be used by any user driver devices on systems with no SATA or IDE CD DVD drives If C is omitted data for requests addressed to the "CD DVD" cache shall go into UIDE"s "Common" cache D: Specifies the "device name" used by the CD DVD Redirector to access CD DVD drives For example: D:CDROM1 D:SANYO1 etc If D: is not given or the name following a D: is missing invalid UDVD1 is set by default If no CD DVD drives were found UIDE$ overrides any D: name for use with FreeDOS autoloader scripts E Makes the driver call the BIOS for any hard disk I O request E avoids setup trouble on some DOS emulators VirtualBox etc that do not emulate all PC hardware logic E also allows using hard disks on 1994 or older PCs which have no PCI EDD BIOS E still caches disk data unlike N1 that removes ALL disk support If B is given E is ignored NOTE Use of E on protected mode systems JEMM386 etc may run VERY slow Many BIOS programs omit DOS "VDS" support for hard disks and in protected mode they must do "PIO mode" transfers not UltraDMA If E is required a PC should be run in real mode UMBPCI etc whenever possible H Loads most of the driver in "free HMA" space UIDE will use only 928 bytes of upper DOS memory 832 when B is given H must not be used with ROM DOS which has no HMA NOTE MS DOS kernels have ERRORS in posting free HMA space which can give CRASHES Specifying H is "At the user"s risk" No such crashes are noted with other DOS systems also HMA usage by UIDE is under 4K bytes Users should still test a PC system before H is given for any serious tasks with these drivers N1 Requests NO hard disk handling by the driver N2 Requests NO CD DVD handling by the driver N2 will dismiss all CD DVD routines and save 1744 bytes N3 Requests no XMS memory N3 sets UIDE"s B "basic" driver N3 requires loading in low memory or UIDE aborts N3 can LOSE much speed as misaligned or other I O not suited to UltraDMA requires "calling the BIOS" for disks or using "PIO mode" for CD DVD drives N4 See Z below Q Awaits a "data request" before doing UltraDMA disk transfers Q is for "old" systems and may be used only if the driver loads O K but seems unable to transfer data Q must be OMITTED with SATA to IDE adapters from Sabrent and others since they may not emulate "data request" from SATA disks Q does not affect CD DVD drives R15 Sets the driver"s XMS memory at 16 or 64 MB R15 reserves R63 15 MB of XMS and R63 reserves 63 MB of XMS for DOS game programs that require XMS memory below 16 or 64 MB The drivers must be able to reserve this memory reserve their own XMS above that and "free" the 15 63 MB XMS If not the drivers display "XMS init error" and abort R15 or R63 need the drivers to load after the XMS manager XMGR HIMEMX etc so another driver cannot take any XMS first and the reserved XMS is just beyond the HMA See section 7 below for further details Snn Specifies the desired "Common" cache size in megabytes of XMS memory UIDE"s "Common" cache holds data for hard disks diskettes and CD DVD drives when C above is not given Values for S can be 5 15 25 40 50 or any number from 80 to 4093 S1024 and up sets a 1 to 4 GIGABYTE cache Suggested S values are Below 128 MB memory: Use S5 S15 S25 or S40 With 128 MB memory: Use S25 S40 S50 or S80 With 256 MB memory: Use S80 up to S127 With 512 MB memory: Use S160 up to S255 With 1 GB memory: Use S320 up to S511 With 2 GB memory: Use S640 up to S1023 With 4 GB memory: Use S1280 up to S3072 Small systems may prefer S25 or S50 which set 1600 cache blocks and are more efficient If S is omitted invalid an 80 MB cache is set Except for 25 or 50 values below 80 are cut to 40 15 or 5 MB The drivers display "XMS init error" and abort when not enough XMS memory is free If so a smaller cache must be requested For older V2 0 XMS managers ROM DOS etc only S5 to S50 may be used UX Disables all CD DVD UltraDMA even for drives that can do it "PIO mode" then handles all CD DVD I O Except for a few unusual drives by Sony etc which do not follow all ATAPI "rules" UX is rarely needed UX does not affect hard disks Xnn Sets a separate "User 1" cache for user drivers Values for nn are the same as for S above If X is omitted data for requests addressed to the "User 1" cache shall go into UIDE"s "Common" cache Ynn Sets a separate "User 2" cache for user drivers Values for nn are the same as for S above If Y is omitted data for requests addressed to the "User 2" cache shall go into UIDE"s "Common" cache Z For XMGR UIDE UHDD limits XMS moves to 2K byte sections not 64K when in protected mode Z is unneeded for JEMM386 JEMMEX MS DOS EMM386 or real mode UMBPCI If other EMM VCPI or DPMI drivers are used systems must be tested to see if Z is required BAD schemes that allow not enough interrupts during XMS moves can still be in use UIDE"s old N4 switch works the same and can still be used The "stand alone" UHDD ignores N4 or Z and will call the XMS manager to do its XMS moves UHDD usually needs only a H switch to load in HMA space also C S X or Y switches to specify cache sizes A summary of all UHDD switches is as follows: A Sets ALTERNATE addressing for "Legacy" IDE controllers same as UIDE A above Rarely necessary B Requests a 1408 byte "stand alone" driver no caching same as UIDE B above Cnn Sets a "CD DVD" cache size for UDVD2 use same values as for UIDE S above If C is omitted or invalid CD DVD data will go in UHDD"s "Common" cache E Makes the driver "call the BIOS" for hard disk I O requests same as UIDE E above E dismisses UltraDMA disk logic and saves 496 bytes H Loads all but 832 bytes of the driver 640 with B into HMA space See the note for UIDE H above Q Awaits "data request" before beginning UltraDMA I O with old controllers same as UIDE Q above Rarely necessary R15 Reserves 15 MB or 63 MB of XMS for old DOS "game" programs R63 same as UIDE R above Rarely necessary Snn Sets a "Common" cache size same values as UIDE S above Xnn Sets the "User 1" cache size same values for UIDE S above If X is omitted invalid "User 1" data will go in UHDD"s "Common" cache Ynn Sets the "User 2" cache size same values for UIDE S above If Y is omitted invalid "User 2" data will go in UHDD"s "Common" cache Z See Z above UDVD2 normally needs only a H switch to use HMA space and a D: switch to specify a driver "device name" A summary of all UDVD2 switches is as follows: A Sets ALTERNATE addressing for "Legacy" IDE controllers same as UIDE A above Rarely necessary D: Sets a "device name" used by the CD DVD Redirector to access CD DVD drives same as UIDE D: above H Puts all but 144 bytes of the driver in HMA space See the note for UIDE H above Rnn Reserves 15 MB or 63 MB of XMS for old DOS "game" programs same as UIDE R above Rarely necessary UX Disables CD DVD UltraDMA same as UIDE UX above Rarely necessary For all switches in each driver a dash may replace the slash and lower case letters may be used if desired 5 Setup and Configuration XMGR RDISK and UIDE are all loaded using the CONFIG SYS file Your CONFIG SYS should have command lines similar to the following examples: DEVICE C: DOSDVRS XMGR SYS N128 B DEVICEHIGH C: DRIVERS RDISK COM S500 DEVICEHIGH C: SYSTEM UIDE SYS D:TOSHIBA1 S511 H DEVICEHIGH C: USERDVRS UHDD SYS S500 C80 H DEVICEHIGH C: MYDVRS UDVD2 SYS D:BLURAY1 H Note that "Int 13h" BIOS drivers must be loaded first so UIDE UHDD can intercept and cache their DOS Int 13h calls Also note that any user drivers that call UIDE to do caching must be loaded after UIDE so they will "find" UIDE in memory and can "link" to it This also applies if UHDD followed by UDVD2 are used in place of UIDE See the CONFIG SYS examples below With V3 70+ UMBPCI and XMGR a "boot" procedure is not needed UMBPCI loads first to enable upper memory then XMGR loads to offer it and XMS to DOS then other drivers may load For V6 22 V7 10 MS DOS JEMM386 can also be loaded to offer extra upper memory in the "video graphics" areas or if other JEMM386 features are desired NOTE: FreeDOS and some other DOS variants will NOT "add up" the memory found by both UMBPCI and JEMM386 like MS DOS does FreeDOS users who want extra upper memory or other items must omit UMBPCI and load JEMMEX or HIMEMX JEMM386 per their instructions or load XMGR JEMM386 as shown in the 3rd example below An example CONFIG SYS file using V3 70+ UMBPCI and XMGR is as follows: SHELL C: DOS COMMAND COM C: DOS E:512 P DEVICE C: BIN UMBPCI SYS DEVICE C: BIN XMGR SYS W DOS HIGH UMB DEVICE C: BIN JEMM386 EXE I B000 B7FF X C800 EFFF NOEMS ;Optional Int 13h drivers cached by UIDE load now DEVICEHIGH C: BIN UIDE SYS D:CDROM1 S511 C250 H ;Or UHDD plus ; UDVD2 here User drivers that call UIDE load now DEVICEHIGH C: BIN RDISK COM S250 ;Optional Etc XMGR can be used "stand alone" on a small XMS only system It must be the first DOS system driver to load and it must load in LOW memory as in the following example: SHELL C: DOS COMMAND COM C: DOS E:512 P DEVICE C: BIN XMGR SYS DOS HIGH Int 13h drivers cached by UHDD load now DEVICE C: BIN UHDD SYS S80 C15 ;Or UIDE in place DEVICE C: BIN UDVD2 SYS ; of UHDD + UDVD2 User drivers that call UHDD load now DEVICE C: BIN RDISK COM S20 ;Optional Etc With JEMM386 and XMGR XMGR loads first in "boot" mode then JEMM386 and then XMGR finally loads in upper memory JEMMEX can also be used and if so XMGR can be omitted An example CONFIG SYS file which uses the XMGR "boot" procedure is shown below Note that in this example UIDE sets a 2 GIGABYTE disk cache plus a 700 Megabyte CD DVD cache SHELL C: DOS COMMAND COM C: DOS E:512 P DEVICE C: BIN XMGR SYS B ; B for "boot" DOS HIGH UMB DEVICE C: DOS JEMM386 EXE I B000 B7FF NOEMS ;Or JEMMEX here DEVICEHIGH C: BIN XMGR SYS ;No "boot" here Int 13h drivers cached by UIDE load now DEVICEHIGH C: BIN UIDE SYS D:MYDVD S2047 C700 H ;Or UHDD plus ; UDVD2 here User drivers that call UIDE load now DEVICEHIGH C: BIN RDISK COM S500 ;Optional Etc After the above drivers are loaded further CONFIG SYS drivers SETVER ANSI SYS etc can then load in any desired order When a specific RDISK drive letter is required RDISK can now be loaded by AUTOEXEC BAT and its : switch can specify any "free" drive letter e g :Q assigns drive Q: for RDISK files Whenever RDISK is used AUTOEXEC BAT should also include commands which copy all RDISK programs and data up to the RAM disk This is required each time DOS loads as XMS memory is LOST when a system shuts down Such copies usually take little time If RDISK and UIDE UHDD are used users must balance how much XMS memory the drivers use RDISK must take no more XMS than its files may need UIDE UHDD can take most remaining XMS for its caches Some XMS memory must be saved for other programs needing it As an example on a 4 GB system RDISK might use 500 MB UIDE UHDD might use 3 GB and 500 MB is free for other programs These values can be adjusted so RDISK holds programs and "fast" data files while UIDE UHDD cache "ordinary" files Properly balanced use of XMS will give a VERY high speed DOS system Please be sure to set each hard disk"s geometry correctly in your BIOS Set it to "Auto" "LBA" or "LBA Assisted" but NOT to "None" "Normal" "CHS" "ECHS" "User Cylinders Heads Sectors" "Revised ECHS" or "Bit Shift" should run but are NOT preferred If a BIOS has a setting like "UltraDMA" or "UDMA Capable" for a disk enable it "Laptop" power saving items like a "drive spin down timeout" should run O K but must be TESTED before use All these drivers allow 7 seconds for a disk or CD DVD drive to spin up after being idle More DRASTIC power saving items like a "drive SHUTDOWN timeout" may require "extra" logic to restart the drive should be DISABLED or driver I O requests may time out Also be sure to use an 80 connector cable for any UltraDMA drive using "mode 3" ATA 44 44 MB sec or higher When cabling a single drive to an IDE channel note that you MUST use both "ends" of the cable NOT an "end" and the middle connector This prevents ERRORS since an unused cable end can pick up "noise" like a RADIO antenna Be sure to enable all CD DVD drive s through the BIOS set up routines A drive that is "disabled" may cause the BIOS to clear all its UltraDMA flags and force the drive into "PIO mode" zero which is terribly SLOW 6 Error Reporting XMGR and UIDE UHDD UDVD2 will return normal XMS and CD DVD error codes as needed They are listed in the "V3 0 XMS Specification" and in the Microsoft "MS DOS CD ROM Extensions 2 1" document Both are available from Microsoft or from other Internet sources UIDE and UHDD work as "BIOS drivers" and return whichever codes are set for diskettes and hard disks handled by the BIOS For their SATA and IDE hard disks UIDE UHDD can post the following error codes: Code 0Fh DMA error CCh Disk is FAULTED 20h Controller busy E0h Hard I O error AAh Disk not ready FFh XMS memory error Many DOS programs display only "Disk Error" messages with NO code thus disk errors may require running a diagnostic to get better information 7 Technical Notes In all of the following notes "UIDE" also applies to UHDD or UDVD2 as necessary The JEMMEX or JEMM386 drivers are now recommended for use with UIDE if using a DOS system that needs their extra upper memory DPMI VCPI logic etc Other EMM drivers are essentially "abandoned" some with never corrected ERRORS and they should NOT be used The "VirtualBox" emulator as of 15 Oct 2012 does not set a "change line available" bit in BIOS byte 0:48Fh for A: and B: diskettes UIDE will IGNORE diskette drives without a "change line" normally 1985 or older as they cannot declare "media changes" i e a NEW diskette was loaded Until "VirtualBox" gets corrected UIDE will NOT run A: or B: diskettes in such an environment UIDE"s R15 or R63 switches DOS "game" programs are for a real mode system using UMBPCI and XMGR Game players like real mode as it gives more speed If protected mode JEMM386 EMM386 is desired UIDE using a R switch must load prior to the "EMM" driver so the XMS reserved by UIDE is just beyond the HMA If using UMBPCI XMGR UIDE and then an EMM driver this works fine But FreeDOS users and others whose DOS systems permit only one XMS provider i e UMBPCI cannot be used must load XMGR HIMEMX first UIDE second into low memory upper memory isn"t yet enabled then JEMM386 EMM386 last Using JEMMEX with UIDE and a R switch is unrecommended JEMMEX must load first and takes some XMS itself which pushes the reserved XMS above its intended 16 64 MB area and a few DOS "games" programs may CRASH UIDE shall NOT include any huge AHCI logic and will run hard disks in "Legacy" "Compatibility" "Native IDE" mode when using AHCI controllers If a "new" AHCI BIOS has no such settings UIDE with a E switch should be able to call the BIOS and use its logic to handle AHCI disks NOTE that much "DOS driver" code is now being omitted in AHCI BIOS programs Thus UIDE should be TESTED before normal use with an AHCI mainboard Also note that CD DVD drives are not supported by an AHCI BIOS for file I O only for "boot" CDs On a system whose AHCI chips can be set for "Legacy" "Compatibility" "Native IDE" mode CD DVD drives should be run from AHCI ports using such modes On mainboards with no such settings UIDE can run CD DVD drives only on the parallel IDE port 80 pin cable or IDE capable "add on" cards from Promise etc that UIDE can "detect" using normal PCI bus logic UIDE handles only "Legacy" or "Native PCI" IDE controllers RAID only chipsets Via VT6420 etc "port multiplier" chips and ADMA chipsets are not currently supported AHCI is supported only through "Legacy" "Compatiblity" or "Native IDE" controller settings or by UIDE "calling the BIOS" as noted above To use UIDE a mainboard BIOS must set SATA and IDE controllers to some form of "IDE" mode not RAID ADMA AHCI for best speed If no "Legacy" "Compatibility" "Native IDE" BIOS setting for disk controllers is provided a Sabrent converter card or similar will let UIDE handle SATA hard disks or CD DVD drives from the parallel port IDE controller channel using full UltraDMA speeds Except if necessary for AHCI it is NOT RECOMMENDED for UIDE to run any DOS disk using only the BIOS Many BIOS programs have no DOS "Virtual DMA" logic If so when an EMM driver JEMM386 etc enables its "V86 protected mode" the BIOS can do only PIO mode transfers and LOSES much speed If needed get SATA to IDE adapters for SATA disks as above or get "Int 13h" disk drivers for SCSI or other disk models UIDE can then handle such disks at full DMA speeds XMGR loads in UMBPCI upper memory BEFORE that memory is declared to the DOS system Memory displays using UMBPCI may not list XMGR since its memory is not part of the DOS memory lists Such memory displays will begin with a block having a 00A7h offset or greater if using 80 or 128 XMS "Handles" The upper memory skipped by this offset contains XMGR The UMBPCI upper memory manager uses system "Shadow RAM" that CANNOT do DMA Newer BIOS programs may use UltraDMA to load programs into upper memory If this is UMBPCI "Shadow RAM" a CRASH will occur To stop this and handle new BIOS programs users should follow these two RULES for running UMBPCI together with XMGR and UIDE UHDD: A The loading "order" for V3 70+ UMBPCI and XMGR shown in section 5 above MUST be used This lets the XMGR "I O Catcher" intercept and process upper memory disk I O until UIDE UHDD loads and takes over disk UltraDMA Old UMBPCI versions or other UMBPCI loading schemes are NOT recommended B When CHS I O is done MS DOS V6 22 or older every disk MUST have valid CHS parameters Otherwise UIDE UHDD and the "I O Catcher" let the BIOS deal with CHS I O If BIOS UltraDMA is not disabled a similar "Shadow RAM" CRASH will occur Some "CD ROM boot" programs handle the CD DVD as a "fake" hard disk and provide incorrect EDD BIOS data for it In scanning for disks to use UIDE may display "EDD BIOS error Unit ignored " then go on searching for more UltraDMA disks Users who did NOT "boot" from CD DVD need to see which disk was passed over and why Users who DID "boot" from CD DVD where all SATA UltraDMA disks were found may IGNORE this message It is caused by an ERROR in the "CD ROM boot" program NOT by a problem with UIDE or its SATA UltraDMA disks Some BIOS programs do not "configure" a mainboard controller if no user drives are on it An unconfigured controller causes UIDE to display "BAD controller" then it goes on looking for others to use If this message is displayed users should verify that each SATA UltraDMA drive was made "active" thru the BIOS set up logic If so "BAD controller" says a chip was not set to both "Bus Master" and "I O Space" modes and the BIOS should be UPDATED ">XMGR RDISK and UIDE DOS Device Drivers 1 Description XMGR RDISK and UIDE are a group of DOS device drivers for a PC system with an 80386+ CPU and using MS DOS V5 0+ or equivalent XMGR is a DOS driver w [更多]
这是一款全新的ORM软件(仅依赖一个jar: gson): 如果你觉得hibernate难以驾驭,或许该软件正是你所想要的 如果你觉得mybatis成堆的xml/mapper太繁琐,或许该软件正是你所想要的 如果你觉得现有的ORM软件总有那么些不太满意的地方,或许该软件有你所想要的 如果你觉得将SQL的查询结果映射成Map使用起来不太方便,该软件能帮你自动产生class 如果你觉得配置型SQL语法书写起来不太方便,该软件借用JSP编辑器来书写SQL, IDE能帮助你实现代码提示 如果你想尝试下新的ORM软件, 欢迎来使用! 5分钟演示视频     参考:例子工程 一行代码引入数据库: @DB(url="jdbc:mysql://127.0.0.1:3306/test" ,username="root", password="root") 一些基本的数据库操作: //insert new User().setName("zzg.zhou").setStatus(1).save(); //parse data from type: Map, json/xml string, JsonObject(Gson) //, HttpServletRequest, JavaBean new User().parse("{'name':'oschina','status':0}").save(); new User().parse("<data> <name>china01</name><status>1</status> </data>").save(); //select User.SELECT().selectByPrimaryKey(1); //SQL: SELECT * FROM `user` WHERE `name` = 'zzg.zhou' User.SELECT().selectOne("name=?", "zzg.zhou"); //SQL: SELECT `name`, `status` FROM `user` User.SELECT().include("name","status").select();   Page<User> page=User.WHERE().name.like("zzg%").status.in(1,2,3) .SELECT().selectPage(10,0); System.out.println(page.getTotalRow()); //SQL: SELECT * FROM `user` WHERE `name` like 'zzg%' AND `status` IN(0, 1) for(User x:User.WHERE().name.like("zzg%").status.in(0, 1).SELECT().select()){ System.out.println(x); } //SQL: SELECT * FROM `user` WHERE (`name` like 'zzg%' AND `status` >= 0)  //                             OR (`name` = 'zzg' AND `status` > 1) // ORDER BY `status` ASC  for(User x:User.WHERE() .name.like("zzg%").status.ge(0) .OR() .name.eq("zzg").status.gt(1) .status.asc() .SELECT().select()){ //SELECT / delete / update System.out.println(x); }   //general query TestDB.DB.select("SELECT * FROM user WHERE name like ?","zzg%"); TestDB.DB.createQuery().add("SELECT * FROM user WHERE name like ?","zzg%") .getList(User.class);   Query q=new Query(TestDB.DB); DataTable<DataMap> rs=q.add("SELECT * FROM user WHERE name like ?","zzg%")  .add(" AND status ").in(1,2,3)  .getList(); for(User x:rs.as(User.class)){ System.out.println(x); } //DataTable query //SQL: SELECT name, count(*) as cnt FROM _THIS_TABLE // WHERE status>=0 GROUP BY name ORDER BY name ASC DataTable<DataMap> newTable= rs.select("name, count(*) as cnt","status>=0","name ASC","GROUP BY name"); //update User user=User.SELECT().selectOne("name=?", "zzg.zhou"); user.setStatus(3).update(); User updateTo=new User().setName("tsc9526"); User.WHERE().name.like("zzg%").update(updateTo); //transaction Tx.execute(new Tx.Atom() { public int execute() { new User().setName("name001").setStatus(1).save(); new User().setName("name002").setStatus(2).save(); //... other database operation return 0; } });   //Dynamic model: Record Record r=new Record("user").use(TestDB.DB); r.set("name", "jjyy").set("status",1)  .save(); //SQL: SELECT * FROM `user` WHERE (`name` like 'jjyy%' AND `status` >= 0) //                             OR (`name` = 'zzg' AND `status` > 1) // ORDER BY `status` ASC  for(Record x:r.WHERE() .field("name").like("jjyy%").field("status").ge(0) .OR() .field("name").eq("zzg").field("status").gt(1) .field("status").asc() .SELECT().select()){ System.out.println(x); }  //SQL: DELETE FROM `user` WHERE `name` like 'jjyy%' AND `status` >= 0 r.WHERE()  .field("name").like("jjyy%").field("status").ge(0)  .delete();   //delete user.delete(); //SQL: DELETE FROM `user` WHERE `name`='china01' User.WHERE().name.eq("china01").delete(); //User.DELETE().deleteAll();   SQL查询自动产生结果类: /** * 数据访问类 */ public class UserBlogDao { final static long $VERSION$= 18L; //!!! 版本号, 每次保存为自动 1 //@Select 注解指示该方法需自动生成结果类 //默认类名: Result 方法名, 默认包名:数据访问类的包名 "." 数据访问类的名称(小写) //可选参数:name 指定生成结果类的名称 @Select(name="test.result.UserBlogs") //!!! 保存后会自动修改该函数的返回值为: List -> List<UserBlogs> //第一次编写时,由于结果类还不存在, 为了保证能够编译正常, //函数的返回值 和 查询结果要用 泛值 替代, 保存后,插件会自动修改. //函数的返回值 和 查询结果 泛值的对应关系分三类如下: //1. List查询 //public DataTable method_name(...){... return Query.getList(); } 或 //public List method_name(...){... return Query.getList(); } // //2. Page查询 //public Page method_name(...){... return Query.Page(); } // //3. 单条记录 //public Object method_name(...){... return Query.getResult(); } // public List selectUserBlogs(int user_id){ Query q=TestDB.DB.createQuery(); q.add(""/**~{ SELECT a.id,a.name,b.title, b.content,b.create_time FROM user a, blog b WHERE a.id=b.user_id AND a.id=? }*/, user_id); //!!! 保存后会自动修改 查询结果为: getList() -> getList<UserBlogs.class> return q.getList(); } @Select //自动产生结果类: test.dao.userblogdao.ResultSelectUserBlogsOne public Object selectUserBlogsOne(int user_id){ Query q=TestDB.DB.createQuery(); q.add(""/**~{ SELECT a.id,a.name,b.title, b.content,b.create_time FROM user a, blog b WHERE a.id=b.user_id AND a.id=? }*/, user_id); return q.getResult(); } } Eclipse 插件使用效果:(插件下载) 1. 支持Java多行字符串编辑: 2. 自动生成模型类: 3. 动态SQL自动产生结果类 更多用法参考:https://github.com/11039850/monalisa-orm/wiki maven坐标: <dependency> <groupId>com.tsc9526</groupId> <artifactId>monalisa-orm</artifactId> <version>1.7.0</version> </dependency> 备注: 目前只实现了Mysql接口,其它类型的数据库后续补上 标签:monalisa
数据库管理系统检查命令清单全文共2页,当前为第1页。数据库管理系统检查命令清单全文共2页,当前为第1页。数据库管理系统测评检查命令 数据库管理系统检查命令清单全文共2页,当前为第1页。 数据库管理系统检查命令清单全文共2页,当前为第1页。 Oracle 数据库 命令 说明 Oracle数据库管理系统测评检查命令 数据库检查时主要使用select只读查看命令,主要查看用户情况、安全策略配置文件、日志等。 cat /$ORACLE_HOME/rdbms/admin/utlpwdmg.sql cat /$ORACLE_HOME/network/admin/sqlnet.ora select * from v$version; select username,account_status from dba_users; select resource_name,limit from dba_profiles where profile='DEFAULT'; select granted_role from dba_role_privs where grantee='PUBLIC'; show parameter O7_DICTIONARY_ACCESSIBILITY; show parameter audit show parameter audit_sys_operations; show parameter audit_trail; select * from dba_stmt_audit_opts; select grantee from dba_tab_privs where table_name='AUD$' and grantee not in ('DELETE_CATALOG_ROLE') and grantee not in (select grantee from dba_role_privs where granted_role='DBA'); select resource_name,limit from dba_profiles where profile='DEFAULT' and resource_type='KERNEL'; select username,profile from dba_users; select * from dba_role_privs where granted_role= 'DBA'; select * from V_$PWFILE_USERS; archive log list; show parameter log_archive_dest; select * from role_sys_privs; select * from dba_sys_privs select policy_name,status from dba_sa_policies; select * from sys.aud$ where ROWNUM<5; SELECT name,password FROM user$ WHERE name='SYS'; select name from v$database; select instance_name from v$instance; Mysql 数据库管理系统检查命令清单全 共2页,当前为第2页。数据库管理系统检查命令清单全文共2页,当前为第2页。Mysql数据管理系统测评检查命令 数据库管理系统检查命令清单全 共2页,当前为第2页。 数据库管理系统检查命令清单全文共2页,当前为第2页。 数据库检查时主要使用select只读查看命令,主要查看用户情况、安全策略配置文件、日志等(连接数据库:mysql –uusername –ppassword show databases;use mysql;) cat my.ini select user(); select host,user,password from mysql.user; show global variables like "%timeout%"; show variables like '%skip_networking%'; show variables like 'log_%'; show variables; select * from mysql.user; select version(); netstat -lnpt " grep 3306 cat .mysql_history cat /etc/my.cnf SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值