在电缆公司的测试服务器上安装了Oracle、ArcGIS,把空间数据和属性数据都导入数据库,出现一个怪问题,空间搜索返回的要素指针总是为空。最后在同事的帮助下发现了问题所在。用SQL*Plus设置了一下Oracle的系统变量,问题解决。
If you are using an spfile.ora file (the default in oracle9.2), use SQL*Plus to connect to Oracle as a user as SYSDBA and execute:
ALTER SYSTEM SET "_push_join_union_view" = false SCOPE = SPFILE;
Make sure to use double-quotes,else SQL*Plus will raise an error because of the leading underscore character(the underscore indicates that this is a hidden parameter).This is also a static initialization parameter,meaning you must restart your Oracle instance for it to take effect(remember to shut down ArcSDE first).If you are using an init.ora file, and the following line to that file:
_push_join_union_view=false
The default init.ora file on Unix system is:
ORACLE_HOME/dbs/init[sid].ora
where [sid] is the value of your ORACLE_SID environment variable.
On Windows,it is ORACLE_HOME\database\init[sid].ora
This may or may not be the actual location of your init.ora file(one of the drawbacks to using this order-style parameter file),but there will likely be a link or placeholder (with an IFILE or PFILE parameter) in the location identified above.
As with the spfile.ora file,you must restart Oracle for this parameter to take effect.
2009年4月22日星期三
SDE注册看不到空间数据
SQL语句like子句中的转义符
如果想在SQL LIKE里查询有下划线'_'或是'%'等值的记录,直接写成like 'XXX_XX',则会把'_'当成是like的通配符。SQL里提供了 escape子句来处理这种情况,escape可以指定like中使用的转义符是什么,而在转义符后的字符将被当成原始字符,这和C里的'\'很像,但是 escape要求自定义一个转义符,而不是指定了'\’字符。如:
select * from user_all_tables where table_name like 'YW__%' escape '_'
含义是查出当前用户表下所有以'YW_'开头的表,其中第一个'_'是转义符,第二个是被转义的字符,等效可以写成:
select * from user_all_tables where table_name like 'YW\_%' escape '\'
比较易懂的方法-使用中括弧包住特殊字元.
select * from tableName where columnName like '%[%]%'
但是,除了用like外,还有一个更方便且快速的语法,
select * from tableName where charindex('%',fieldName) > 0
有待验证
Windows关机命令之SHUTDOWN用法
Windows XP的关机是由Shutdown.exe程序来控制的,位于Windows\System32文件夹中。如果想让Windows 2000也实现同样的效果,可以把Shutdown.exe复制到Win2000的系统目录下。
比如你的电脑要在22:00关机,可以选择“开始→运行”,输入“at 22:00 Shutdown -s”,这样,到了22点电脑就会出现“系统关机”对话框,默认有30秒钟的倒计时并提示你保存工作。如果你想以倒计时的方式关机,可以输入 “Shutdown.exe -s -t 3600”,这里表示60分钟后自动关机,“3600”代表60分钟。
设置好自动关机后,如果想取消的话,可以在运行中输入“shutdown -a”。另外输入“shutdown -i”,则可以打开设置自动关机对话框,对自动关机进行设置。
Shutdown.exe的参数,每个都具有特定的用途,执行每一个都会产生不同的效果,比如“-s”就表示关闭本地计算机,“-a”表示取消关机操作,下面列出了更多参数,大家可以在Shutdown.exe中按需使用。
用法: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy]
没有参数 显示此消息(与 ? 相同)
-i 显示 GUI 界面,必须是第一个选项
-l 注销(不能与选项 -m 一起使用)
-s 关闭此计算机
-r 关闭并重启动此计算机
-a 放弃系统关机
-m \\computername 远程计算机关机/重启动/放弃
-t xx 设置关闭的超时为 xx 秒
-c "comment" 关闭注释(最大 127 个字符)
-f 强制运行的应用程序关闭而没有警告
-d [p]:xx:yy 关闭原因代码
u 是用户代码
p 是一个计划的关闭代码
xx 是一个主要原因代码(小于 256 的正整数)
yy 是一个次要原因代码(小于 65536 的正整数)
-f:强行关闭应用程序
-m \\计算机名:控制远程计算机
-i:显示图形用户界面,但必须是Shutdown的第一个选项
-l:注销当前用户
-r:关机并重启
-t时间:设置关机倒计时
-c "消息内容":输入关机对话框中的消息内容(不能超127个字符)