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
- git克隆遠端倉庫的指定分支Git
- 如何在本地克隆遠端github倉庫Github
- Z003-O001-03 克隆遠端 PDB
- Z004-O001-04 克隆遠端 Non-CDB
- Z006-O001-06 DBCA 靜默克隆遠端 PDB
- Visual Studio和Git建立遠端連線Git
- Oracle expdp資料泵遠端匯出Oracle
- ORACLE 配置連線遠端資料庫Oracle資料庫
- iOS下 建立遠端cocoapods私有庫的套路iOS
- 使用VsCode的遠端儲存庫外掛不用克隆下載Github專案VSCodeGithub
- 2020-12-19 docker 部署oracle 並plsq遠端連結oracleDockerOracle
- 如何使用ANSIBLE在遠端主機上建立RabbitMQMQ
- .Net core使用XRPC建立遠端介面的Actor物件RPC物件
- 2.10.3 使用 Oracle Automatic Storage Management (Oracle ASM) 克隆資料庫OracleASM資料庫
- PL/SQL Developer連線遠端Oracle資料庫SQLDeveloperOracle資料庫
- Oracle Database Server 'TNS Listener'遠端資料投毒漏洞OracleDatabaseServer
- 1.3.2.1. 通過克隆Cloning方式建立PDB
- 使用免費的Oracle雲服務-遠端連線ATPOracle
- Oracle盲注結合XXE漏洞遠端獲取資料Oracle
- 遠端連線桌面 批次遠端管理
- JAVA設計模式 2【建立型】原型模式的理解與使用、理解淺克隆和深克隆Java設計模式原型
- 【BUILD_ORACLE】使用Oracle資料泵線上不停機克隆/遷移PDBUIOracle
- 批次遠端桌面連線 批次遠端桌面
- 遠端桌面連線命令 批次遠端管理
- 遠端工作報告:從遠端到混合
- Windows IDEA 專案(Scala+Sbt、Scala+Maven)建立與遠端部署到Linux(遠端部署其它專案也適用)WindowsIdeaMavenLinux
- Oracle data link建立Oracle
- mysql8下建立使用者遠端登陸許可權MySql
- 1.3.2.1.2. 通過克隆或None-CDB方式建立CDBNone
- 我不知道如何在 JS/TS 中建立深度克隆JS
- vnc遠端用外網遠端公司內網,3步實現vnc遠端用外網遠端公司內網VNC內網
- Oracle ASM使用asmcmd中的cp命令來執行遠端複製OracleASM
- windows10系統下遠端桌面連線失敗客戶端無法建立與遠端計算機的連線如何解決Windows客戶端計算機
- VNC遠端控制,VNC遠端控制連線WindowsVNCWindows
- rd遠端桌面 如何連線rd遠端桌面
- 批次遠端桌面管理軟體 批次遠端桌面
- Go實現ssh執行遠端命令及遠端終端Go