停止空想

老张的空中之家

存档于 三月, 2009

解决 oracle EXP-00091: Exporting questionable statistics. 问题(转)

作者:admin 发表时间:三月 - 27 - 2009

EXP-00091 Exporting questionable statistics

Cause: Export was able to export statistics, but the statistics may not be useable. The statistics are questionable because one or more of the following happened during export: a row error occurred, client character set or NCHARSET does not match with the server, a query clause was specified on export, only certain partitions or subpartitions were exported, or a fatal error occurred while processing a table.

Action: To export non-questionable statistics, change the client character set or NCHARSET to match the server, export with no query clause, or export complete tables. If desired, import parameters can be supplied so that only non-questionable statistics will be imported, and all questionable statistics will be recalculated.

解决:
linux下的oracle用户的环境变量语言集和oralce数据库中的环境变量语言集不相同。
查看oracle的环境变量语言集:
数据库服务器字符集:
select * from nls_database_parameters
客户端字符集:
select * from nls_instance_parameters

将oracle用户的环境变量语言集改成和数据库服务器字符集一样。
export NLS_LANG=american_america.ZHS16GBK

类别:Oracle

创建基于函数的index需要什么权限?

作者:admin 发表时间:三月 - 18 - 2009

create index IDX_F_DEP on T_DEPARTMENT (SUBSTR(C_INTER_CDE,1,2))
*
ERROR at line 1:
ORA-01031: insufficient privileges

确认需要有两个权限, 一个是create any index

另一个是global query rewrite

类别:Oracle

如何直接从shell调用sqlite3命令

作者:admin 发表时间:三月 - 16 - 2009

官方的例子如下

Using sqlite3 in a shell script

One way to use sqlite3 in a shell script is to use “echo” or “cat” to generate a sequence of commands in a file, then invoke sqlite3 while redirecting input from the generated command file. This works fine and is appropriate in many circumstances. But as an added convenience, sqlite3 allows a single SQL command to be entered on the command line as a second argument after the database name. When the sqlite3 program is launched with two arguments, the second argument is passed to the SQLite library for processing, the query results are printed on standard output in list mode, and the program exits. This mechanism is designed to make sqlite3 easy to use in conjunction with programs like “awk”. For example:

sqlite3 ex1 ’select * from tbl1′ |
awk ’{printf ”<tr><td>%s<td>%s\n”,$1,$2 }’
<tr><td>hello<td>10
<tr><td>goodbye<td>20
$

阅读全文 »

类别:sqlite3