如何在Oracle中的远程表空间上创建分区?

发布于 2024-10-03 00:31:18 字数 359 浏览 0 评论 0原文

我是 Oracle 的菜鸟,是否可以使用 db link 将表分区到远程服务器?这有可能吗?

我正在尝试这样的事情:

CREATE TABLE Test (
  TestID       integer           not null,
  Name       varchar2(20)      not null
)
PARTITION BY LIST (TestID)
 (PARTITION testPart1 VALUES (1)
TABLESPACE tbspc1,
 PARTITION testPart2 VALUES (2)
TABLESPACE tbspc2@RemoteServer);

谢谢

I'm a noob in Oracle, is it possible to partition a table to remote server using db link? is it possible at all?

I'm trying something like this:

CREATE TABLE Test (
  TestID       integer           not null,
  Name       varchar2(20)      not null
)
PARTITION BY LIST (TestID)
 (PARTITION testPart1 VALUES (1)
TABLESPACE tbspc1,
 PARTITION testPart2 VALUES (2)
TABLESPACE tbspc2@RemoteServer);

thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你的背包 2024-10-10 00:31:18

不,那是行不通的。您将实例与数据库混淆了。

数据库是数据和元数据的物理存储。您使用的磁盘数量和磁盘位置可供管理。您可以将索引放在一个地方,将数据放在另一个地方;您可以将一些数据放在本地驱动器上,将一些数据放在已安装的驱动器上。那是一个数据库。

实例是访问数据库并使其可以查询、写入、更新等的内存结构和计算机进程。

当你说@DB_LINK...你是在说“那组内存和CPU进程”。

当您说表空间时,您说的是“在那些文件上、在那些磁盘上”。

如果您想将数据存储在 @dblink 存储数据的同一驱动器上,则安装该驱动器并在那里构建一个新的表空间。

如果您尝试使用多个实例打开数据库,这称为 RAC,这有点超出您的想象。 <-- 我这样说是因为在考虑 RAC 之前您必须掌握这些概念。

No, that will not work. You're confusing an instance with a database.

A database is the physical storage of the data and metadata. The number of disks you use and the location of the disks is up for management. You can put indexes one place, data in another; you can put some data on local drives and some on mounted drives. That's a database.

An Instance is the memory structures and computer processes which access a database and make it possible to query it, write to it, update it, etc.

When you say @DB_LINK... you're saying "That set of memory and cpu processes".

When you say Tablespace, you're saying "On those files, on those disks"

If you want to store data on the same drives that your @dblink is storing data then mount that drive and build a new tablespace there.

If you're trying to OPEN the database with more than one instance, that's called RAC and it's bit over your head. <-- I say this because you have to have these concepts mastered before you'd ever consider RAC.

好倦 2024-10-10 00:31:18

很难说某件事是不可能的,但根据 CREATE TABLE 的语法图,这看起来不可能。对于 select 语句,您可以看到 dblink 语法 (@ dblink): http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#i2126073 但是对于分区存储,没有这样的远程语法:http://download.oracle.com/docs/cd/ B19306_01/server.102/b14200/statements_7002.htm#CJADDEEH

It's hard to say that something is impossible, but based on the syntax diagram for CREATE TABLE this doesn't look possible. For the select statement you can see that the dblink syntax (@ dblink): http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#i2126073 But for partitioning storage there is no such remote syntax: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7002.htm#CJADDEEH

萌辣 2024-10-10 00:31:18

也许以下是一个合理的起点:

  1. 在“家庭办公室”有一个数据库来包含公共数据。

  2. 在每个分支机构都有一个“本地”数据库来存储特定于分支机构的数据,并链接到“家庭办公室”数据库以访问通用数据。

  3. 为了帮助消除在中央数据库出现故障或通信丢失时可能发生的“单点故障”,您可以尝试将公共数据从中央数据库复制到分支数据库,以便每个分支拥有通用数据的完整副本,可以按某种定期计划进行更新。

分享并享受。

Perhaps the following would be a reasonable starting point:

  1. Have a database at the "home office" to contain the common data.

  2. Have a "local" database at each branch to store branch-specific data, with links to the "home office" database to access the common data.

  3. To help eliminate the "single point of failure" which could occur if the central database was to go down or communications were to be lost, you might try replicating the common data from the central database to the branch databases so that each branch has a complete copy of the common data which could be updated on some sort of regular schedule.

Share and enjoy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文