简体   繁体   English

如何与他人共享本地Oracle 11g DSN?

[英]How to share local Oracle 11g DSN to others?

I've installed Oracle 11g on my local machine and have created multiple tables. 我已经在本地计算机上安装了Oracle 11g,并创建了多个表。 Now I want to share my local database copy to the entire team so that they can use same the tables without re-creating them. 现在,我想将我的本地数据库副本共享给整个团队,以便他们可以使用相同的表而无需重新创建它们。 (I don't want them to use my local machine as a server) Is there any way to achieve this? (我不希望他们将本地计算机用作服务器)有什么方法可以实现? so that I can save days of time 这样我可以节省几天的时间

From my point of view, if you don't want them to connect to your computer (ie so that it acts like a database server), everyone will probably have to work on his/her own database, right? 从我的角度来看,如果您不希望他们连接到计算机(即,使其像数据库服务器一样工作),那么每个人都可能必须在自己的数据库上工作,对吗? It means that all of them will have to install the database onto their computers. 这意味着他们所有人都必须将数据库安装到他们的计算机上。 Furthermore, it means that you won't be able to share code nor data in the future. 此外,这意味着将来您将无法共享代码或数据。 Changes you (or anyone else) makes won't be visible to other members of your team. 您(或其他任何人)所做的更改将对您团队的其他成员不可见。

Your task can be done in two ways. 您的任务可以通过两种方式完成。 The first one is to provide CREATE TABLE script(s), possibly INSERT INTO sample data, as well as CREATE PROCEDURE / FUNCTION / PACKAGE / whatever. 第一个是提供CREATE TABLE脚本,可能是INSERT INTO示例数据,以及CREATE PROCEDURE / FUNCTION / PACKAGE /等等。 All of that can fit into a .SQL file they would run in their databases. 所有这些都可以放入将在数据库中运行的.SQL文件中。

Another - and probably better option - is to export your schema. 另一个(可能是更好的选择)是导出模式。 I'd suggest you to use the original EXP (export) utility in this case. 在这种情况下,建议您使用原始的 EXP (导出)实用程序。 The result is a DMP (binary) file. 结果是一个DMP(二进制)文件。 Once they get it, they would use the IMP utility (import) and simply import everything into their database. 一旦获得,他们将使用IMP实用程序(导入)并将所有内容简单地导入他们的数据库中。

Here's an example. 这是一个例子。

You should run this: 您应该运行以下命令:

M:\>exp scott/tiger@orcl file=test.dmp

Export: Release 11.2.0.2.0 - Production on ╚et Svi 17 08:53:02 2018

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Tes
Export done in EE8MSWIN1250 character set and AL16UTF16 NCHAR character set
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SCOTT
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user SCOTT
About to export SCOTT's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SCOTT's tables via Conventional Path ...
. . exporting table                          BONUS          0 rows exported
. . exporting table                           DEPT          4 rows exported
. . exporting table                          DUMMY          1 rows exported
. . exporting table                            EMP         14 rows exported
. . exporting table                       SALGRADE          5 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.

M:\>

They should run this: 他们应该运行以下命令:

M:\>imp mike/lion@orcl file=test.dmp full=y

Import: Release 11.2.0.2.0 - Production on ╚et Svi 17 08:57:19 2018

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Tes

Export file created by EXPORT:V11.02.00 via conventional path

Warning: the objects were exported by SCOTT, not by you

import done in EE8MSWIN1250 character set and AL16UTF16 NCHAR character set
. importing SCOTT's objects into MIKE
. . importing table                        "BONUS"          0 rows imported
. . importing table                         "DEPT"          4 rows imported
. . importing table                        "DUMMY"          1 rows imported
. . importing table                          "EMP"         14 rows imported
. . importing table                     "SALGRADE"          5 rows imported
Import terminated successfully without warnings.

M:\>

As you can see, two simple commands can solve all your problems :) 如您所见,两个简单的命令可以解决您所有的问题:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM