###复制完成数据库状态:READ ONLY
dbca -silent \
-createDuplicateDB -gdbName cdb -sid sbcdb \
-createAsStandby -dbUniqueName sbcdb -sysPassword oracle \
-primaryDBConnectionString ora02:1521/cdb \
-datafileDestination /u01/db -storageType FS \
-initParams db_recovery_file_dest=/u01/arc,db_create_file_dest=/u01/db \ <===同一天机器复制,pdb失败的!!!db_create_file_dest
-createListener LISTENERxxxxx:1522
#去掉 createAsStandby:
dbca -silent \
-createDuplicateDB -gdbName sbcdb -sid sbcdb \
-dbUniqueName sbcdb -sysPassword oracle \
-primaryDBConnectionString ora02:1521/cdb \
-datafileDestination /u01/db -storageType FS \
-initParams db_recovery_file_dest=/u01/arc
#在同一台主机克隆pdb目录问题更改问题:
dbca -silent \
-createDuplicateDB -gdbName sbcdb -sid sbcdb \
-dbUniqueName sbcdb -sysPassword oracle \
-primaryDBConnectionString ora02:1521/cdb \
-datafileDestination /u01/db/sbcdb -storageType FS \
-initParams db_recovery_file_dest=/u01/arc2,PDB_FILE_NAME_CONVERT="/u01/app/oracle/oradata/CDB/,/u01/db/sbcdb/"
#需要指定PDB_FILE_NAME_CONVERT 文件参数:
PDB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/CDB/','/u01/db/sbcdb/'
ALTER SESSION SET PDB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/CDB/pdbseed/','/u01/app/oracle/oradata/CDB/pdb01/';
CREATE PLUGGABLE DATABASE pdb01 ADMIN USER pdb_adm IDENTIFIED BY Password1;
alter pluggable database pdb01 open;
drop pluggable database pdb01 including datafiles;
## 1--从单实例到单实例
2dbca -silent -createDuplicateDB -gdbName CDB2 -sid CDB2
3-primaryDBConnectionString host01:1521/CDB1 -databaseConfigType SI
4-initParams db_unique_name=CDB2 -sysPassword password
5-datafileDestination /u02/oracle/app/oradata
6
7--从单实例到rac
8dbca -silent -createDuplicateDB -gdbName RACDUP
9-primaryDBConnectionString PRIMSI -sid dup -databaseConfigType RAC
10-adminManaged -nodelist node1,node2
11-initParams db_unique_name=RACDUP
12-sysPassword password -storageType ASM -datafileDestination +DG
13-useOMF true -createListener LISTENERRACDUP:1530
-initParams db_create_online_log_dest_1='+data' \
-sid sbcdb -dbUniqueName sbpdb19c \
-gdbName pdb19c \
-datafileDestination '+data' \
-initParams db_create_online_log_dest_1='+data' \
-createAsStandby
-bash-4.2$ dbca -createDuplicateDB -h
[INS-04003] Invalid argument passed from command line. Specified argument ([-h]) is not a supported argument for this application.
-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>]