Progress数据库的配置和运行.doc

上传人:rrsccc 文档编号:9005541 上传时间:2021-01-29 格式:DOC 页数:7 大小:68.50KB
返回 下载 相关 举报
Progress数据库的配置和运行.doc_第1页
第1页 / 共7页
Progress数据库的配置和运行.doc_第2页
第2页 / 共7页
Progress数据库的配置和运行.doc_第3页
第3页 / 共7页
Progress数据库的配置和运行.doc_第4页
第4页 / 共7页
Progress数据库的配置和运行.doc_第5页
第5页 / 共7页
点击查看更多>>
资源描述

《Progress数据库的配置和运行.doc》由会员分享,可在线阅读,更多相关《Progress数据库的配置和运行.doc(7页珍藏版)》请在三一文库上搜索。

1、Progress数据库的配置和运行 作者: Wooce1. 环境变量设置: 在shell为tcsh的情况, 修改.tcshrc , 加入: setenv DLC /home/progress/dlcsetenv WRKDIR /home/progress/wrksetenv PROEXE $DLC/bin/_progressetenv PROMSGS $DLC/promsgssetenv PATH :$DLC/bin2. Progress数据库的启动: progress安装后就已经有demo, sports,isports,sports2000,empty几个初始的数据库. rootxfs d

2、lc# pwd/home/progress/dlcrootxfs dlc# proserve sportsPROGRESS PATCH Version 9.1C09 as of February 26, 200213:54:25 BROKER : You are not allowed to connect to a database in $DLC. (1379)13:54:25 BROKER : * This process terminated with exit code 2. (8619) 以上信息表明我们不能在环境变量$DLC指定的路径下直接执行proserve命令初始化和spor

3、ts数据库的连接. rootxfs dlc# pwd/root/sportsrootxfs /sports# ls /home/progress/dlc/sports.*/home/progress/dlc/sports.b1 /home/progress/dlc/sports.db/home/progress/dlc/sports.d1 /home/progress/dlc/sports.plrootxfs /sports# ls /home/progress/dlc/sports_*/home/progress/dlc/sports_7.d1 /home/progress/dlc/spor

4、ts_8.d1rootxfs /sports# cp /home/progress/dlc/sports.* ./rootxfs /sports# cp /home/progress/dlc/sports_* ./rootxfs /sports# lssports_7.d1 sports_8.d1 sports.b1 sports.d1 sports.db sports.pl sports.*和sports_*等文件是sports数据库存储在磁盘上的所有必须的文件, 我们把它们一起copy到/root/sports/下面, 就等于将sports数据库复制一份到/root/sports下面了.r

5、ootxfs /sports# proserve sports -S 2000 -N tcpPROGRESS PATCH Version 9.1C09 as of February 26, 200218:00:01 BROKER 0: Multi-user session begin. (333)18:00:01 BROKER 0: Begin Physical Redo Phase at 0 . (5326)18:00:01 BROKER 0: Physical Redo Phase Completed at blk 0 off 167 upd 0. (7161)18:00:01 BROKE

6、R 0: Started for 2000 using tcp, pid 26815. (5644)-S 2000表示在端口2000上提供sports数据库的连接服务, -N tcp表示以tcp socket提供连接(或者选择udp), 如果不加上-S 2000, 则proserve sports虽然没有出错信息, 但并未能初始化sports数据库的连接服务.启动sports数据库的连接服务后, rootxfs /sports# netstat -a|grep 2000tcp 0 0 *:2000 *:* LISTENrootxfs /sports# lssports_7.d1 sports.

7、b1 sports.db sports.lic sports.plsports_8.d1 sports.d1 sports.lg sports.lk可以看到多了sports.lg , sports.lic, sports.lk 3个文件. rootxfs /sports# ps -ef | grep progressroot 25601 1 0 13:32 pts/0 00:00:00 /home/progress/dlc/bin/_mprosrv _mprosrv为监控和提供数据库连接服务的进程.3. SQLExplorer: 类似Oracle sql plus的工具rootxfs /spo

