12
返回列表 发新帖
楼主: carf2000

有什么比较便捷的方法,可以将数据库中的所有对象导出为一个scripts文件?

[复制链接]
论坛徽章:
27
ITPUB元老
日期:2005-02-28 12:57:002012新春纪念徽章
日期:2012-02-13 15:11:182012新春纪念徽章
日期:2012-02-13 15:11:182012新春纪念徽章
日期:2012-02-13 15:11:182012新春纪念徽章
日期:2012-02-13 15:11:18马上有车
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有对象
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:11:18
11#
发表于 2001-10-9 15:22 | 只看该作者
不必客气.

其实, 对于这个问题, 我最喜欢用的是powerdesigner的reverse engineer.
不过有些oracle特有的东西, 比如sequence, object等可能就不行了.
如果没有这些需要, 我觉得pd是不错的.

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
12#
发表于 2001-10-10 10:34 | 只看该作者
# impshow2sql   Tries to convert output of an IMP SHOW=Y command into a
#               usage SQL script.
#
# To use:
#               Start a Unix script session and import with show=Y thus:
#               
#               $ imp user/password file=exportfile show=Y log=/tmp/showfile
#               
#               You now have the SHOW=Y output in /tmp/showfile .
#               Run this script against this file thus:
#               
#               $ ./impshow2sql /tmp/showfile > /tmp/imp.sql
#               
#               The file /tmp/imp.sql should now contain the main SQL for
#               the IMPORT.
#               You can edit this as required.
# Note:         This script may split lines incorrectly for some statements
#               so it is best to check the output.
#
# CONSTRAINT "" problem:
#               You can use this script to help get the SQL from an export
#               then correct it if it includes bad SQL such as CONSTRAINT "".
#               Eg:
#                Use the steps above to get a SQL script and then
#                $ sed -e 's/CONSTRAINT ""//' infile > outfile
#               Now precreate all the objects and import the export file.
#
# Extracting Specific Statements only:
#        It is fairly easy to change the script to extract certain statements
#        only. For statements you do NOT want to extract change N=1 to N=0
#         Eg: To extract CREATE TRIGGER statements only:
#                a) Change all lines to set N=0.
#                    Eg: / \"CREATE /    { N=0; }
#                       This stops CREATE statements being output.
#
#                b) Add a line (After the general CREATE line above):
#                        / \"CREATE TRIGGER/        { N=1; }
#                   This flags that we SHOULD output CREATE TRIGGER statements.
#
#                c) Run the script as described to get CREATE TRIGGER statements.
#

awk '  BEGIN        { prev=";" }
        / \"CREATE /         { N=1; }
        / \"ALTER /         { N=1; }
        / \"ANALYZE /         { N=1; }
        / \"GRANT /          { N=1; }
        / \"COMMENT /   { N=1; }
        / \"AUDIT /     { N=1; }
        N==1 { printf "\n/\n\n"; N++ }
        /\"$/ { prev=""
                if (N==0) next;
                s=index( $0, "\"" );
                      if ( s!=0 ) {
                        printf "%s",substr( $0,s+1,length( substr($0,s+1))-1 )
                        prev=substr($0,length($0)-1,1 );
                      }
                if (length($0)<78) printf( "\n" );
              }'  $*

使用道具 举报

回复
论坛徽章:
3
授权会员
日期:2005-10-30 17:05:33ITPUB十周年纪念徽章
日期:2011-11-01 16:19:412012新春纪念徽章
日期:2012-01-04 11:49:54
13#
发表于 2001-10-10 15:56 | 只看该作者

现成的工具

SQL Expert中的Object Extractor就是做这个的。

使用道具 举报

回复
论坛徽章:
0
14#
发表于 2001-10-10 16:15 | 只看该作者

当然是Object browser啦!

这个工具非常简洁,可用性好!

使用道具 举报

回复
论坛徽章:
0
15#
发表于 2001-10-12 18:45 | 只看该作者

那导出所有对象到一个word文档有什么好办法啊?

急急急!!谢谢大侠!!

使用道具 举报

回复
论坛徽章:
19
授权会员
日期:2005-10-30 17:05:33奥运会纪念徽章:足球
日期:2012-10-22 12:45:54ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:32奥运会纪念徽章:拳击
日期:2012-09-12 12:21:39蛋疼蛋
日期:2012-02-27 10:59:492012新春纪念徽章
日期:2012-01-04 11:49:54ITPUB十周年纪念徽章
日期:2011-11-01 16:19:412010广州亚运会纪念徽章:射箭
日期:2010-12-03 17:32:082010年世界杯参赛球队:意大利
日期:2010-05-31 12:05:442010新春纪念徽章
日期:2010-03-01 11:19:54
16#
发表于 2001-10-12 20:24 | 只看该作者
用Dephi的sql explorer可将数据库内的table,view,tablespace..等的DDL语句全导出到一文本文件里

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表