欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

ArcSDE10.2.1 for Oracle12c的数据迁移

程序员文章站 2022-05-24 10:10:47
...

对ArcSDE for Oracle数据库来说,数据迁移包括的方式比较多:逻辑迁移、冷备份、热备份、RMAN,当然也包括ArcGIS本身的Copy/Paste方式,那么在Oracle12c这个新的版本也引入了PDB和CDB的概念,感兴趣的用户可以查看Oracle12c的官方帮助。 今天介绍的就是使用O

对ArcSDE for Oracle数据库来说,数据迁移包括的方式比较多:逻辑迁移、冷备份、热备份、RMAN,当然也包括ArcGIS本身的Copy/Paste方式,那么在Oracle12c这个新的版本也引入了PDB和CDB的概念,感兴趣的用户可以查看Oracle12c的官方帮助。


今天介绍的就是使用Oracle12c新特性的方法来京CDB中的PDB迁移到另外一个CDB中。对PDB的概念,一般大家认为是可插入式的数据库,就像你使用U盘原来在别人的电脑上,现在从别人电脑上拔出,然后插入你自己的电脑上,这种方式也就是相当于数据的迁移。


测试环境:

源环境:

Redhat 5.5 、Oracle12.1.0.1(CDB:orcl 、PDB:pdborcl)、 ArcSDE10.2.1 、192.168.220.203

目标环境:

Windows Server2012、Oracle12.1.0.1(CDB:orcl、PDB:pdborcl1和pdborcl2 )、ArcSDE10.2.1、192.168.100.213


我的Linux环境下的ArcSDE10.2.1 for Oracle12c的业务数据已经导入,而且可读可写,所在的PDB为pdborcl,希望将这个pdborcl迁移到Window环境下。

----------------------------------------------------------------------------------


Blog: http://blog.csdn.net/linghe301

----------------------------------------------------------------------------------

迁移原理:将Linux环境的PDB生成一个描述该PDB的XML元数据文件,然后将该PDB的相关数据文件和该XML元数据文件拷贝到Windows机器上,在创建新的PDB使用这些XML元数据文件和数据文件即可。

ArcSDE10.2.1 for Oracle12c的数据迁移


1:查看Linux环境的PDB状态

[oracle@oracle12c orcl]$ sqlplus sys/oracle@orcl as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Sat Feb 15 06:30:09 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/orcl/system01.dbf
/home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
/home/oracle/app/oracle/oradata/orcl/undotbs01.dbf
/home/oracle/app/oracle/oradata/orcl/pdbseed/system01.dbf
/home/oracle/app/oracle/oradata/orcl/users01.dbf
/home/oracle/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf
/home/oracle/app/oracle/oradata/orcl/pdborcl/system01.dbf
/home/oracle/app/oracle/oradata/orcl/pdborcl/sysaux01.dbf
/home/oracle/app/oracle/oradata/orcl/pdborcl/SAMPLE_SCHEMA_users01.dbf
/home/oracle/app/oracle/oradata/orcl/pdborcl/example01.dbf
/home/oracle/app/oracle/product/orcl/pdborcl/sde01

NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/orcl/esri.dbf
/home/oracle/app/oracle/oradata/orcl/pdborcl/esri.dbf
/home/oracle/app/oracle/oradata/orcl/pdborcl/esri2.dbf

14 rows selected.

SQL> select con_id,dbid,NAME,OPEN_MODE from v$pdbs;

    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 4062262812 PDB$SEED                       READ ONLY
         3 2266793495 PDBORCL                        MOUNTED

2:导出Linux环境的PDB的元数据文件

SQL> alter pluggable database pdborcl unplug into '/home/oracle/pdborcl.xml';

Pluggable database altered.

SQL> !ls /home/oracle
app  database  Desktop  pdborcl.xml  

3:将Linux环境的导出的XML文件和PDBORCL的数据文件物理拷贝到Windows环境下。默认的路径为c:\pdborcl.xml和c:\pdborcl\*.dbf。

4:打开相关的pdborcl.xml

PDBORCL3120237516822667934951347416737E07706C816463582E043CB64A8C060C6202594404194824SYSTEM0010/home/oracle/app/oracle/oradata/orcl/pdborcl/system01.dbf8117353440135840819220237516822667934950202594201720082819636003SYSAUX0110/home/oracle/app/oracle/oradata/orcl/pdborcl/sysaux01.dbf9417353470180640819220237516822667934950202594201720082819636003TEMP1210128/home/oracle/app/oracle/oradata/orcl/pdborcl/pdborcl_temp01.dbf31173534500256081922023751681419430280USERS0310/home/oracle/app/oracle/oradata/orcl/pdborcl/SAMPLE_SCHEMA_users01.dbf109173535001640819220237516822667934950202594201720082819636003EXAMPLE0410/home/oracle/app/oracle/oradata/orcl/pdborcl/example01.dbf111017353520145840819220237516822667934950202594201720082819636003SDE0510/home/oracle/app/oracle/oradata/orcl/pdborcl/sde01131317507110151200819220237516822667934950202594201720082819636003ESRI0610/home/oracle/app/oracle/oradata/orcl/pdborcl/esri.dbf1515183396401128000819220237516822667934950202594201720082819636003ESRI20710/home/oracle/app/oracle/oradata/orcl/pdborcl/esri2.dbf1616184282301128008192202375168226679349502025942017200828196360031782000












