2012年1月15日 星期日

TOAD 一直出現 ORA-01775 looping chain of synonyms

Go to the menu View | Toad Options. In the node Oracle - General there is a frame named Explain Plan, next to the textbox labeled Table: TOAD_PLAN_TABLE there is a button (...), press it. In the displayed window you have to uncheck the option Grant to public and create public synonym, and the problem is solved.




ref :http://dbaforums.org/oracle/index.php?showtopic=15796

2012年1月6日 星期五

Oracle Listener Hang

f5:oracle:/oracle > id
uid=205(oracle) gid=205(dba) groups=1(staff)
f5:oracle:/oracle > svrmgrl
SVRMGR> connect internal;
Connected.
SVRMGR> shutdown abort;
ORACLE instance shut down.

=================================================================================
ps -ef | grep LIS
kill
=================================================================================

SVRMGR> startup
ORACLE instance started.
Total System Global Area                       2401083284 bytes
Fixed Size                                          73620 bytes
Variable Size                                   352837632 bytes
Database Buffers                               2048000000 bytes
Redo Buffers                                       172032 bytes
Database mounted.
Database opened.
SVRMGR>

2012年1月4日 星期三

VIM / VI



關閉 hightlight
set noh

tab:
set ts=4
http://softsmith.blogspot.tw/2008/12/vim-tab.html

切換 big5 / utf8  :e ++enc=big5
更改設定 :set encoding=big5
ref : http://newtoypia.blogspot.com/2011/06/vim-big5-gb2312-1.html

行號
set nu
set nu!



JSON

在 Perl 下產生 JSon 的方式

my $json = ($userID) ?
  qq{{"success" : "login is successful", "userid" : "$userID"}} :
  qq{{"error" : "username or password is wrong"}};
# return JSON string
print $cgi->header(-type => "application/json", -charset => "utf-8");
print $json;

Ref :  http://www.ibm.com/developerworks/cn/webservices/ws-simplelogin/

在 Java 底下 parse JSON 的方式 :

WebClient client = new WebClient();
Page page = client.getPage("http://stackoverflow.com/users/flair/97901.json");
WebResponse response = page.getWebResponse();
if (response.getContentType().equals("application/json")) {
    String json = response.getContentAsString();
    Map<String, String> map = new Gson().fromJson(json, new TypeToken<Map<String, String>>() {}.getType());
    System.out.println(map.get("displayName")); // Benju
}
Ref :
http://stackoverflow.com/questions/2932857/html-handling-a-json-response
http://stackoverflow.com/questions/1688099/converting-json-to-java/1688182#1688182