dbca 功能越来越强大,19c中可以利用它克隆pdb、relocate pdb、创建standby,测试环境上创建数据库比较方便,但有个注意的事项:创建过程中,最好不要另开窗口对数据库操作而不关闭。
一次创建测试库时发现很慢,看告警日志发现在扩展3、4号数据文件,这是因为General_Purpose.dbc中定义的文件初始值大小只有几百兆,于是想另开一个窗口,直接将这两个文件大小设置为1G,岂不高效?alter database datafile 3,4 resize 1g; 执行完后没有退出sqlplus,这就带来问题了,dbca创建过程中会多次启动实例,但是如果有活动会话他就会报错,导致一些不可预知的问题,例如
字符集没有设置正确...
基本过程如下:
-
创建测试库
-
$dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname orcl -sid orcl -characterSet ZHS16GBK -sysPassword oracle -systemPassword oracle -totalMemory 1048 -redoLogFileSize 200 -datafileDestination /u01/app/oracle/oradata
-
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
-
CAUSE:
-
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
-
b.The password entered is a keyword that Oracle does not recommend to be used as password
-
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
-
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
-
CAUSE:
-
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
-
b.The password entered is a keyword that Oracle does not recommend to be used as password
-
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
-
上面提示sys、system密码太简单,建议设置为复杂的密码
-
Prepare for db operation
-
10% complete
-
Copying database files
-
40% complete
-
Creating and starting Oracle instance
-
42% complete
-
46% complete 这里速度很慢(超过3分钟),于是开了另一个sqlplus窗口,修改文件大小,但是没退出sqlplus
-
[WARNING] ORA-12721: operation cannot execute when other sessions are active
-
这里出现警告,可能出现不可预知的问题
-
50% complete
-
54% complete
-
60% complete
-
Completing Database Creation
-
66% complete
-
69% complete
-
70% complete
-
Executing Post Configuration Actions
-
100% complete
-
Database creation complete. For details check the logfiles at:
-
/u01/app/oracle/cfgtoollogs/dbca/orcl.
-
Database Information:
-
Global Database Name:orcl
-
System Identifier(SID):orcl
-
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.日志里没啥,可以参考一下告警日志内容,不放心还是删除重建吧
-
[oracle@apex ~]$ dbca -silent -deletedatabase -sourcedb orcl
-
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
-
35% complete
-
39% complete
-
42% complete
-
45% complete
-
48% complete
-
52% complete
-
65% complete
-
Updating network configuration files
-
68% complete
-
Deleting instance and datafiles
-
84% complete
-
100% complete
-
Database deletion completed.
-
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl0.log" for further details.
解决办法是:
1、扩容后立即退出sqlplus
或者
2、创建db前先修改General_Purpose.dbc中内容
-
-
vi $ORACLE_HOME/assistants/dbca/templates/General_Purpose.dbc
-
对于创建数据库的速度会有一点点提升。
方法2 经验证无效唉 :(
阅读(1578) | 评论(0) | 转发(0) |