Friday, March 25, 2022

MODIFY DB_BLOCK_SIZE in Oracle and create Tablespace with non standard block size.


MODIFY DB_BLOCK_SIZE in Oracle  and create Tablespace with non standard block size.


The basic unit of disk I/O performed by Oracle is an Oracle Block. 

Each Oracle block is a combination of several OS blocks and the number of OS block per Oracle block is OS dependent.


The default size of oracle block is specified by the parameter DB_BLOCK_SIZE which is non modifiable during the life time of the database.


Critical tablespaces such as SYSTEM and SYSAUX will be created with the block size specified by the parameter DB_BLOCK_SIZE

Possible value for 64 bit , the parameter value can be set as  2K, 4K, 8K, 16K and 32K, 

for 32 bit servers the maximum value for this parameter is 16K.


OLTP system typically benefit better by using a 4K or 8K blocks, but need to be decided after studying the data model of the database. 

DSS databases would benefit better with the block sizes of 16K or 32K.


SQL> show parameter db_block_size

NAME                     TYPE    VALUE

------------------------------------ ----------- ------------------------------

db_block_size                integer     8192


This parameter cannot be changed after creation of the database.


You will get error like below 

SQL>

SQL> alter system set db_block_size=16384 scope=spfile;

alter system set db_block_size=16384 scope=spfile

*

ERROR at line 1:

ORA-32017: failure in updating SPFILE

ORA-32016: parameter db_block_size cannot be updated in SPFILE

 

SQL> alter system set db_block_size=16384 scope=memory;

alter system set db_block_size=16384 scope=memory

                 *

ERROR at line 1:

ORA-02095: specified initialization parameter cannot be modified

 

SQL>


If there is a need to create table with non-default block size, it is possible to create it in the same database. 

Oracle database allows upto 4 non standard block size tablespaces.


Before creating a tablespace with non standard block size be sure to allocate new buffer cache space that can accommodate blocks with this size by setting DB_nK_CACHE_SIZE.


For example if the default block size is 8K and you want to create a tablespace with 16K blocks then you need to allocate buffer cache to store 16K blocks using the parameter db_16K_cache_size.

You can follow below steps to create a new tablespace with non-default block size without allocating buffer cache with this block size.


SQL> create tablespace 16K_TBS1 datafile '/u01/16k_TBS/16k_tbs1_datafile01.dbf' size 1g blocksize 16k;

create tablespace tbs_16k datafile '/u01/16k_TBS/16k_tbs1_datafile01.dbf' size 1g blocksize 16k

*

ERROR at line 1:

ORA-29339: tablespace block size 16384 does not match configured block sizes


Let’s set the 16K buffer cache as 50M and try to create the tablespace again


SQL> alter system set db_16k_cache_size=50M scope=both;

System altered.


SQL> create tablespace 16k_TBS1 datafile '/u01/16k_TBS/16k_tbs1_datafile01.dbf' size 1g blocksize 16k;

Tablespace created.


Tablespace has been successfully created,


If you want to change the block size of a certain table you need to create a new tablespace with new required block size and move that table to this newly created tablespace.









Thursday, August 5, 2021

ORA-20000: RDF Component not installed:RDF Component for 11.1 or above must be installed.

ORA-20000: RDF Component not installed:RDF Component for 11.1 or above must be installed.


Oracle Spatial and Graph - Version 12.1.0.2 and later

SYMPTOMS
~~~~~~~~~~
Errors related to Semantics while upgrading a Standard Edition 12.1.0.2 database to 12.2.0.1.


In the catupgrd0.log file:

sdo/admin/sdordfctx.sql


ERROR at line 1:
ORA-20000: RDF Component not installed:RDF Component for 11.1 or above must be
installed.
ORA-06512: at line 11



CAUSE
~~~~~~~~~~
Neither RDF nor Spatial is included in Standard Edition, so the RDF upgrade scripts should not have been running.
 
No RDF packages or tables should exist in 12c Standard Edition database.
 


SOLUTION
~~~~~~~~~~~
Neither RDF nor Spatial is included in Standard Edition. The upgrade completed successfully and all components are in a VALID state and there are no invalid related objects, therefore the upgrade errors can be ignored.

 

REFER (Doc ID 2296328.1) for more info from MOS










Wednesday, March 31, 2021

AIX :OPatch fails with "The java.library.path system variable is missing or invalid

AIX :OPatch fails with "The java.library.path system variable is missing or invalid OPatch failed with error code 255"


# $ORACLE_HOME/OPatch/opatch lsinventory
The java.library.path system variable is missing or invalid. Please set java.library.path with a correct value and retry the operation.

OPatch failed with error code 255



# $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.18

OPatch succeeded.

 
Issue is due to unpublished Bug 31050164 .





SOLUTION
~~~~~~~~~~~~~~~~~~
$ORACLE_HOME/OPatch/opatch lsinventory -jre $ORACLE_HOME/jdk

Note: Issue will be fixed in upcoming OPatch version 12.2.0.1.20



Refer ORACLE support note for more info ---  (Doc ID 2653020.1)







Tuesday, March 30, 2021

Oracle database Startup report ORA-00704 ORA-39714

Oracle database Startup report ORA-00704 ORA-39714 

Database failed to start, reported ORA-00704, ORA-39714 error


TRY below first

ORA-39714: upgrade script utlmmig.sql failed

Cause: A normal database open was attempted, but the upgrade script utlmmig.sql failed to complete.