8、rts# sqlexp -H localhost -S 2000 -db sportsPROGRESS PATCH Version 9.1C09 as of February 26, 2002Connecting user root to URL jdbc:jdbcprogress:T:localhost:2000:sports. (8920)SQLExplorer 这样就进入了SQLExplorer的命令行界面, 可在其下执行SQL语句进行表的创建和管理等. 在本机上执行的情况H localhost可以省去, 但-S 2000不能省, 必须指定为上面proserve sports的时侯所指定

9、的端口, 才能正确连接到sports数据库上去. SQLExplorer命令行下输入SQL语句和命令时是大小写无关的, 但必须以”; “显式表明一个SQL语句的结束. Progress数据库安装好以后就有一个并且只有一个唯一的DBA, 其用户名为sysprogress, 并且以其他用户名调用sqlexp进入SQLExplorer的时侯都不具备创建或修改任何表和数据的权限. 上面sqlexp -H localhost -S 2000 -db sports 没有加-user 选项, 则SQLExplorer就认为使用sports数据库的用户名为unix用户即root, 我们接着执行create t

10、able命令的话可以看到用户root是不具备创建table的权限的:SQLExplorercreate table test(1 name varchar(20),2 age integer3 );= SQL Exception 1 =SQLState=HY000ErrorCode=-20057JDBC Progress Driver:No RESOURCE privileges (7574) 所以我们必须首先以sysprogress身分登入SQLExplorer, 然后grant权限给用户root: rootxfs /sports# sqlexp -H localhost -S 2000 -

11、user sysprogress -db sportsPROGRESS PATCH Version 9.1C09 as of February 26, 2002Connecting user sysprogress to URL jdbc:jdbcprogress:T:localhost:2000:sports. (8920)QLExplorercreate table test(1 name varchar(20),2 age integer3 );= SQL Exception 1 =SQLState=HY000ErrorCode=-211015JDBC Progress Driver:D

12、atabase object (table, view, index, trigger,procedure, or synonym) owned by sysprogress cannot be created, dropped, or altered. (7883) /sysprogress本身拥有的表,视图等是不可修改的, 因为sysprogress DBA相当于unix的超级用户, 为数据库安全起见不能对其修改. 查看系统中所有的表: (相当于mysql的 show tables;命令) SQLExplorerselect * from sysprogress.systables; ID

13、 TBL CREATOR OWNER TBLTYPE SEGID HAS_PCNSTRS HAS_FCNSTRS HAS_CCNSTRS HAS_UCNSTRS TBL_STATUS RSSID - - - - - - - - - - - - 2 Customer PUB PUB T 0 N N N N Y 5 1 Invoice PUB PUB T 0 N N N N Y 5 3 Item PUB PUB T 0 N N N N Y 5 8 Local-Default PUB PUB T 0 N N N N Y 5 4 Order PUB PUB T 0 N N N N Y 5 5 Orde

14、r-Line PUB PUB T 0 N N N N Y 5 9 Ref-Call PUB PUB T 0 N N N N Y 5 6 Salesrep PUB PUB T 0 N N N N Y 5 7 State PUB PUB T 0 N N N N Y 5 32786 SYSATTACHTBLS SYSPROGRESS SYSPROGRESS V 0 N N N N 5 32807 SYSBIGINTSTAT SYSPROGRESS SYSPROGRESS V 0 N.查看某个表的字段结构:SQLExplorerselect * from sysprogress.syscolumns

15、where tbl=test; ID COL TBL OWNER COLTYPE WIDTH SCALE NULLFLAG DFLT_VALUE CHARSET COLLATION - - - - - - - - - - - 3 AGE TEST ROOT integer 4 0 Y iso8859-1 basic_S 2 NAME TEST ROOT varchar 20 0 Y iso8859-1 basic_S SQLExplorergrant resource to root; /赋予权限给用户rootSQLExplorergrant dba to root;SQLExplorerco

