Skip to Main Content
  • Questions
  • how to specify block size when installing database silently with dbca

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, bochuan.

Asked: January 31, 2018 - 3:33 am UTC

Last updated: February 02, 2018 - 12:34 am UTC

Version: oracle 11.2.0.4

Viewed 1000+ times

You Asked

Hi Tom,
I use the script below to create database, but I want to know how to specify db block size.I didnot find a parameter in dbca.rsp corresonding to this. And block size is hard to be changed once the database is created. So can you please tell me how to specify db block size in this occasion? create db silently with script is required.

script:
dbca -silent -createDatabase -templateName $ORACLE_HOME/assistants/dbca/templates/New_Database.dbt -sysPassword Acca2017 -systemPassword Acca2017 -gdbname orcl -sid orcl -datafiledestination /11gdata01 -characterSet ZHS16GBK -storageType FS


Thank you !
Looking forward to your reply!

Bochuan

and Connor said...

-initParams db_block_size=8192

should do the trick

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Thank you!I will try.

bochuan xuan, January 31, 2018 - 8:27 am UTC

I will try it. Thank you for answering me so fast !!
Connor McDonald
February 01, 2018 - 12:33 am UTC

glad we could help

bochuan xuan, February 01, 2018 - 8:07 am UTC

Thank you Tom!
I tried it and it works as '-initParams db_block_size=8' instead of '-initParams db_block_size=8192'. Thank you for your inspiration. I know how to add the parameter in pfile to my script.

Now I am trying to specify redo log location and number of redo log file included in my new script blow. There is no parameter corresponding to this. Could you please tell me how ?

script:
dbca -silent -createDatabase -templateName $ORACLE_HOME/assistants/dbca/template
s/New_Database.dbt -sysPassword Acca2017 -systemPassword Acca2017 -gdbname orcl
-sid orcl -datafiledestination /11gdata01 -characterSet ZHS16GBK -storageType FS -initParams db_block_size=8 -initParams control_files='/11gdata01/orcl/control01.ctl','/11gdata01/orcl/control02.ctl','/11gdata01/flash_recovery_area' -initParams log_archive_dest='/11gdata01/arch/orcl' -initParams pga_aggregate_target=307200 -initParams sga_target=1048576 -initParams log_archive_format='orcl_%t_%s_%r.arc'

Looking forward to your reply!
Thank you !

Connor McDonald
February 02, 2018 - 12:34 am UTC

To do that, I think you need to use the template. Within the template you'll see something like:

      <RedoLogGroupAttributes id="1">
         <reuse>false</reuse>
         <fileSize unit="KB">204800</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo01.log" filepath="{ORACLE_BASE}\oradata\{DB_UNIQUE_NAME}\"/>
      </RedoLogGroupAttributes>


You would need to specify it there. Or you could use variables to allow a single template to be re-used, eg

<code>
      <RedoLogGroupAttributes id="1">
         <reuse>false</reuse>
         <fileSize unit="KB">204800</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo01.log" filepath="{REDO}"/>
      </RedoLogGroupAttributes>

</code>

and then add: -variables REDO=/u01/disk1/myredo

to the dbca command

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database