zoukankan      html  css  js  c++  java
  • 如何导出远程oracle数据库中的表结构

    从远程oracle数据库上导出指定表的表结构语句有两种方法:

    方法一:通过sql语句获得

    1,make sure that you can connect the remote database.

    2,enter into the sqlplus,and execute the command:


    select dbms_metadata.getddl('TABLE',tablename) from user_tables


    and you will get all the tables definition of the current user.

    通过该sql获得的结果集合是包含指定表的所有的ddl语句。包括create,alter,grant。产生的结果集是clob对象,点击查看其内容即可以获得表结构语句。

    方法二:通过sqldeveloper获得

    工具-->导出用户对象--->选择指定的表导出到指定的sql文件中

    用notpad++打开sql文件获得表结构语句和表的注释语句。注意这样导出的sql文件包含文件的所有者。在导出时要设置不包含所有者,只选择包含存储和单个文件这样导出的sql文件是纯粹的只包含表结构和表中列注释的sql文件。可以直接copy在本地创建相同表结构的表即可。

  • 相关阅读:
    MVC Form
    The way to learn english
    Test FastThree
    C#中Trim()、TrimStart()、TrimEnd()的用法
    c# Dictionary 简介
    visual studio快捷键大全
    ASP.NET MVC 中 ActionResult
    MVC4中使用 Ninject
    MVC Chapter 12 Overview of MVC Projects
    ASP.NET Razor
  • 原文地址:https://www.cnblogs.com/moonfans/p/3855319.html
Copyright © 2011-2022 走看看