In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. PDB preparation for migrating from PDB or Non-CDB to another CDB
Migrating from PDB or Non-CDB to PDB in the CDB container database, because the steps for PDB and Non-CDB migration to CDB are almost the same, PDB and Non-CDB migration are very similar and are processed together.
Prepare:
CDB1: the container database of the target pdb database
Db12c: Non-CDB to be migrated
CDB3: the container database of pbd needs to be migrated
2. Clone remote PDB or Non-CDB in Oracle DB12C
-- Note: local represents the destination or destination CDB, and remote represents the source of PBD or Non-CDB.
* *-2.1 steps for cloning * *
/ *
1. In the destination end and container, you must have the permission of CREATE PLUGGABLE DATABASE.
2. Read-only mode must be enabled for source-side database (PDB or non-CDB).
3. The destination database must have a database link link to the source database. If PBD,database link uses ordinary users to point to source CDB or PDB, use target users or ordinary users.
4. The database link user of the source database must have CREATE PLUGGABLE DATABASE permission.
5. The target database and the source database must have the same installation options and character set
6. TDE must be configured before cloning.
7. The default tablespace on the source side must exist in the destination CDB. If it does not exist, the new PDB can only be opened in restricted mode.
8. When cloning Non-CDB, the source and destination databases must use version 12.1.0.2 or above.
, /
2.2 Clone Remote PDB
-1. Set up the environment
Export ORAENV_ASK=NOexport ORACLE_SID=cdb3. Oraenvexport ORAENV_ASK=YESsqlplus / as sysdba
-- 2. Create a user on the remote side for db_link
Alter session set container=pdb5;create user remote_clone_user identified by remote_clone_user;grant create session,create pluggable database to remote_clone_user
-3. Open read only mode in PDB on the remote side
Conn / as sysdbaalter pluggable database pdb5 close;alter pluggable database pdb5 open read only;exit
-- 4. Add the local link name to "tnsnames.ora" on the local side for db_link to use
PDB5 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.2.81) (PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = pdb5)
-5. Connect the local side to start cloning
Export ORAENV_ASK=NOexport ORACLE_SID=cdb1. Oraenvexport ORAENV_ASK=YESsqlplus / as sysdba
-6. Create a database connection on the local side
Drop database link clone_link;create database link clone_link connect to remote_clone_user identified by remote_clone_user using 'pdb5'
-- Test the connection
Desc user_tables@clone_link
-7. Create a new PDB on the local side of the database
Create pluggable database pdb5new from pdb5@clone_link
8. View the new PDB and its status
Select name,open_mode from v$pdbs where name='PDB5NEW'
9. Open PDB in read-write mode
Alter pluggable database pdbsnew open;select name,open_mode from v$pdbs where name = 'PDB5NEW'
* *-2.3Clone Non-CDB**
-1. Set up the environment
Export ORAENV_ASK=NOexport ORACLE_SID=db12c. Oraenvexport ORAENV_ASK=YESsqlplus / as sysdba
-- 2. Create a user on the remote side for db_link
Create user remote_clone_user identified by remote_clone_user;grant create session,create pluggable database to remote_clone_user
-3. Open read only mode in PDB on the remote side
Shutdown immediate;startup mount;alter database read only;exit
-- 4. Add the local link name to "tnsnames.ora" on the local side for db_link to use
DB12C = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.93) (PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = PDF)
-5. Connect the local side to start cloning
Export ORAENV_ASK=NOexport ORACLE_SID=cdb1. Oraenvexport ORAENV_ASK=YESsqlplus / as sysdba
-6. Create a database connection on the local side
Drop database link clone_link;create database link clone_link connect to remote_clone_user identified by remote_clone_user using 'db12c'
-- Test the connection
Desc user_tables@clone_link
-7. Create a new PDB on the local side of the database
Create pluggable database db12cpdb from NON$CDB@clone_link
-8. View the new PDB and its status
Select name,open_mode from v$pdbs where name='DB12CPDB'
-- 9. Run the following script to clear the non-CDB to PDB information
Alter session set container=db12cpdb;@$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql
-10. Open PDB in read-write mode
ALTER PLUGGABLE DATABASE db12cpdb OPEN;select name,open_mode from v$pdbs where name = 'DB12CPDB'
* *-2.4Migration of non-cdb databases to PDB**
-1. Close non-cdb and open it in read-only mode
Export ORACLE_SID=db12csqlplus / as sysdbashutdown immediate;startup open read only
-- 2. Create a xml file using the dbms_pbd.describe procedure
Begin dbms_pdb.describe (pdb_descr_file = >'/ tmp/db12c.xml'); end
-3. Shut down the non-cdb database
Exprot ORACLE_SID=db12csqlplus / as sysdbashutdown immediate
-- 4. Create a PDB in CDB using non-cdb 's description file
Export ORACLE_SID=cdb1sqlplus / as sysdbacraete pluggable database pdb6 using'/ tmp/db12c.xml'copyfile_name_convert = ('/ u01 apprenticeship oraclescaraporadata,'/ u01lemaphoractyoradata','/ u01 plaza, oradata, ordb1, oradata, ordb6, etc)
-5. Switch to pdb6 and run the following script
Alter session set container = pdb6;@$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql
-6. Start PDB and check open_mode
Alter session set container = pdb6;alter pluggable database open; select name,open_mode from v$pdbs
* *-2.5 data migration * *
-- option 1: use data dump (expdp/impdp)
-- migrate from non-cdb to the newly created PDB database using data dump (expdp/impdp). If non-cdb is later than 11.2.0.3, expdp uses the "FULL=Y TRANSPORTABLE=ALWAYS VERSION=12" parameter. If you convert on different platforms, you need to use RMAN's convert command, or the DBMS_FILE_TRANSFER package.
-- option 2: use Goldengate
-- use Goldengate's replicate to transfer data from non-cdb to pdb.
*-- 2.6 patch consideration * *
-- if the patches on the source side and the destination side are basically different, you need to look at the PDB_PLUG_IN_VIOLATIONS attempt in PDB, and use the datapatch tool to scan the destination side and implement the relevant patches.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.