2004年九月月 发布的文章

连接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上开发,有些东东还真得好好学习一下,比如C语言代码头文件和源文件的格式。下面的例子是从各个代码规范中提取出来的一部分,也是我以后在项目中要使用的形式,有可能只适合我,呵呵。

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

附代码规范示例:

/* 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 #
 * ###################################
 */
如发现本站页面被黑,比如:挂载广告、挖矿等恶意代码,请朋友们及时联系我。十分感谢! Go语言第一课 Go语言精进之路1 Go语言精进之路2 商务合作请联系bigwhite.cn AT aliyun.com

欢迎使用邮件订阅我的博客

输入邮箱订阅本站,只要有新文章发布,就会第一时间发送邮件通知你哦!

这里是 Tony Bai的个人Blog,欢迎访问、订阅和留言! 订阅Feed请点击上面图片

如果您觉得这里的文章对您有帮助,请扫描上方二维码进行捐赠 ,加油后的Tony Bai将会为您呈现更多精彩的文章,谢谢!

如果您希望通过微信捐赠,请用微信客户端扫描下方赞赏码:

如果您希望通过比特币或以太币捐赠,可以扫描下方二维码:

比特币:

以太币:

如果您喜欢通过微信浏览本站内容,可以扫描下方二维码,订阅本站官方微信订阅号“iamtonybai”;点击二维码,可直达本人官方微博主页^_^:
本站Powered by Digital Ocean VPS。
选择Digital Ocean VPS主机,即可获得10美元现金充值,可 免费使用两个月哟! 著名主机提供商Linode 10$优惠码:linode10,在 这里注册即可免费获 得。阿里云推荐码: 1WFZ0V立享9折!


View Tony Bai's profile on LinkedIn
DigitalOcean Referral Badge

文章

评论

  • 正在加载...

分类

标签

归档



View My Stats