0004.2.0.00.27:1processes=300memory_target=843055104db_block_size=8192compatible=12.1.0.0.0open_cursors=300enable_pluggable_database=TRUEprimary version:18secondary version:00

----------------------------------------------------------------------------------


Blog: http://blog.csdn.net/linghe301

----------------------------------------------------------------------------------


5:使用创建PDB语句

C:\Users\Administrator>sqlplus sys/oracle@localhost/orcl as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on 星期五 2月 28 22:59:53 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


连接到:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options

SQL> select con_id,dbid,name,open_mode from v$pdbs;

    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 4083344342 PDB$SEED                       READ ONLY
         3 1246209042 PDBORCL1                       MOUNTED
         4 1218627613 PDBORCL2                       MOUNTED


SQL> create pluggable database pdbsde using 'C:\pdborcl.xml' copy file_name_conv
ert=('/home/oracle/app/oracle/oradata/orcl/pdborcl/','C:\app\oracle\oradata\orcl
\pdborcl\');
create pluggable database pdbsde using 'C:\pdborcl.xml' copy file_name_convert=(
'/home/oracle/app/oracle/oradata/orcl/pdborcl/','C:\app\oracle\oradata\orcl\pdbo
rcl\')
*
第 1 行出现错误:
ORA-19505:
无法识别文件"/home/oracle/app/oracle/oradata/orcl/pdborcl/system01.dbf"
ORA-27041: 无法打开文件
OSD-04002: 无法打开文件
O/S-Error: (OS 3) 系统找不到指定的路径。

6:将pdborcl.xml文件里面的数据文件路径修改为存储在Windows环境的实际路径,如c:\pdborcl\sde01等,而且在数据文件参数设置也应该设置为Windows路径下,而且这些数据文件的目的存储为C:\app\oracle\oradata\orcl\pdborcl\

该步骤涉及到数据文件的拷贝,根据数据量大小时间有所不一样

SQL> create pluggable database pdbsde using 'C:\pdborcl.xml' copy file_name_conv
ert=('c:\pdborcl\','C:\app\oracle\oradata\orcl\pdborcl\');

插接式数据库已创建。

7:打开新的PDB(pdbsde)并查看状态

[oracle@oracle12c orcl]$ sqlplus sys/oracle@orcl as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Sat Feb 15 06:30:09 2014

SQL> select con_id,dbid,name,open_mode from v$pdbs;

    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 4083344342 PDB$SEED                       READ ONLY
         3 1246209042 PDBORCL1                       MOUNTED
         4 1218627613 PDBORCL2                       MOUNTED
         5 2266793495 PDBSDE                         MOUNTED

SQL> alter pluggable database pdbsde open;

插接式数据库pdbsde已打开

SQL> select con_id,dbid,name,open_mode from v$pdbs;

    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 4083344342 PDB$SEED                       READ ONLY
         3 1246209042 PDBORCL1                       MOUNTED
         4 1218627613 PDBORCL2                       MOUNTED
         5 2266793495 PDBSDE                         READ WRITE
8:使用sqlplus 连接sde用户
SQL> conn sde/sde@192.168.100.213/pdbsde
ERROR:
ORA-01035: ORACLE ???êDí??óD RESTRICTED SESSION
è¨?Tμ?ó??§ê1ó?


警告: 您不再连接到 ORACLE。
提示ORA-01035错误,需要赋予RESTRICTED SESSION权限
SQL> conn system/oracle@192.168.100.213/pdbsde
已连接。
SQL> grant restricted session to sde;

授权成功。

SQL> conn sde/sde@192.168.100.213/pdbsde
已连接。
9:使用ArcCatalog10.2.1进行读写测试

ArcSDE10.2.1 for Oracle12c的数据迁移


总结:个人感觉,该方面有点类似于Oracle的冷备份,不过在实施过程中操作比较简单,尤其是ArcGIS版本化数据的迁移,既保证了简单操作性又保持了高效,值得用户进行参考!

----------------------------------------------------------------------------------


Blog: http://blog.csdn.net/linghe301

----------------------------------------------------------------------------------