• 2004-09-16

    连接oracle

       oracle是个庞大又复杂的数据库系统,就连连接Oracle的程序也不简单,在leader的推荐下我选择了toad,以前从来没听说过,后来到网上查了查才发现它是那么的出名。开始以为装好toad,配置一下就可以访问到数据库了,可是事与愿违,遭遇到挫折后,才知道还要装Oracle的客户端程序。我们的内网上有很多Oracle安装程序,从一个ftp上down下来一个oracle8.1.7的安装程序,按提示安装了,安装后程序菜单中出现为数不少的oracle工具,不知道是哪个,挨个儿试,试了半天也还是连不上数据库,郁闷。找个老员工问问吧。呵呵,恰好过来一个“倒霉蛋”,我就让他帮我配置,他也弄了半天,最后得出结论,他用的是低版本的客户端,这个高版本的不会配,还好他把他的机器上的安装程序共享给我了,这样终于走向正规了。

       从他的机器上下载的是oracle8.0.5 client for winnt安装程序,安装过程中在“select installation options”中选择“Oracle 8 Client”,在“Select Client Configuration”中选择“applicatin user”,以后均按默认选项即可。

    在下面的安装中,
    Add New Servie: 填写你的数据库的名字
    Service Names , also called Database Aliases ,是用户定义的用来识别和连接一个Oracle数据库用的。

    网络协议一般选择TCP/IPHost Name :你的数据库所在的地址,如192.168.180.7

    Port Number:一般默认。

    DataBase SID:查看数据库所在服务器的shell配置文件,如我的数据库在Solaris8上,登陆到该服务器上查看shell配置文件中该项的定义。C Shell查看.cshrc文件。

    Test Service:添上你的user和password,测试一下一切OK。

    这样Oracle Client就配置完毕了,呵呵,也挺简单是吧!

    运行toad,会发现在toad的“toad server login version XXX”对话框中的Database中有“1807.WORLD

    ”,这就是你刚才配置的数据库,添上user和password,connect即可。

    用toad提供的Schema Browser,你的数据库中的Objects就一幕了然了!

    在此过程中,遇到网路不通,磁盘空间不足等,郁闷死我了!

  •   刚入司时,给我们做技术培训的老员工强烈向我们推荐blog这个新兴(起码对我来说是新的^_^)的咚咚,当时也想写就申请了一个,可是不知一天都忙些什么了,到今天才写了这第一篇,要说今天为什么要写,两个字“心烦”,本来我的第一篇blog在我的头脑中早已构思多次了,内容也换了多次,可是都没能实现,这篇blog是在丝毫没想的前提下动手写的。我觉得这样也不错,现在我的感觉就是想写就写,不用考虑太多,呵呵。

      今天我入司以来的第一个项目编码结束,上午代码评审,我的leader给我找出“一堆”问题。真是郁闷亚,原以为自己的水平可以了,原来还是有很多要学习的。以前在Windows平台上开发,早已有自己的规范或者说习惯。现在转移到Solaris上开发,有些咚咚还真得好好学习一下,比如代码头文件和源文件的格式。下面的例子是从各个代码规范中提取出来的一部分,也是我以后在项目中要使用的形式,有可能只适合我,呵呵。

    本不是第一篇的第一篇,我就写这么多。

    //in ANSI_C_CODING_STANDARDS.h

    /*
     * Copyright 2005, XX, Inc., China
     * All rights reserved.
     *
     * XX's source code is an unpublished work and the use of a copyright notice does
     * not imply otherwise. This source code contains confidential, trade secret material of
     * XX, Inc. Any attempt or participation in deciphering, decoding, reverse engineering
     * or in any way altering the source code is strictly prohibited, unless the prior written
     * consent of XX, Inc. is obtained.
     */

    /*
     * @file ANSI_C_CODING_STANDARDS.h
     * @author tony_bai
     * @date 2005-07-01
     * @brief the template for ANSI C
     *        header file
     */

    /*
     * @revision
     *   @version 0.1
     *   @date 2005-08-01
     *   @Revisor tony_bai
     *  
     * @revision
     *   @version 0.2
     *   @date 2005-09-01
     *   @Revisor tony_bai
     */

    /*
     * @glossary
     *   xx - xxxxx
     *   xx - xxxxx
     */

    /*
     * @usage
     *
     */

    #ifndef ANSI_C_CODING_STANDARDS_H
    #define ANSI_C_CODING_STANDARDS_H

    #include <ANSI C Standard Library Header File>
    #include <Operating System Library Header File>
    #include "Your System Library Header File"

    /*
     * ####################
     * # global constants #
     * ####################
     */

    /*
     * #################
     * # global macros #
     * #################
     */

    /*
     * ##############################
     * # global abstract data types #
     * ##############################
     */

    /*
     * ####################
     * # global variables #
     * ####################
     */

    /*
     * #############
     * # externals #
     * #############
     */

    /*
     * ###############################
     * # global functions prototypes #
     * ###############################
     */

    #endif ANSI_C_CODING_STANDARDS_H

    //in ANSI_C_CODING_STANDARDS.c

    /*
     * Copyright 2005, XX, Inc., China
     * All rights reserved.
     *
     * XX's source code is an unpublished work and the use of a copyright notice does
     * not imply otherwise. This source code contains confidential, trade secret material of
     * XX, Inc. Any attempt or participation in deciphering, decoding, reverse engineering
     * or in any way altering the source code is strictly prohibited, unless the prior written
     * consent of XX, Inc. is obtained.
     */

    /*
     * @file ANSI_C_CODING_STANDARDS.c
     * @author tony_bai
     * @date 2005-07-01
     * @brief the template for ANSI C
     *        source file
     */

    /*
     * @revision
     *   @version 0.1
     *   @date 2005-08-01
     *   @Revisor tony_bai
     *  
     * @revision
     *   @version 0.2
     *   @date 2005-09-01
     *   @Revisor tony_bai
     */

    #include <ANSI C Standard Library Header File>
    #include <Operating System Library Header File>
    #include "Your System Library Header File"

    /*
     * ###################
     * # local constants #
     * ###################
     */

    /*
     * ################
     * # local macros #
     * ################
     */

    /*
     * #############################
     * # local abstract data types #
     * #############################
     */

    /*
     * ###################
     * # local variables #
     * ###################
     */

    /*
     * ##############################
     * # local functions prototypes #
     * ##############################
     */

    /*
     * ####################################
     * # global functions implementations #
     * ####################################
     */

    /*
     * ###################################
     * # local functions implementations #
     * ###################################
     */