Oracle 建立PDB-遠端克隆
Oracle 建立PDB- 遠端克隆
二:遠端克隆Cloning a Remote PDB
遠端克隆
將187伺服器上chenpdb資料庫遠端克隆到222伺服器上cjcpdb04庫
---187 遠端庫
Oracle Database 19 c Enterprise Edition Release 19.0 .0.0.0 - Production
Version 19.3 .0.0.0
SQL > show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 CHENPDB READ WRITE NO
--- 建立測試資料
SQL > alter session set container = chenpdb ;
Session altered.
SQL > create user chen identified by oracle ;
User created.
SQL > grant connect , resource , dba , create pluggable to chen ;
SQL > grant create pluggable to chen ;
Grant succeeded.
SQL > conn chen / oracle @ chenpdb
SQL > create table employees_01 as select * from hr.employees ;
Table created.
SQL > select file_name from dba_data_files ;
FILE_NAME
--------------------------------------------------------------------------------
/ u01 / app / oracle19 / oradata / CHENDB / chenpdb / system01.dbf
/ u01 / app / oracle19 / oradata / CHENDB / chenpdb / sysaux01.dbf
/ u01 / app / oracle19 / oradata / CHENDB / chenpdb / undotbs01.dbf
/ u01 / app / oracle19 / oradata / CHENDB / chenpdb / users01.dbf
--- 為了保障資料一致性,也可以將待克隆的資料庫設定為只讀狀態
---SQL> alter pluggable database chenpdb close;
---SQL> alter pluggable database chenpdb open read only;
---222 本地庫
---tnsname.ora 新增
CHENPDB_LINK =
( DESCRIPTION =
( ADDRESS = ( PROTOCOL = TCP )( HOST = 192.168 .2.187 )( PORT = 1521 ))
( CONNECT_DATA =
( SERVER = DEDICATED )
( SERVICE_NAME = chenpdb )
)
)
CJCPDB04 =
( DESCRIPTION =
( ADDRESS = ( PROTOCOL = TCP )( HOST = cjcos )( PORT = 1521 ))
( CONNECT_DATA =
( SERVER = DEDICATED )
( SERVICE_NAME = cjcpdb04 )
)
)
[oracle @ cjcos oradata]$ pwd
/ u01 / app / oracle12 / oradata
[oracle @ cjcos oradata]$ mkdir cjcpdb04
--- 建立連線遠端庫的dblink
SQL > CREATE DATABASE LINK chenpdb_link CONNECT TO chen IDENTIFIED BY oracle USING 'chenpdb_link' ;
---遠端克隆
SQL >
CREATE PLUGGABLE DATABASE cjcpdb04 FROM chenpdb @ chenpdb_link
FILE_NAME_CONVERT = ( '/u01/app/oracle19/oradata/CHENDB/chenpdb/' ,
'/u01/app/oracle12/oradata/cjcpdb04/' );
Pluggable database created.
---檢視對應告警日誌
2020 - 03 - 30 T13 : 55 : 14.265860 + 08 : 00
CREATE PLUGGABLE DATABASE cjcpdb04 FROM chenpdb @ chenpdb_link
FILE_NAME_CONVERT = ( '/u01/app/oracle19/oradata/CHENDB/chenpdb/' ,
'/u01/app/oracle12/oradata/cjcpdb04/' )
2020 - 03 - 30 T13 : 56 : 03.124780 + 08 : 00
CJCPDB04 ( 6 ): Endian type of dictionary set to little
2020 - 03 - 30 T13 : 56 : 05.708201 + 08 : 00
****************************************************************
Pluggable Database CJCPDB04 with pdb id - 6 is created as UNUSABLE.
If any errors are encountered before the pdb is marked as NEW ,
then the pdb must be dropped
local undo - 1 , localundoscn - 0 x0000000000000118
****************************************************************
2020 - 03 - 30 T13 : 56 : 08.228640 + 08 : 00
Applying media recovery for pdb - 4099 from SCN 2162581 to SCN 2162616
Remote log information : count - 1
thr - 1 , seq - 7 , logfile -/ u01 / app / oracle19 / product / 19.0 .0 / dbhome_1 / dbs / archparlog_1_7_f2af50d_1036413577.arc , los - 2146891 , nxs - 18446744073709551615
CJCPDB04 ( 6 ): Media Recovery Start
2020 - 03 - 30 T13 : 56 : 08.253256 + 08 : 00
CJCPDB04 ( 6 ): Serial Media Recovery started
CJCPDB04 ( 6 ): max_pdb is 8
2020 - 03 - 30 T13 : 56 : 08.725328 + 08 : 00
CJCPDB04 ( 6 ): Media Recovery Log / u01 / app / oracle19 / product / 19.0 .0 / dbhome_1 / dbs / archparlog_1_7_f2af50d_1036413577.arc
2020 - 03 - 30 T13 : 56 : 10.008175 + 08 : 00
CJCPDB04 ( 6 ): Incomplete Recovery applied until change 2162616 time 03 / 30 / 2020 13 : 56 : 08
2020 - 03 - 30 T13 : 56 : 10.133184 + 08 : 00
CJCPDB04 ( 6 ): Media Recovery Complete ( cjcdb01 )
2020 - 03 - 30 T13 : 56 : 11.061364 + 08 : 00
CJCPDB04 ( 6 ): Autotune of undo retention is turned on.
2020 - 03 - 30 T13 : 56 : 51.439938 + 08 : 00
CJCPDB04 ( 6 ): Undo initialization recovery : err : 0 start : 1180295010 end : 1180295043 diff : 33 ms ( 0.0 seconds )
CJCPDB04 ( 6 ): [ 27424 ] Successfully onlined Undo Tablespace 2 .
CJCPDB04 ( 6 ): Undo initialization online undo segments : err : 0 start : 1180295043 end : 1180295053 diff : 10 ms ( 0.0 seconds )
CJCPDB04 ( 6 ): Undo initialization finished serial : 0 start : 1180295010 end : 1180295055 diff : 45 ms ( 0.0 seconds )
CJCPDB04 ( 6 ): Database Characterset for CJCPDB04 is AL32UTF8
CJCPDB04 ( 6 ): JIT : pid 27424 requesting stop
CJCPDB04 ( 6 ): Buffer Cache flush started : 6
CJCPDB04 ( 6 ): Buffer Cache flush finished : 6
2020 - 03 - 30 T13 : 56 : 53.986700 + 08 : 00
Completed : CREATE PLUGGABLE DATABASE cjcpdb04 FROM chenpdb @ chenpdb_link
FILE_NAME_CONVERT = ( '/u01/app/oracle19/oradata/CHENDB/chenpdb/' ,
'/u01/app/oracle12/oradata/cjcpdb04/' )
---222 本地資料庫
SQL > show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 CJCPDB01 MOUNTED
4 CJCPDB02 MOUNTED
5 CJCPDB03 MOUNTED
6 CJCPDB04 MOUNTED
SQL > alter session set container = cjcpdb04 ;
Session altered.
SQL > startup
Pluggable Database opened.
--- 檢視資料
SQL > conn chen / oracle @ cjcpdb04
Connected.
SQL > select count (*) from employees_01 ;
COUNT (*)
----------
107
---常見 錯誤:
---1 許可權不足
CREATE PLUGGABLE DATABASE cjcpdb04 FROM chenpdb @ chenpdb_link
*
ERROR at line 1 :
ORA - 17628 : Oracle error 1031 returned by remote Oracle server
ORA - 01031 : insufficient privileges
---187 遠端資料庫授予chen使用者create pluggable database許可權
SQL > conn sys / oracle @ chenpdb as sysdba
Connected.
SQL > grant create pluggable database to chen ;
Grant succeeded.
---2 本地資料庫compatible低於遠端資料庫
ORA - 65294 : PDB 's compatible parameter value (19.0.0.0.0) is higher than CDB' s
compatible parameter value ( 12.2 .0.0.0 ) .
---222 本地資料庫
SQL > show parameter compatible
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
compatible string 12.2 .0
noncdb_compatible boolean FALSE
---187 遠端
SQL > show parameter compati
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
compatible string 19.0 .0
---222 本地資料庫
SQL > alter system set compatible = '19.0.0' scope = spfile ;
System altered.
SQL > shutdown immediate
SQL > startup
SQL > show parameter compatible
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
compatible string 19.0 .0
歡迎關注我的微信公眾號"IT小Chen",共同學習,共同成長!!!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29785807/viewspace-2683332/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 建立PDB-本地克隆Oracle
- Oracle 12C 新特性之 PDB熱克隆(本地克隆、遠端異機克隆)Oracle
- git克隆遠端倉庫的指定分支Git
- 如何在本地克隆遠端github倉庫Github
- 遠端批次建立crontab
- 遠端建立SP模式模式
- Z003-O001-03 克隆遠端 PDB
- 使用TortoiseHg克隆遠端目錄報錯"abort: Access is denied"
- 建立AIX克隆盤AI
- pod遠端私有倉庫建立
- 遠端批次建立crontab2.0
- 在遠端建立使用者
- Z004-O001-04 克隆遠端 Non-CDB
- 建立、克隆pdb---oracle 12c 學習(1)Oracle
- 靜默建立oracle資料庫及克隆資料庫Oracle資料庫
- Z006-O001-06 DBCA 靜默克隆遠端 PDB
- 建立遠端基表的物化檢視
- 克隆(clone) ORACLE HOMEOracle
- Clone (克隆) ORACLE HOMEOracle
- iOS下 建立遠端cocoapods私有庫的套路iOS
- ubunbu 12.04中安裝xrdp建立遠端桌面
- Visual Studio和Git建立遠端連線Git
- 克隆 clone Oracle 軟體Oracle
- Oracle expdp資料泵遠端匯出Oracle
- ORACLE 配置連線遠端資料庫Oracle資料庫
- Oracle 遠端匯出匯入 imp/expOracle
- 在CentOS6.0上配置Oracle資料庫可以遠端使用的遠端配置。CentOSOracle資料庫
- 使用VsCode的遠端儲存庫外掛不用克隆下載Github專案VSCodeGithub
- .Net core使用XRPC建立遠端介面的Actor物件RPC物件
- 如何使用ANSIBLE在遠端主機上建立RabbitMQMQ
- 在CentOS上搭建git倉庫伺服器以及mac端進行克隆和提交到遠端git倉庫CentOSGit伺服器Mac
- powerVM客戶端系統盤克隆客戶端
- git版本控制器 中新建遠端倉庫連線 或者 刪除舊的遠端倉庫的連線 建立新的遠端連線Git
- 遠端連線桌面 批次遠端管理
- Oracle 12c多租戶特性詳解:PDB 的建立、克隆與維護Oracle
- oracle goldengate 遠端捕獲和投遞OracleGo
- iptables導致無法遠端連線oracleOracle
- 用sqlplus遠端連線oracle命令SQLOracle