昨天有个需求,需要用命令行建一个RAC。先Google了一些文章,最好参照了下面这篇。
Create RAC database using DBCA silent mode,感谢此文作者,写得非常简洁。

我的环境是19c, 2节点RAC。然后遇到了一系列错误。

第一个错误,Disk Group不存在:

[FATAL] [DBT-06002] Selected disk group (XXXX) is not found.ACTION: Specify a disk group that is accessible from the system.

正好,主机上还有其它数据库,查询一下:

SQL> select name from v$asm_diskgroup;NAME
------------------------------
DATAC1
RECOC1

然后改成以下:

-diskGroupName +DATAC1/{DB_UNIQUE_NAME}/ \

第2个错误,FRA地址无效,可以绕过问题或指定FRA位置,我用了后者。

[WARNING] [DBT-06303] Unable to check if location (FRA/db0623/) is on ACFS.
[FATAL] [DBT-06007] The specified location (FRA Location) is invalid.CAUSE: The specified location is not found on the system or is detected to be a file.

直接去掉以下行:

-recoveryAreaDestination FRA \

或者改为:

-recoveryAreaDestination +$FRA \

第3个错误,4G以上不能AMM管理以及字符集问题:

[FATAL] [DBT-11211] The Automatic Memory Management option is not allowed when the total physical memory is greater than 4GB.CAUSE: The current total physical memory is 754GB.
[FATAL] [DBT-11152] National character set specified (AL32UTF8) is invalid.

直接删除以下行:

-nationalCharacterSet AL32UTF8 \
-automaticMemoryManagement true \

最终命令如下,会自动创建一个PDB orclpdb1。其中node01和node02是两个RAC节点的主机名,通过hostname命令获取。

export DBPWD='ABcd123_#'
export DGNAME=DATAC1
export FRA=RECOC1
export DBNAME=db0623
export NODE1=node01
export NODE2=node02dbca -silent \
-createDatabase \
-databaseConfigType RAC \
-templateName General_Purpose.dbc \
-gdbName $DBNAME  \
-sid $DBNAME  \
-SysPassword $DBPWD \
-SystemPassword $DBPWD \
-emConfiguration NONE \
-redoLogFileSize 2048  \
-storageType ASM \
-asmSysPassword $DBPWD \
-diskGroupName +$DGNAME/{DB_UNIQUE_NAME}/ \
-recoveryAreaDestination +$FRA \
-totalMemory 10240  \
-databaseType MULTIPURPOSE \
-nodelist ${NODE1},${NODE2} \
-createAsContainerDatabase true \
-numberOfPDBs 1 \
-pdbName orclpdb1 \
-pdbAdminPassword $DBPWD

日志如下,18分钟还是蛮快的:

Prepare for db operation
7% complete
Copying database files
27% complete
Creating and starting Oracle instance
28% complete
31% complete
35% complete
37% complete
40% complete
Creating cluster database views
41% complete
53% complete
Completing Database Creation
57% complete
59% complete
60% complete
Creating Pluggable Databases
64% complete
80% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:/u01/app/oracle/cfgtoollogs/dbca/db0623.
Database Information:
Global Database Name:db0623
System Identifier(SID) Prefix:db0623
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/db0623/db06231.log" for further details.real    18m8.020s
user    0m57.199s
sys     0m14.027s$ echo $?
0

另外两次也是18分钟左右,比较一致:

real    18m36.844s
user    0m57.905s
sys     0m14.577sreal    18m34.217s
user    0m56.531s
sys     0m14.336s

访问:

$ export ORACLE_SID=db06231
$ sqlplus / as sysdba
SQL> select count(*) from gv$instance;COUNT(*)
----------2SQL> show pdbs;CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------2 PDB$SEED                       READ ONLY  NO3 ORCLPDB1                       READ WRITE NO

删除,此时数据库是打开状态:

dbca -silent -deleteDatabase -sourceDB db0623

输出:

$ dbca -silent -deleteDatabase -sourceDB db0623
Enter SYS user password:[WARNING] [DBT-19202] The Database Configuration Assistant will delete the Oracle instances and datafiles for your database. All information in the database will be destroyed.
Prepare for db operation
32% complete
Connecting to database
39% complete
42% complete
45% complete
48% complete
52% complete
55% complete
58% complete
65% complete
Updating network configuration files
68% complete
Deleting instances and datafiles
77% complete
87% complete
97% complete
100% complete
Database deletion completed.
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/db0623/db06230.log" for further details.

最后,附上一个帮助:

$ dbca -createDatabase -help-createDatabase - Command to Create a database.-responseFile | (-gdbName,-templateName)-responseFile - <Fully qualified path for a response file>-gdbName <Global database name>-templateName <Specify an existing template in default location or the complete template path for DB Creation or provide a new template name for template creation>[-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>][-characterSet <Character set for the database>][-dvConfiguration <true | false> Specify true to configure and enable database vault.]-dvUserName <Specify database vault owner user name>-dvUserPassword <Specify database vault owner password>[-dvAccountManagerPassword <Specify database vault account manager password>][-dvAccountManagerName <Specify separate database vault account manager>][-datafileDestination <Destination directory for all database files>][-datafileJarLocation <For database creation, pass the absolute path of the datafile backup and for template creation, pass the directory to place the datafile backup>][-runCVUChecks <Specify "true" in order to run Cluster Verification Utility checks periodically for RAC databases.>][-sid <Database system identifier>][-redoLogFileSize <Size of each redo log file in MB>][-registerWithDirService <true | false>]-dirServiceUserName <User name for directory service>[-databaseCN <Database common name>][-dirServiceCertificatePath <Path to the certificate file to use when configuring SSL between database and directory service>][-dirServicePassword <Password for directory service>][-dirServiceUser <SamAccountName in case of configuring Active Directory>][-ldapDirectoryAccessType <PASSWORD | SSL>][-useSYSAuthForLDAPAccess <true | false>][-walletPassword <Password for database wallet>][-systemPassword <SYSTEM user password>][-nodelist <Node names separated by comma for the database>][-oracleHomeUserPassword <Specify Oracle Home User Password>][-sysPassword <SYS user password>][-enableArchive <true | false> Specify true to enable archive>][-archiveLogMode <AUTO|MANUAL , the default is Automatic archiving>][-archiveLogDest <Specify archive log destinations separated by comma. If archive log destination is not specified, fast recovery area location will be used for archive log files.>][-memoryMgmtType <AUTO|AUTO_SGA|CUSTOM_SGA>][-variables <Comma separated list of name=value pairs of location variables>][-listeners <A comma separated list of listeners that the database can be configured with>][-olsConfiguration <true | false> Specify true to configure and enable Oracle Label Security.][-configureWithOID This flag configures Oracle Label Security with OID.][-createAsContainerDatabase <true | false>][-pdbName <Pluggable database name>][-numberOfPDBs <Number of pluggable databases to be created, default is 0>][-pdbStorageMAXSizeInMB <value>][-pdbStorageMAXTempSizeInMB <value>][-useLocalUndoForPDBs <true | false>  Specify false to disable local undo tablespace for PDBs.][-pdbAdminPassword <PDB Administrator user Password, required only while creating new PDB>][-pdbOptions <A comma separated list of name:value pairs with database options to enable/disable. For example JSERVER:true,DV:false>][-recoveryAreaDestination <Destination directory for all recovery files. Specify "NONE" for disabling Fast Recovery Area>][-recoveryAreaSize <Fast Recovery Area Size in MB>][-createListener <Create a new listener to register your database. Specify in format, LISTENER_NAME:PORT>][-useOMF <true | false> Specify true to use Oracle-Managed Files.][-memoryPercentage | -totalMemory][-memoryPercentage <Percentage of physical memory for oracle database>][-totalMemory <Memory allocated for Oracle in MB>][-dbOptions <A comma separated list of name:value pairs with database options to enable/disable. For example JSERVER:true,DV:false>][-sampleSchema <true | false>][-variablesFile <File name of the name=value pairs for location variables in the template>][-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>][-databaseType <MULTIPURPOSE | DATA_WAREHOUSING | OLTP>][-oracleHomeUserName <Specify Oracle Home User Name>][-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>][-nationalCharacterSet <National character set for the database>][-storageType < FS | ASM >]-datafileDestination <Destination directory for all database files>[-asmsnmpPassword <ASMSNMP password for ASM monitoring>][-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>][-emConfiguration <DBEXPRESS | CENTRAL | BOTH | NONE>][-dbsnmpPassword <DBSNMP user password>][-emPassword <EM Admin user password>][-emUser <EM Admin username to add or modify targets>][-emExpressPort <EM database express port number. Generally used during createDatabase>][-omsHost <EM management server host name>][-omsPort <EM management server port number>][-emExpressPortAsGlobalPort <value>]

