Oracle 12c迁移pluggable database到异库

1.源库:

SQL> show pdbs

CON_ID CON_NAME  OPEN MODE  RESTRICTED

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

2 PDB$SEED  READ ONLY  NO

3 PDB  READ WRITE NO

4 TEST  READ WRITE NO

2.目标库:

SQL> show pdbs

CON_ID CON_NAME  OPEN MODE  RESTRICTED

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

2 PDB$SEED  READ ONLY  NO

3 PDB  READ WRITE NO

SQL>

把源库的TEST迁移到目标库中。

源库上操作:

SQL> alter pluggable database test close immediate;

Pluggable database altered.

SQL> show pdbs

CON_ID CON_NAME  OPEN MODE  RESTRICTED

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

2 PDB$SEED  READ ONLY  NO

3 PDB  READ WRITE NO

4 TEST  MOUNTED

SQL> alter pluggable database test unplug into ‘/u01/test/test.xml‘;

Pluggable database altered.

目标库:

[[email protected] cdb]$ mkdir  /u01/app/oracle/oradata/cdb/test

[[email protected] cdb]$ mkdir  /u01/test

源库:

[[email protected] ~]$ scp -r /u01/test/test.xml [email protected]:/u01/test/test.xml

[[email protected] ~]$ scp -r /u01/app/oracle/oradata/cdb/test/* [email protected]:/u01/app/oracle/oradata/cdb/test/

目标库:

SQL> create pluggable database test using ‘/u01/test/test.xml‘ nocopy tempfile reuse;

Pluggable database created.

SQL> show pdbs

CON_ID CON_NAME  OPEN MODE  RESTRICTED

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

2 PDB$SEED  READ ONLY  NO

3 PDB  READ WRITE NO

4 TEST  MOUNTED

SQL>  exec DBMS_PDB.SYNC_PDB();

PL/SQL procedure successfully completed.

时间: 2024-08-06 20:09:21

Oracle 12c迁移pluggable database到异库的相关文章

oracle 12c迁移数据及遇到的问题

因为要换服务器,重新安装oracle,就想着用下最新的12c.花了整整一天时间,记录过程与问题如下. 一.下载oracle 12c: 官网上的12.1.0.2.0有一半确实是下不了的,用百兆光纤下也是到一半失败.所以只能下载12.1.0.1.0. 二.安装?oracle 12c: 下载完成后解压第一部分,照以往经验,两个部分压缩包放在一起,是会一起解压出来的.所以我就没去检查,然后就悲催了,装了好久说找不到文件,失败了..所以大家一定记得检查,不然浪费大把时间.如果发现第二部分没解压,就自己单独

【Oracle 12c】最新CUUG OCP-071考试题库(53题)

53.(12-14) choose the best answer: Examine the command to create the BOOKS table. SQL>CREATE TABLE books (book_id CHAR(6) PRIMARY KEY, title VARCHAR2(100) NOT NULL, publisher_id VARCHAR2(4), author_id VARCHAR2(50)); The BOOK_ID value 101 does not exi

【Oracle 12c】最新CUUG OCP-071考试题库(55题)

55.(13-3) choose the best answer: Which statement is true regarding the SESSION_PRIVS dictionary view? A) It contains the object privileges granted to other users by the current user session. B) It contains the system privileges granted to other user

【Oracle 12c】最新CUUG OCP-071考试题库(57题)

57.(14-17) choose two: Examine the structure of the DEPARTMENTS table You execute the following command: SQL> ALTER TABLE departments SET UNUSED (country); Which two statements are true? A) A new column, COUNTRY, can be added to the DEPARTMENTS table

【Oracle 12c】最新CUUG OCP-071考试题库(58题)

58.(16-1) choose the best answer: Examine the structure of the BOORSTRANSACTIONS table: Examine the SQL statement: SQL> SELECT FROM books_transactions WHERE borrowed_date MEMBER_ID IN ('A101', 'A102'); Which statement is true about the outcome? A) It

【Oracle 12c】最新CUUG OCP-071考试题库(59题)

59.(16-8)choose two: Which two statements are true regarding the USING and ON clauses in table joins? A) The ON clause can be used to join tables on columns that have different names but compatible data types. B) A maximum of one pair of columns can

【Oracle 12c】最新CUUG OCP-071考试题库(60题)

60.(16-10) choose the best answer: Evaluate the following SQL commands: SQL>CREATE SEQUENCE ord_seq INCREMENT BY 10 START WITH 120 MAXVALUE 9999 NOCYCLE; SQL>CREATE TABLE ord_items (ord_no NUMBER(4) DEFAULT ord_seq.NEXTVAL NOT NULL, item_no NUMBER(3

Oracle 12c RAC MGMTDB 说明

 注:本文谢绝转载. 1  MGMTDB 说明 在Oracle 12.1.0.1的Grid Infrastructure 的安装中,可以选择是否安装Grid Infrastructure Management Repository (GIMR) 数据库:MGMTDB. 如下图: 在Grid Infrastructure 12.1.0.2 中,已经没有改选项,MIMR 数据库已经变成了强制选项. 在Oracle 12c 中Management Database 用来存储Cluster Health

Oracle 12c 多租户在 CDB 中 Plug A PDB,Unplugging A PDB

Oracle 数据库 12 c 中介绍了多租户选项允许单个容器数据库 (CDB) 来承载多个单独的可插拔数据库 (PDB).本文简单的演示了如何在 CDB 中 Plug A PDB,Unplugging A PDB 操作. 一. plugged PDB into Unplugged PDBSQL> show pdbs    CON_ID CON_NAME  OPEN MODE  RESTRICTED---------- ------------------------------ -------