Hello everyone, how are you doing? Today we are going to talk again about a feature of Oracle 19c that can be useful when creating new databases. This functionality allows to create a new instance in version 19c from another one that we have created by cloning it. It can be done from the graphic mode of dbca but in this case we are going to tell you how it can be done with dbca in silent mode.
Syntax for cloning from dbca
The option we are discussing is called createDuplicateDB and the parameters it supports are:
dbca -createDuplicateDB -gdbName global_database_name -primaryDBConnectionString easy_db_connection_string -sid database_system_identifier [-initParams initialization_parameters [-initParamsEscapeChar initialization_parameters_escape_character]] [-sysPassword SYS_user_password] [-policyManaged | -adminManaged] [-policyManaged -serverPoolName server_pool_names [-pqPoolName pq_pool_name] [-createServerPool new_server_pool_name [-pqPoolName new_pq_pool_name] [-force] [-pqCardinality pq_cardinality_of_the_new_server_pool] [-cardinality cardinality_of_the_new_server_pool]]] [-adminManaged] [-nodelist database_nodes_list] [-datafileDestination data_files_directory] [-recoveryAreaDestination recovery_files_directory [-recoveryAreaSize fast_recovery_area_size]] [-databaseConfigType {SINGLE | RAC | RACONENODE} [-RACOneNodeServiceName service_name_for_RAC_One_Node_database]] [-useOMF {true | false}] [-storageType {FS | ASM} [-asmsnmpPassword ASMSNMP_password] -datafileDestination database_files_directory] [-createListener new_database_listener] [-createAsStandby [-dbUniqueName db_unique_name_for_standby_database]] [-customScripts custom_sql_scripts_to_run_after_database_creation] [-useWalletForDBCredentials {true | false} -dbCredentialsWalletPassword wallet_account_password -dbCredentialsWalletLocation wallet_files_directory]
In the primaryDBConnectionString section we have to indicate the connection string to the source server instance and supports the following format:
"host[:port][/service_name][:server][/instance_name]"
The chain of connection is very similar to the one we use for a normal jdbc connection.
In the -databaseConfigType parameter we indicate what type of database we are going to create:
- SINGLE: Single individual database.
- RAC: Oracle RAC database.
- RACONENODE: Oracle RAC One Node database.
We can also define the configuration values that we want to be different from the original using the -initParams parameter.
To define the storage we use the -storageType parameter that allows us to indicate FS or ASM and in conjunction with -datafileDestination and -useOMF we indicate the path and how we want the files to be created.
With -sysPassword we indicate the password of the user sys in origin to perform the cloning.
As a last important step we can decide whether to create a new listener. We indicate that with the -createListener option.
Let’s see how the cloning of a database would be launched with all the steps completed:
./dbca -silent -createDuplicateDB -gdbName DB19NEW -primaryDBConnectionString dbprod.gpsos.es:1522/DB19OLD -sid DB19NEW -databaseConfigType SINGLE -initParams db_unique_name=DB19NEW -sysPassword syspass1234
-storageType ASM -datafileDestination +DATA1 -useOMF true -createListener LISTENER_DB19NEW:1525
the cloning of a database would be launched with all the steps completed:core
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 "/oracle/app/oracle/cfgtoollogs/dbca/DB19NEW/DB19NEW.log" for further details.
As we have seen, the functionality is very interesting and in a very simple way we can have a new instance created from an existing one.
Regards and until next time.
Source: http://oracledbatr.blogspot.com/2017/07/dataguard-12cr2-new-feature-using-dbca.html
If you don’t want to miss more tips like this one, sign up to our newsletter.
Still do not know Query Performance ? Find out how it can help you in your Oracle environment. More information on their page LinkedIn .
Follow GPS on LinkedIn