dbca 命令行静默方式创建Oracle RAC相关推荐

  1. oracle 静默创建库,静默方式创建Oracle数据库

    我前面弄了个<< 通过SHELL脚本快速安装Oracle11gR2软件>>用来快速安装Oracle软件,然后在通过本篇的方式来以静默方式创建Oracle数据库, 能更方便的创建 ...

  2. windows server 2008 R2 命令行的方式创建用户、设置密码

    一.使用命令行的方式创建用户.设置密码 (1)标准格式: net user username password  / add 例如:建立一个名为lijunxuan.密码为Abc_123的用户 net ...

  3. 使用 cmd、PowerShell 等用命令行的方式创建文件及文件夹

    mkdir == make directory 意为创建目录或文件 举例:mkdir home 在所在目录创建名为home的文件夹 mkdir -p 批量创建文件夹 举例:mkdir -p home/ ...

  4. 【DBCA -SILENT】静默方式安装11gR2 oracle数据库软件

    [DBCA -SILENT]静默方式安装11gR2数据库软件单实例 BLOG文档结构图 相关文章链接: DBCA静默方式建库 :http://blog.itpub.net/26736162/views ...

  5. 如何删除oracle软件,如何用静默方式删除oracle软件

    本文主要介绍在linux下如何用静默方式卸载oracle软件. 在linux下卸载oracle软件比较简单,可以简单的把相关目录删除掉,然后清理一下/etc下oracle相关的文件就可以. 但还是有必 ...

  6. php怎么创建表命令行,laravel使用命令行结合代码创建数据表的方法

    laravel使用命令行结合代码创建数据表的方法 发布时间:2021-01-19 10:12:17 来源:亿速云 阅读:91 作者:小新 这篇文章主要介绍laravel使用命令行结合代码创建数据表的方 ...

  7. 如何使用 kubectl 通过命令行的方式操作 SAP Kyma

    Kyma 运行时就是 Kubernetes cluster. To manage resources and configurations from the command line, the too ...

  8. 以命令行的方式运行activity

    以命令行的方式运行activity,可以直接运行你想要运行的那个activity,不必从第一个activity开始 1. <activity android:name=".camera ...

  9. mac创建文件服务器,mac命令行终端怎么创建文件 mac命令行终端创建文

    导读: 想要在mac os x系统中创建大容量空白文件其实非常简单.今天脚本之家小编为大家介绍两种创建文件教程,第一种就是使用mac命令行终端创建文件,第二种是使用磁盘工具应用... 想要在mac o ...

最新文章

  1. 约瑟夫环问题的两种解法(详解)
  2. RabbitMQ学习系列二:.net 环境下 C#代码使用 RabbitMQ 消息队列
  3. python自动化办公都能做什么菜-python+selenium自动化(一)之环境搭建
  4. 在Java 8中使用Stream API列出ZIP文件的内容
  5. client mac addr不能开机进不去系统_用asp.net core结合fastdfs打造分布式文件存储系统
  6. 创建二叉树的代码_解二叉树的右视图的两种方式
  7. 用IDEA开发一个简单的Spring MVC的Hello World程序,表单程序
  8. MyBatis(3):SQL映射
  9. 路径压缩_实战|python GUI压缩小程序
  10. 如何自制daplink_DAPLINK功能介绍
  11. MathType求和符号中的黑三角该如何消除
  12. Python爬虫教程:爬取王者荣耀全套皮肤【附源码】
  13. 【kubernetes】k8s使用客户端连接haproxy访问高可用集群流程详细说明【使用kubeconfig连接haproxy】【kubeconfig配置全部流程】
  14. CDR插件开发之CPG插件016 -【实例】在CPG插件中动态导出图像到临时文件夹
  15. iPhone开发之SQLite 实现中文排序的教程
  16. 2021-2022 ACM-ICPC Latin American Regional Programming Contest
  17. 学习mathematica(三)——基本数学运算
  18. MineMap地图web端定位问题处理
  19. opencv 视频中人脸检测
  20. LibreOffice Draw vs. 微软Office Visio

热门文章

  1. DOM初探(17)——查看元素的尺寸与位置
  2. 寻找全排列的下一个数
  3. Gnuplot 绘图
  4. 留用户、补内容,在线音乐暗战不停
  5. Error opening archive: Failed to open ‘/Users/**\**/Library/
  6. 华为OD机试真题 Java 实现【服务中心选址】【2023 Q1 | 200分】
  7. 到底是加瓦好还是C好呢?
  8. 最近经常看到网上程序员被抓,如何避免面向监狱编程!?
  9. 某易—将军令动态刨析算法(1)
  10. Interpro注释