dbca 创建standby 数据库

简介: dbca -silent -createDuplicateDB

1,参考文档和手册

参考手册:

《Data Guard Concepts and Administration》
3.4 Using DBCA to Create a Data Guard Standby

《Database Administrator’s Guide》
2.3 Creating a Database with DBCA

The Database Configuration Assistant (DBCA) can also be used as a simple command-line method to create an Oracle Data Guard physical standby database.

非多租户的数据库环境,单实例环境。

The DBCA command qualifier used to create the physical standby database is createDuplicateDB .

DBCA can only be used to create standby databases for non-multitenant primary databases. In addition, this capability creates only single instance standby databases, not Oracle Real Application Clusters (Oracle RAC) databases. If required, the standby can then be converted to an Oracle RAC standby database, either manually or using Oracle Enterprise Manager Cloud Control

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]

创建备用数据库:

dbca –silent -createDuplicateDB -primaryDBConnectionString  myprimary.domain:1523/chicago.domain 
-gdbName chicago.domain -sid boston -initParams instance_name=boston –createAsStandby

Enter SYS user password:
Listener config step
33% complete
Auxiliary instance creation
66% complete
RMAN duplicate
100% complete
Look at the log file " /u01/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/dbca/chicago/chicago.log" for further details.

2,实战操错练习

数据库版本

Release 12.2.0.1.0

主机环境设置

192.168.0.196 prod04 #primary db
192.168.0.197 prod05#standby db

主库sid:

[oracle@prod04 ~]$ ps -ef|grep pmon
oracle     6047      1  0 09:05 ?        00:00:02 ora_pmon_orcl
oracle    10361  10343  0 13:29 pts/0    00:00:00 grep --color=auto pmon

备库sid:

[oracle@prod05 ~]$ 
[oracle@prod05 ~]$ ps -ef|grep pmon
oracle     9800      1  0 11:07 ?        00:00:01 ora_pmon_sborcl
oracle    10492  10471  0 13:25 pts/2    00:00:00 grep --color=auto pmon

主备机需要配置tnsname.ora

[oracle@prod04 admin]$ cat tnsnames.ora 
orcl =
(DESCRIPTION =
    (ADDRESS_LIST =(ADDRESS=(PROTOCOL= TCP)(HOST=prod04)(PORT=1521)))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl))
)

sborcl =
(DESCRIPTION =
    (ADDRESS_LIST =(ADDRESS=(PROTOCOL = TCP)(HOST=prod05) (PORT=1521)))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = sborcl))
)

>主数据库要求:
打开数据库归档
非cdb模式数据库
打开监听
配置tnsname.ora.

>备机要求
配置tnsname.ora
执行dbca.(自动创建静态监听和启动监听程序)

[oracle@prod05 ~]$ dbca -silent -createDuplicateDB -primaryDBConnectionString 192.168.0.196:1521/orcl -gdbName orcl -sid sborcl -initParams instance_name=sborcl -createAsStandby
Enter SYS user password: 

Listener config step
33% complete
Auxiliary instance creation
66% complete
RMAN duplicate
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.

如果未配置tnsname.ora报错信息:

[oracle@prod05 ~]$ dbca -silent -createDuplicateDB -primaryDBConnectionString 192.168.0.196:1521/orcl -gdbName orcl -sid sborcl -initParams instance_name=sborcl -createAsStandby
Enter SYS user password: 

Listener config step
33% complete
Auxiliary instance creation
66% complete
RMAN duplicate
DBCA Operation failed.
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.

删除数据库:
dbca -silent -deleteDatabase -sourceDB sborcl

3,光放参考文档:

Creating a Physical Standby database using DBCA duplicate (文档 ID 2283697.1)

相关文章
|
Oracle 关系型数据库 数据库
Oracle 不使用DBCA在Oracle 11中删除数据库
Oracle 不使用DBCA在Oracle 11中删除数据库
81 0
|
存储 Oracle 关系型数据库
Oracle-使用DBCA silent模式创建数据库
Oracle 21C使用DBCA silent创建数据库
653 0
|
存储 SQL Oracle
请参考rhel7 安装 oracle 18c rac(03 dbca 建立数据库)
rhel7 安装 oracle 18c rac(01 grid软件安装) dbca 建立数据库。
3254 0
|
监控 Oracle 关系型数据库
|
关系型数据库 数据库 Oracle
|
21天前
|
存储 Oracle 关系型数据库
数据库传奇:MySQL创世之父的两千金My、Maria
《数据库传奇:MySQL创世之父的两千金My、Maria》介绍了MySQL的发展历程及其分支MariaDB。MySQL由Michael Widenius等人于1994年创建,现归Oracle所有,广泛应用于阿里巴巴、腾讯等企业。2009年,Widenius因担心Oracle收购影响MySQL的开源性,创建了MariaDB,提供额外功能和改进。维基百科、Google等已逐步替换为MariaDB,以确保更好的性能和社区支持。掌握MariaDB作为备用方案,对未来发展至关重要。
47 3