16、mmit;再用root身分登入: rootxfs /sports# sqlexp -H localhost -S 2000 -db sportsPROGRESS PATCH Version 9.1C09 as of February 26, 2002Connecting user root to URL jdbc:jdbcprogress:T:localhost:2000:sports. (8920)SQLExplorercreate table test(1 name varchar(20),2 age integer3 );SQLExplorerselect * from sysprogr

17、ess.systables;. 200 TEST ROOT ROOT T 0 NSQLExplorerselect * from test;NAME AGE - - 可以看到用户root现在有了权限创建表和修改数据. 其他命令: 查看帮助: SQLExplorerhelp;Available options include: AutoCommit true | false ColumnWidthLimit 1.31995 ColumnWidthMinimum 1.2048 ConnectTimeout 1.300 Connect jdbc:jdbcprogress:T:localhost: -

18、 or - Connect jdbc:odbc: DisableWarnings true | false Disconnect true | false EchoAll true | false EchoCmd true | false EchoComments true | false EchoSql true | false FetchLimit 1.32767 HasColumnLimit true | false HasFetchLimit true | false Help . Logfile Logging true | false PageLimit 1.32767 Pager

19、 true | false ReportFormat Standard | By Label Reset . Run Show . SqlVerbose true | false TransactionIsolation Read Uncommitted | Read Committed | Repeatable Read | Serializable - or - TransactionIsolation 0 | 1 | 2 | 3 ;Ok: help. (8932)SQLExplorershow;Options values are: AutoCommit false ColumnWidt

20、hLimit 25 ColumnWidthMinimum 1 ConnectTimeout 180 Connect jdbc:jdbcprogress:T:localhost:2000:sports DisableWarnings true Disconnect true EchoAll false EchoCmd false EchoComments false EchoSql false FetchLimit 101 HasColumnLimit false HasFetchLimit true Logfile /root/sports/SQLExplorerSession.log Log

21、ging false PageLimit 22 Pager false ReportFormat Standard SqlVerbose false TransactionIsolation 1: Read Committed;Ok: show. (8932)4. 关闭一个数据库的连接服务rootxfs /sports# proshut sports 1 Disconnect a User 2 Unconditional Shutdown 3 Emergency Shutdown (Kill All) x Exit Enter choice 2Shutdown is executing. (1

22、613)Shutdown complete. (1614) 数据库连接服务关闭后我们便无法再用SQLExplorer去连接和访问它: rootxfs /sports# sqlexp -H localhost -S 2000 -db sportsPROGRESS PATCH Version 9.1C09 as of February 26, 2002Connecting user root to URL jdbc:jdbcprogress:T:localhost:2000:sports. (8920)error in tcp bind 111 Error: JDBC Progress Drive

23、r:Error in Network Daemon. (8933)See /root/sports/sqlexp.log and /root/sports/SQLExplorer.exceptions files for more information. (8950)5. 用JDBC访问Progress数据库的demodemo程序在$DLC/src/samples/sql92/下面的JdbcProgressTest.java, 首先要在.tcshrc里加入设置CLASSPATH: setenv CLASSPATH .:/home/progress/dlc/java/jdbc.zip, 然后j

24、avac编译成JdbcProgressTest.class, 然后用java JdbcProgressTest jdbcURL username password的格式调用, 例如java JdbcProgressTest jdbc:JdbcProgress:T:localhost:2000:testdb root. 如果想在Windows下面运行JDBC程序访问数据库, 则必须到http:/ WIN NT 32 Intel9.1C199.1C2002/03/08再进入download 91C19.exe的页面, 把91C19.exe download下来.运行91C19.exe, 一般缺省解

25、压到c:program filesprogress目录,解压完毕后, 必须在windows的环境变量里加入一项DLC, 值为前面解压到的目录即c:program filesprogress, 在环境变量PATH的值中添加入%DLC%bin; 使其成为PATH=”.;%DLC%bin;”, 然后还需要在CLASSPATH中加入c:program filesprogressjavaprogress.zip, 完成这些环境变量设置后再运行java JdbcProgressTest jdbc:JdbcProgress:T:192.168.1.3:2000:cms root, 可以看到已经能在Windows下运行JDBC程序访问另一台机器或本机上的Progress数据库了.6.

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1