Action: Use the UPGRADE option when opening the database and then run utlmmig.sql.




If not working, you can check the below workaround, but on own risk



Sqlplus/as SYSDBA

Sql*plus:release 12.1.0.2.0 Production on Thu Aug 7 08:15:35 2014

Copyright (c) 1982, 2013, Oracle. All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition release 12.1.0.2.0 - 64bit Production
With the partitioning, OLAP, Advanced Analytics and real application testing options

Sql> Startup
ORACLE instance started.

Total System Global area 663945216 bytes
Fixed Size 2291808 bytes
Variable Size 369100704 bytes
Database buffers 289406976 bytes
Redo buffers 3145728 bytes
Database mounted.
Ora-01092:oracle instance terminated. Disconnection forced
Ora-00704:bootstrap Process Failure
Ora-39714:upgrade Script Utlmmig.sql failed
Process id:11592
Session Id:1 Serial Number:5



Alert Log Error
~~~~~~~~~~~~~~~~~~~~~~~~
Thu Aug 07 07:42:25 2014
Smon:enabling Cache Recovery
Thu Aug 07 07:42:25 2014
Errors in FILEAPPL/ORA12102/DIAG/RDBMS/PROD/PROD/TRACE/ORCL_ORA_11592.TRC:
Ora-39714:upgrade Script Utlmmig.sql failed
Thu Aug 07 07:42:25 2014
Errors in FILEAPPL/ORA12102/DIAG/RDBMS/PROD/PROD/TRACE/ORCL_ORA_11592.TRC:
Ora-00704:bootstrap Process Failure
Ora-39714:upgrade Script Utlmmig.sql failed
Thu Aug 07 07:42:25 2014
Errors in FILEAPPL/ORA12102/DIAG/RDBMS/PROD/PROD/TRACE/ORCL_ORA_11592.TRC:
Ora-00704:bootstrap Process Failure
Ora-39714:upgrade Script Utlmmig.sql failed
Thu Aug 07 07:42:25 2014
Error 704 happened during DB Open, shutting down database
USER (ospid:11592): Terminating the instance due to error 704




By analyzing the Utlmmig.sql script, 
the database will insert Bootstrap_upgrade_error related records in the props$ table before upgrading bootstrap$, 
and the database will detect the value when it is started, if it is found, The database can only start in upgrade mode, 
clean up the related records, the database can start normally



Sqlplus/as SYSDBA

Sql*plus:release 12.1.0.2.0 Production on Thu Aug 7 07:42:44 2014

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Connected to a idle instance.

Sql> Startup upgrade
ORACLE instance started.

Total System Global area 663945216 bytes
Fixed Size 2291808 bytes
Variable Size 369100704 bytes
Database buffers 289406976 bytes
Redo buffers 3145728 bytes
Database mounted.
Database opened.


Sql> Delete from props$ where name = ' Bootstrap_upgrade_error ';

1 row deleted.

Sql> Delete from props$ where name = ' Logmnr_bootstrap_upgrade_error ';

0 rows deleted.

Sql> commit;

Commit complete.

Sql>


sql> shutdown Immediate
Database closed.
Database dismounted.
ORACLE instance shut down.




Sql> Startup
ORACLE instance started.

Total System Global area 663945216 bytes
Fixed Size 2291808 bytes
Variable Size 369100704 bytes
Database buffers 289406976 bytes
Redo buffers 3145728 bytes
Database mounted.
Database opened.
Sql>



The database is successfully started, 
but because the Bootstrap$ object upgrade failed, there is a significant follow-up risk, we recommend the analysis of the cause of the error, 
and then continue to upgrade the bootstrap$ base table




Tuesday, March 16, 2021

OEM PRE SETUP PARAMETERS

OEM PRE SETUP PARAMETERS 

Set the PDB to auto-start.
sqlplus / as sysdba <<EOF
alter system set db_create_file_dest='${DATA_DIR}';
alter pluggable database ${PDB_NAME} save state;


-- Recommended minimum settings.
alter system set "_allow_insert_with_update_check"=true scope=both;
alter system set session_cached_cursors=200 scope=spfile;

 
-- Recommended: processes=600
alter system set processes=600 scope=spfile;


-- Recommended: pga_aggregate_target=1G
alter system set pga_aggregate_target=450M scope=spfile;


-- Recommended: sga_target=3G
alter system set sga_target=800M scope=spfile;


-- Recommended: shared_pool_size=600M
--alter system set shared_pool_size=600M scope=spfile;


-- For 12.1.0.2 set the following.
--alter system set optimizer_adaptive_features=false scope=both;


-- Should not be needed for 19c, but installer fails without them.
alter system set "_optimizer_nlj_hj_adaptive_join"= FALSE scope=both sid='*';
alter system set "_optimizer_strans_adaptive_pruning" = FALSE scope=both sid='*';
alter system set "_px_adaptive_dist_method" = OFF scope=both sid='*';
alter system set "_sql_plan_directive_mgmt_control" = 0 scope=both sid='*';
alter system set "_optimizer_dsdir_usage_control" = 0 scope=both sid='*';
alter system set "_optimizer_use_feedback" = FALSE scope=both sid='*';
alter system set "_optimizer_gather_feedback" = FALSE scope=both sid='*';
alter system set "_optimizer_performance_feedback" = OFF scope=both sid='*';


SHUTDOWN IMMEDIATE;
STARTUP;

exit;

EOF






NOTE:-
Please be cautious and careful, refer the oracle documents before setting hidden parameters