合 Oracle 19c使用dbca来搭建物理DG
【DG】Oracle 19c使用dbca来搭建物理DG单实例(12cR2可以使用但主库必须是单机非CDB的库,18c无限制)
Using DBCA to Create a Data Guard Standby
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.
在 12cR2 ( 12.2.0.1 )之前创建物理备库的方法有:
1 、使用 RMAN 备份恢复方法;
2 、在 11g 时可以选择 duplicate 方式创建物理备库;通过这种方式直接在线从主库搭建物理备库。
到 12cR2 ( 12.2.0.1 )后, Oracle 又提供更简单的方式来创建物理备库,即使用 DBCA 方式直接建立物理备库。这个功能再次简化了创建备库的复杂度。
通过 DBCA 提供的参数 createDuplicateDB 可以很容易的搭建一个物理备库。其具体语法如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | -------------- 12cR2 -createDuplicateDB - Command to Duplicate a database. -gdbName <Global database name> -primaryDBConnectionString <EZCONNECT string to connect to primary database for example "host:port/servicename"> -sid <Database system identifier> [-createAsStandby <Option to create a standby database>] [-dbUniqueName <db_unique_name for standby db>] [-customScripts <A comma separated list of SQL scripts which needs to be run post db creation.The scripts are run in order they are listed>] [-datafileDestination <Destination directory for all database files>] [-initParams <Comma separated list of name=value pairs>] [-initParamsEscapeChar <Specify escape character for comma when a specific initParam has multiple values.If the escape character is not specified backslash is the default escape character>] ----------- 18c -createDuplicateDB - Command to Duplicate a database. -gdbName <Global database name> -primaryDBConnectionString <EZCONNECT string to connect to primary database for example "host:port/servicename"> -sid <Database system identifier> [-initParams <Comma separated list of name=value pairs>] [-initParamsEscapeChar <Specify escape character for comma when a specific initParam has multiple values.If the escape character is not specified backslash is the default escape character>] [-policyManaged | -adminManaged] [-policyManaged <Policy managed database, default option is Admin managed database>] -serverPoolName <Specify the single server pool name in case of create server pool or comma separated list in case of existing server pools> [-pqPoolName <value>] [-createServerPool <Create a new server pool, which will be used by the database>] [-pqPoolName <value>] [-forceServerPoolCreation <To create server pool by force when adequate free servers are not available. This may affect the database which is already in running mode>] [-pqCardinality <value>] [-cardinality <Specify the cardinality of the new server pool that is to be created, default is the number of qualified nodes>] [-adminManaged <Admin managed database, this is default option>] [-datafileDestination <Destination directory for all database files>] [-nodelist <Node names separated by comma for the database>] [-databaseConfigType <SINGLE | RAC | RACONENODE>] [-RACOneNodeServiceName <Service name for the service to be created for RAC One Node database. This option is mandatory when the databaseConfigType is RACONENODE>] [-createAsStandby <Option to create a standby database>] [-dbUniqueName <db_unique_name for standby db>] [-customScripts <A comma separated list of SQL scripts which needs to be run post db creation.The scripts are run in order they are listed>] ----------- 19c -createDuplicateDB - Command to Duplicate a database. -gdbName <Global database name> -primaryDBConnectionString <EZCONNECT string to connect to primary database for example "host:port/servicename"> -sid <Database system identifier> [-useWalletForDBCredentials <true | false> Specify true to load database credentials from wallet] -dbCredentialsWalletLocation <Path of the directory containing the wallet files> [-dbCredentialsWalletPassword <Password to open wallet with auto login disabled>] [-initParams <Comma separated list of name=value pairs>] [-initParamsEscapeChar <Specify escape character for comma when a specific initParam has multiple values.If the escape character is not specified backslash is the default escape character>] [-policyManaged | -adminManaged] [-policyManaged <Policy managed database, default option is Admin managed database>] -serverPoolName <Specify the single server pool name in case of create server pool or comma separated list in case of existing server pools> [-pqPoolName <value>] [-createServerPool <Create a new server pool, which will be used by the database>] [-pqPoolName <value>] [-forceServerPoolCreation <To create server pool by force when adequate free servers are not available. This may affect the database which is already in running mode>] [-pqCardinality <value>] [-cardinality <Specify the cardinality of the new server pool that is to be created, default is the number of qualified nodes>] [-adminManaged <Admin managed database, this is default option>] [-datafileDestination <Destination directory for all database files>] [-nodelist <Node names separated by comma for the database>] [-databaseConfigType <SINGLE | RAC | RACONENODE>] [-RACOneNodeServiceName <Service name for the service to be created for RAC One Node database. This option is mandatory when the databaseConfigType is RACONENODE>] [-createAsStandby <Option to create a standby database>] [-dbUniqueName <db_unique_name for standby db>] [-customScripts <A comma separated list of SQL scripts which needs to be run post db creation.The scripts are run in order they are listed>] |
虽然通过 DBCA 能非常简单的创建一个物理备库,但是要使用这个功能,必须满足以下条件:
① 主库必须是单机环境,非 RAC 数据库;
② 主库必须是非 CDB 环境;