Friday, January 23, 2015

ORA-03206: maximum file size of (4194304) blocks in AUTOEXTEND clause is out of range

You want to add a datafile to a tablespace with the maximum size of 32G, but instead you hit following situation:

SQL> ALTER TABLESPACE "T_CI" ADD DATAFILE 'E:\APP\ORACLE\ORADATA\MYDB\DATAFILE06.DBF' SIZE 1G AUTOEXTEND ON NEXT 256M MAX
SIZE 32G;
ALTER TABLESPACE "T_CI" ADD DATAFILE 'E:\APP\ORACLE\ORADATA\MYDB\DATAFILE06.DBF' SIZE 1G AUTOEXTEND ON NEXT 256M MAXSIZE
32G
*
ERROR at line 1:
ORA-03206: maximum file size of (4194304) blocks in AUTOEXTEND clause is out of
range



The maximum size is indeed 32G and we can specify it in MB.

SQL> ALTER TABLESPACE "T_CI" ADD DATAFILE 'E:\APP\ORACLE\ORADATA\MYDB\DATAFILE06.DBF' SIZE 1G AUTOEXTEND ON NEXT 256M MAX
SIZE 32767M;


Tablespace altered.



Also, another solution is to set the maximim size in GB, but smaller than 32GB:

SQL> ALTER TABLESPACE "T_CI" ADD DATAFILE 'E:\APP\ORACLE\ORADATA\MYDB\DATAFILE06.DBF' SIZE 1G AUTOEXTEND ON NEXT 256M MAX
SIZE 30G;

Tablespace altered.

Wednesday, January 21, 2015

SQL Plus easy connect ORA-12504

[oracle@rac2 ~]$ sqlplus sys@localhost:1521/pdborcl.localdomain as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Wed Jan 21 10:39:12 2015

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

ERROR:
ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA


Enter user-name:


This error is generated by the fact that in easy connect string the password must be specified also or if the password is not specified the connect string should enclosed in double quotes.

First case, without password specified:

[oracle@rac2 ~]$ sqlplus sys@\"localhost:1521/pdborcl.localdomain\" as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Wed Jan 21 10:41:30 2015

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

Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SYS:localhost:1521/pdborcl.localdomain SQL>


In this case the \ is the escape character for double quotes.

Second case, with password in connect string:

[oracle@rac2 ~]$ sqlplus sys/Passw0rd@\"localhost:1521/pdborcl.localdomain\" as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Wed Jan 21 10:41:56 2015

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SYS:localhost:1521/pdborcl.localdomain SQL>

Wednesday, January 7, 2015

Disable/enable automatic startup of CRS stack

Disable/enable automatic startup of CRS stack:

-bash-4.1# ./crsctl enable crs
CRS-4622: Oracle High Availability Services autostart is enabled.
-bash-4.1# ./crsctl disable crs
CRS-4621: Oracle High Availability Services autostart is disabled.

In 11.2.0.3 following file is updated during disable/enable of CRS:

-bash-4.1# more /etc/oracle/scls_scr/rac1/root/ohasdstr
disable










Also is posible to directly modify this file using vi and put disable/enable to disable/enable CRS.

Oracle 11.2.0.4 Internal error (ORA-600[kxfpqsod_qc_sod]) detected

This error seems to be generated by DEFAULT parallel server settings on small tables.
After some investigations with Oracle Support we get the following solution:

Run PXHCDR.SQL: Parallel Execution Health-Checks and Diagnostics Reports (Doc ID 146040.1) to extract objects with DEFAULT parallel settings and tables that have different DOP settings from their indexes.


Any table less than 1 GB in size should be with DEGREE=1. You can find all the tables and degree in "DOP" html.

Action Plan
__________

1. Make all tables whose size < 1 GB as : Alter Table <schema.table_name> NOPARALLEL;
2. Keep Tables and corresponding index same degree, i.e. if a TABLE has DEGREE 1, then make its all Index as DEGREE 1 OR if a table has DEGREE 4, keep all its Index as DEGREE 4
3. Do not leave any object with DEGREE DEFAULT. Have a correct integer value. As a practice, Tables > 1 GB < 4 GB DEGREE 2, while Tables > 4 GB keep DEGREE 4

Statement to alter degree:

Tables : Alter table <schema.table_name> PARALLEL (DEGREE N) ; ==========> N is the integer value, 2 or 4 or DEFAULT etc.
Index : Alter index <schema.index_name > PARALLEL (DEGREE N) ;

You can view DEGREE for Tables and Index in DBA_TABLES and DBA_INDEXES respectively. 

Oracle listener logfile truncate

Listener logfile location:

$ORACLE_BASE\diag\tnslsnr\<listener_name>\trace

Because on busy OLTP databases listener logfile can grow very fast is usefull to archive logfile and then create new one.

Steps:

lsnrctl set log_status off
mv listener.log listener_old.log
lsnrctl set log_status on