Wednesday, September 8, 2010 1:56

‘Database’ News

Subscribe to RSS feed

SQL Server Profiler – Only TrueType fonts are supported

Sunday, August 22, 2010 13:12

Error message - "Only TrueType fonts are supported. This is not a TrueType font." was thrown when using SQL Server Profiler. Solution: 1. Open SQL Server Profilr 2. Go to ' Tool'Menu 3. Select Options 4. Change the font name to "Arial" 5. Click OK.

Tagged with:

Get definition for view in Oracle

Friday, April 23, 2010 9:19

set LONG 10000 select TEXT from ALL_VIEWS where view_name = 'MY_VIEW'; Line one must be at least the size of the statement used to create the view. Either pick a really ...

Tagged with: ,

PowerDesigner Non SQLError

Friday, February 5, 2010 13:35

The error "Non SQLError Could not load class Driver_name" was thrown when using PowerDesigner to generate the hibernate mapping files. This error occurs if you enter an incorrect Driver and URL in the Database Profile.

Tagged with:

PowerDesigner Reverse Engineer

Friday, February 5, 2010 13:34

Get the Physical Data Model 1. Menu Operation File, Reverse Engineer , Database, New Phycial Data Model 2. Connection Add a connect to the target database 3. Choose tables to generate the models Generate the Java Code 1. Menu Operation Tools , Generate Object-Oriented Model, Detail, O/R Mapping, Enable Transformations, Extended Model Definitions, O/R Mapping,      Hibernate To be continued.

Tagged with: ,

Import MySQL dumpfile

Wednesday, January 27, 2010 13:55

how to correctly import a MySQL dumpfile through a command line. mysql -p -h DBSERVER dbname < dbname.sql

Tagged with:

DateDiff 用法

Wednesday, January 13, 2010 16:17

DateDiff 用法 DateDiff: SQL server函数 返回 Variant (Long) 的值,表示两个指定日期间的时间间隔数目。 语法 DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]]) DateDiff 函数语法中有下列命名参数: 部分 描述 interval 必要。字符串表达式,表示用来计算date1 和 date2 的时间差的时间间隔 Date1□date2 必要;Variant (Date)。计算中要用到的两个日期。 Firstdayofweek 可选。指定一个星期的第一天的常数。如果未予指定,则以星期日为第一天。 firstweekofyear 可选。指定一年的第一周的常数。如果未予指定,则以包含 1 月 1 日的星期为第一周。 设置 interval 参数的设定值如下: 设置 描述 yyyy 年 q 季 m 月 y 一年的日数 d 日 w 一周的日数 ww 周 hh 时 n 分钟 s 秒 firstdayofweek 参数的设定值如下: 常数 值 描述 vbUseSystem 0 使用 NLS API 设置。 vbSunday 1 星期日(缺省值) vbMonday 2 星期一 vbTuesday 3 ...

SQL Server JDBC Connection Errors: Error establishing socket, connection refused…

Wednesday, January 6, 2010 20:29

SQL Server JDBC Connection Errors: Error establishing socket, connection refused... java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket. at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) ...

Oracle Tuning Documentum Server

Monday, December 7, 2009 14:44

Modifying the dmcl.ini File on the Oracle WebCenter Content Service for Documentum Host On all computers that host the Oracle WebCenter Content Service for Documentum, you can increase the max_session_count variable in the dmcl.ini file to allow for additional concurrent sessions. By default, the ...

Tagged with: ,

Oracle Session Statistics

Monday, December 7, 2009 13:55

Here are some scripts related to Session Statistics . Session I/O By User SESSION I/O BY USER NOTES: Username - Name of the Oracle process user OS User - Name of the operating system user PID - Process ID of the session SID - Session ID of the session Serial# - Serial# of the session Physical Reads - ...

Tagged with:

spool命令和使用select语句批量动态生成sql语句

Friday, November 27, 2009 15:16

今天一个任务是从两张表中用sql语句导出些数据,并且提交这些数据的插入语句。上网查询后找到个方法,例子如下: spool c:\data.sql; select 'insert into table_name values('''||field_1||''','''||field_2||''');'from table_name where field_n=some_conditon; spool off; 从这个方案中引申学到两条:spool命令和使用select语句批量拼装sql语句 spool命令 1 Oracle的spool命令可以用来将数据export出来到文本文件。Oracle的Import/Export命令用于备份和恢复比较有效,但对于一些临时数据量的导出,Export不好用,甚至不可用。在这里,就是spool的发挥之地了。 2Spool一般使用格式为spool [filepath]filename;       其他sql语句;spool off; 要输出的内容都在spool语句中包含; 3 spool还有些其他控制命令: set pagesize 0               --设置页面大小, 0表示无限制,如果设置为10,则10行数据后出现一空行 set num 18                  --设置数字的长度,如果不够大,则用科学记数法显示 set heading off             --设置不要题头,则不出现select的field list set feedback off           --设置不需要返回信息, 比如" 100 rows selected“ set term off                 -- set trimspool on           --trim 4 如果在sqlplus中直接使用sql语句,则导出的数据文件中会包含spool语句中使用的sql语句,如果不想让生成这些可把要使用的sql语句存在一个文件中再在sqlplus中执行此文件即可。 使用select语句批量拼装sql语句 仿照select 'insert into table_name values('''||field_1||''','''||field_2||''');'from table_name where field_n=some_conditon;可联想批量生成其他sql语句,例如drop、update、delete语句。其中||为连接符号,三个单引号最后生成一个单引号。

Tagged with: