19c dbca 搭建备库
【摘要】 命令使用说明:dbca -createDuplicateDB -gdbName global_database_name -primaryDBConnectionString easy_connect_string_to_primary -sid database_system_identifier [-createAsStandby [-dbUn...
命令使用说明:
dbca -createDuplicateDB
-gdbName global_database_name
-primaryDBConnectionString easy_connect_string_to_primary
-sid database_system_identifier
[-createAsStandby
[-dbUniqueName db_unique_name_for_standby]]
[-customScripts scripts_list]
19c dbca 已经支持cdb创建克隆的数据库。
在备不需要设置监听dbca自动创建。
执行过程记录:
gdbName=DB_NAME #和主数据库保持一致
sid #备数据库的sid
dbUniqueName=db_unique_name #备机的参数
[oracle@db02 admin]$ dbca -silent -createDuplicateDB -gdbName cdb01 -sid sbcdb01 -sysPassword oracle -
primaryDBConnectionString 192.168.3.230:1521/cdb01 -createAsStandby -dbUniqueName sbcdb01
Prepare for db operation
22% complete
Listener config step
44% complete
Auxiliary instance creation
67% complete
RMAN duplicate
89% complete
Post duplicate database operations
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/sbcdb01/sbcdb010.log" for further details.
#备机SID
[oracle@db02 admin]$ ps -ef|grep pmon
oracle 27232 1 0 18:31 ? 00:00:00 ora_pmon_sbcdb01
#备机监听自动配置
[oracle@db02 admin]$ lsnrctl status
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 20-MAY-2021 18:32:50
Copyright (c) 1991, 2021, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=db02)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 20-MAY-2021 18:29:13
Uptime 0 days 0 hr. 3 min. 36 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/19.3/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/db02/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db02)(PORT=1521)))
Services Summary...
Service "cdb01XDB" has 1 instance(s).
Instance "sbcdb01", status READY, has 1 handler(s) for this service...
Service "pdb" has 1 instance(s).
Instance "sbcdb01", status READY, has 1 handler(s) for this service...
Service "sbcdb01" has 2 instance(s).
Instance "sbcdb01", status UNKNOWN, has 1 handler(s) for this service...
Instance "sbcdb01", status READY, has 1 handler(s) for this service...
The command completed successfully
#主备tnsnames.ora
tnsnames.ora
cdb01 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.3.230)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = cdb01)
)
)
sbcdb01 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.3.233)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = sbcdb01)
)
)
主机配置
alter system set LOG_ARCHIVE_DEST_2='service=sbcdb01 VALID_FOR=(online_logfiles,primary_role) DB_UNIQUE_NAME=sbcdb01';
alter system set log_archive_config='dg_config=(cdb01,sbcdb01)';
alter system set standby_file_management=auto;
备机配置:
alter system set log_archive_config='dg_config=(cdb01,sbcdb01)';
alter system set standby_file_management=auto;
alter system set fal_server='cdb01';
alter database recover managed standby database using current logfile disconnect;
创建pdb:测试同步 状态
主:
create pluggable database pdb01
admin user admin identified by admin
file_name_convert = ('/pdbseed', '/pdb01');
alter pluggable database pdb01 open;
alter pluggable database pdb01 open;
备:
Recovery created pluggable database PDB01
Recovery copied files for tablespace SYSTEM
Recovery successfully copied file /data2/CDB01/pdb01/system01.dbf from /data2/CDB01/pdbseed/system01.dbf
PDB01(4):WARNING: File being created with same name as in
PDB01(4):primary. Existing file may be overwritten
PDB01(4):Recovery created file /data2/CDB01/pdb01/system01.dbf
PDB01(4):Successfully added datafile 13 to media recovery
PDB01(4):Datafile #13: '/data2/CDB01/pdb01/system01.dbf'
2021-05-20T19:04:31.393742+08:00
Recovery copied files for tablespace SYSAUX
Recovery successfully copied file /data2/CDB01/pdb01/sysaux01.dbf from /data2/CDB01/pdbseed/sysaux01.dbf
PDB01(4):WARNING: File being created with same name as in
PDB01(4):primary. Existing file may be overwritten
PDB01(4):Recovery created file /data2/CDB01/pdb01/sysaux01.dbf
PDB01(4):Successfully added datafile 14 to media recovery
PDB01(4):Datafile #14: '/data2/CDB01/pdb01/sysaux01.dbf'
Recovery copied files for tablespace UNDOTBS1
Recovery successfully copied file /data2/CDB01/pdb01/undotbs01.dbf from /data2/CDB01/pdbseed/undotbs01.dbf
PDB01(4):WARNING: File being created with same name as in
PDB01(4):primary. Existing file may be overwritten
PDB01(4):Recovery created file /data2/CDB01/pdb01/undotbs01.dbf
PDB01(4):Successfully added datafile 15 to media recovery
PDB01(4):Datafile #15: '/data2/CDB01/pdb01/undotbs01.dbf'
PR00 (PID:35163): Media Recovery Waiting for T-1.S-29 (in transit)
Using standby_pdb_source_file_dblink and standby_pdb_source_file_directory to Maintain Standby Databases when Performing PDB
Remote Clones or Plugins (Doc ID 2274735.1)
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)