2012-12-31

Direct I/O is mandatory if the files are on a Network Attached Storage (NAS)

If you have NFS mount points, yuor linux/unix box will not use filesytem cache . It will be only direct IO

ZFS inifiniband traffic

When using a ZFS appliance with Exadata- Infiniband traffic is severely affected [ID 1351805.1]

2012-12-27

CSSD aborting from thread clssnmvDiskPingMonitorThread

11.2.0.3 CRS Abort With "CSSD aborting from thread clssnmvDiskPingMonitorThread" if Only One Voting Disk/File is Configured [ID 1466639.1]

2012-12-24

21DEC


Între Revoluţia Română şi "revoluţia" din ziua "sfârşitului lumii" s-au scurs o seamă de ani şi am păşit dintr-un secol zbuciumat într-un secol care-şi găseşte cu greu pacea. Amintirile sunt mai blânde, mai rotunjite. Sunt mai ales depre sentimentul aproape insondabil al libertăţii totale, speranţele aproape fără limite şi visele fără bariere din acele zile. Aminitirile sunt despre deşteptarea de conştiinţe şi despre multe feluri de curaj.
La 23 de ani după Revoluţia Română, ne mulţumim să trăim în prezentul diurn, cu gândul la viitorul de peste trei zile şi uitând comod de trecut. Libertatea este un lux pe care ni-l putem oferi şi proteja doar cu trudă. Gândurile, visele şi curajul sunt cuminţi şi pragmatice. Am devenit prea sceptici, prea înţelepţi ca să mai facem Revoluţie. Îndrăzneala noastră ţine cât să avem revolte personale, în folos individual. Firesc, trăim aproape exclusiv pentru noi, lipsindu-ne altruismul, un pic inconştient, de a îndrepta ceva din lumea de afară.
În 21 decembrie 2012 lumea de afară înseamnă, de exemplu, un Parlament bizar, pe care abia l-a încăput o sală indecent de mare şi în care cei cărora le-am dat votul rumegă de zor covrigei, gumă sau rămân "inteligent" surprinşi de arhitectonica tavanului. Pentru ce să te revolţi? Ce să îndrepţi? Pe ce să-ţi iroseşti altruismul?

2012-12-23

momentos

http://vimeo.com/17896628

don't give hope

http://www.youtube.com/watch?feature=player_embedded&v=tLpsDamWdIM

history of the temporary tablespace usage

http://www.pythian.com/news/38635/sleuthing-for-temporary-space-spendthrifts

ORA-10873


ORA-10873: file 1 needs to be either taken out of backup mode or media recovered

It means that you stopped the database when there was a hot manual backup in place ( or some part of your database remained in backup mode long before )

Solution :
startup  mount ;
alter database end backup ;
alter database open ;

2012-12-20

required rpm packages for installing oracle database on oracle enterprise linux 6.3 64bit


https://www.oratoolkit.ch/knowledge/howto/installation/seSrv-11g-R2-on-OEL-6.3-x86_64.php

2012-12-19

clustering factor explained

http://richardfoote.wordpress.com/2012/12/19/storage-indexes-vs-database-indexes-part-ii-clustering-factor-fast-track/
The Clustering Factor (CF) is the most important index related statistic, with the efficiency of an index performing multi-row range scans very much dependent on the CF of the index. If the data in the table is relatively well clustered in relation to the index (i.e. it has a “low” CF), then an index range scan can visit relatively few table blocks to obtain the necessary data. If the data is effectively randomised and not well clustered in relation to the index (i.e. has a “high” CF), then an index range scan has to visit many more table blocks and not be as efficient/effective as a result. The CBO will be less inclined to use such an index as a result, depending on the overall selectivity of the query.

2012-12-13

2012-12-09

how to make a high end VDI with little money

http://myworldofit.net/?p=540
you can install windows 2008 server and then play with ocz revodrive 3 x2 because you can use the drivers from windows 7 ( the only ones officially released )

2012-12-07

2012-12-06

how to test the memory of your x64 server

if you have a server with more than 64GB , use memtest for servers : http://www.memtest86.com/

2012-12-03

best flash pcie card for oracle database ( warehouses )

OCZ z-drive R4 allows a lot of throughput ( in terms of MB/s )

2012-11-29

how to use HCC with ZFS

http://jongsma.wordpress.com/2012/11/26/using-hcc-on-zfs-storage-appliances/

when to change batteries on exadata

http://blog.oracle-ninja.com/2012/03/exadata-v2-battery-replacement/
http://jarneil.wordpress.com/2012/03/06/exadata-batteries/

choose a 4k blocksize for a database on a flash drive

http://ashminderubhi.wordpress.com/2012/11/29/optimise-your-oracle-blocksize-with-flash-storage/

oracle how to check if index is in unusable state

STATUS column from DBA_INDEXES, DBA_IND_PARTITIONS and DBA_IND_SUBPARTITIONS.


https://forums.oracle.com/forums/thread.jspa?threadID=1088692

2012-11-20

ow to disable IPv6 in Linux

http://yourlinuxguy.com/?p=49

price for purestorage


Straightforward $/GB usable pricing

which filesystem to use with HP IO accelerator

http://bizsupport1.austin.hp.com/bc/docs/support/SupportManual/c02964959/c02964959.pdf

2012-11-18

exadata - how its' made

http://vimeo.com/46778003

2012-11-16

Bug high 'direct path read'

Bug 12530276 - high 'direct path read' waits when buffer pools are not setup [ID 12530276.8]

KEEP BUFFER POOL Does Not Work for Large Objects on 11g


KEEP BUFFER POOL Does Not Work for Large Objects on 11g [ID 1081553.1]

what is an iDB protocol

Source : http://www.dbaleet.org 

top related events

a great collection of scripts : http://gavinsoorma.com/2012/11/ash-and-awr-performance-tuning-scripts/

the impact of jumbo frames in RAC interconnect

A very good article by Steven Lee:
 http://www.dbaleet.org/about_rac-interconnectjumbo-frame  ( use google translate ):

The real IOPS for exadata


From the graph you can see, the HC and HP IOPS are calculated separately. To illustrate the problem a simple presentation of the form:
Exadata RackDisk TypeDisk CountDisk ModelIOPS
FULL (1/1)HP14 * 12 = 16815000rpm SAS 600G50000
HC7200rpm SAS 3T28000
HALF (1/2)HP7 * 12 = 6815000rpm SAS 600G25000
HC7200rpm SAS 3T14000
QUAR (1/4)HP3 * 12 = 3615000rpm SAS 600G10800
HC7200rpm SAS 3T6000
A simple look can spot patterns: the total IOPS given in the datasheet is actually superimposed.
A quarter rack in ( HC - high capacity ) has only 6000 IOPS


Exadata use hard disk provider and models are as follows, the reader can google the detailed parameters: (Note 2T disk has been discontinued)
600G 1500rpm HP disk: Seagate ST3600057SS, Hitachi HUS156060VLS600
3T 7200rpm HC disk: Seagate ST33000650SS
2T 7200rpm HC disk: Seagate ST32000444SS, Hitachi HUS723020ALS640


Also, exadata's performance is affected by temperature (http://www.dbaleet.org/exadata_how_to_caculate_iops) :
Actually a test disk I / O performance when installed in Exadata steps in Step 9 - INFO: Step 9 RunCalibrate. This step will Exadata Cell disk IOPS and MBPS test. If the hard disk IOPS less than the requirements established in the time of installation will be an error. For example, there is a very common situation: Seagate hard at room temperature below 20 degrees Celsius, IOPS will become poor. See Bug 9,476,044: CALIBRATE IOPS SUBSTANDARD. This problem is a "feature" of the Seagate (Seagate) SAS disk later the Exadata to use the Hitachi (Hitachi) did not find this problem. The Exadata hard disk suppliers on only two, in view of this, in general we do not recommend the computer room air conditioning alignment Exadata blowing heat.

exadata storage server

The server behind an exadata storage cell is an : SUN FIRE X4270 M2 SERVER   

http://www.oracleace.com/blog/?p=237672

2012-11-14

mercurialul nasterilor

http://www.cojocarii.ro/2011/05/tarife_nasteri/

direct reads problem in 11.2.0.2 and 11.2.0.3

http://www.pythian.com/news/37527/upgraded-to-11gr2-congrats-you-are-in-direct-reads-trouble

2012-11-12

der neue logan

www.promotor.ro/teste-auto/test-in-premiera/am-testat-noua-dacia-logan-noul-logan-este-regele-masinilor-ieftine-10285778

how to enable DB Flash Cache in RHEL/Centos


DB Flash Cache Feature

- Supported on Solaris and OEL ( Oracle Enterprise Linux )
- Tip for red-hat testing: actually just need package ‘enterprise-release’ from OEL to replace file ‘redhat-release’ ( from /etc )

From Testing Storage for Oracle RAC 11g with NAS, ASM and DB Smart Flash Cache

how to monitor OS usage in RAC


A query the authors find useful to monitor OS resources usage in oracle and especially in RAC via v$views  ( from storage testing rac 11g ukoug lc dw )

2012-11-07

Don’t use RAC unless you need it

http://www.nocoug.org/Journal/NoCOUG_Journal_201202.pdf

the fastest ram-flash device

If you want to make your redo logs faster, you can put them on this device .
The speed is about 4GB/s with the latency around 0.5 microseconds


 Â Module ArxCis-NV DRAM with 2 GB capacity can be purchased for $ 300.
http://www.vikingtechnology.com/arxcis-nv

http://pcper.com/news/General-Tech/How-about-battery-free-RAMdrive-Viking-ArxCis-NV-writes-flash-if-it-loses-power

performance with ODA - oracle database appliance

http://www.pythian.com/news/27201/oracle-database-appliance-storage-performance-part-1/

http://www.nocoug.org/Journal/NoCOUG_Journal_201202.pdf

To summarize, you can expect ODA to deliver easily 3000 IOPS whether read or write with average IO response time up to 10ms and almost double that if you can afford average random IO response time to raise up to 20 ms.
We can also conclude that write activity has minimal impact on throughout as you would expect from a non-RAID5 system

ODA it’s configured to present disks as JBOD so that ASM is in charge of mirroring and striping.

why ODA use SSD for redo-logs

a very clever explanation http://www.pythian.com/news/33245/insiders-guide-to-oda-performance/

Another question during the webinar was how ODA storage differs from Exadata storage and why ODA can’t use storage cache.
If you was the webinar, you already know that ODA’s storage is simple and elegant. 20 SAS disks, 4 SSDs each with two ports, connected to the server nodes by two HBAs and two extenders per node. This is about as direct as shared storage can be. Which accounts in part for the performance we measured. No more misconfigured SAN switches. The catch is that because nothing is shared except the disks themselves, there is no place to locate a shared cache. Due to RAC, unshared cache (for example on the HBAs) can cause corruptions and cannot be used. This means that the storage system can easily get saturated, causing severe performance issues, especially for writes to redo logs. This is part of the reason the redo logs are located on SSD. We suggested additional methods to avoid saturating the disks in the webinar.

a filesystem based on a flash disk

In case you have a flash based pci express device in your system, probably it's better to create a filesystem witch 4k block size ( instead of the default 512 bytes for disk systems )

i)use parted post installation to make the partition and then type the following example (if your partition is called for instance /dev/sda2):
mkfs -t ext3 -b 4096 /dev/sda2

2012-11-05

io accelerator


HP 640GB IO Accelerator BK836A

 This storage device is targeted for markets & applications requiring high transaction rates and real-time data access that will benefit from application performance enhancement. The HP IO Accelerator brings high random I/O performance and low latency access to storage, with the reliability of solid state technology and its low power and cooling requirements. This product, based on NAND flash technology is available in a mezzanine card form factor for HP BladeSystem c-Class. 
As an I/O card, the IO Accelerator is not a typical SSD; rather it is attached directly to the server's PCI Express fabric to offer extremely low latency and high bandwidth. The card is also designed to offer high IOPs (I/O Operations Per Second) and nearly symmetric read/write performance. The IO Accelerator uses a dedicated PCI Express x4 link with nearly 1.3GB/s of usable bandwidth
The HP IO Accelerator's driver and firmware provide a block-storage interface to the operating system that can easily be used in the place of legacy disk storage. 
http://h20195.www2.hp.com/v2/GetPDF.aspx/c02010683.pdf


HP IO Accelerator Generation 1 devices include:
• AJ876A
• AJ877A
• AJ878A
• AJ878B
• BK836A
HP IO Accelerator Generation 2 devices include:
• QK761A
• QK762A
• QK763A


The Remote Power Cut Module provides a higher level of protection in the event of a catastrophic power loss (for example, a user accidentally pulls the wrong server blade out of the slot). The Remote Power Cut Module ensures in-flight  writes are completed to NAND flash in these catastrophic scenarios. Write performance will degrade without the remote power cut module. HP recommends attaching the remote power cut module for the AJ878B and BK836A SKUs.

IO and Read/Write Performance
HP IO Accelerator for BladeSystem c-Class offers superior IO performance (up to 530,000 IOPs), and high read (up to 1.5 GB/s) and write (up to 1.3 GB/s) performance with MLC models.
http://h18000.www1.hp.com/products/quickspecs/13220_na/13220_na.HTML
For AJ878B and BK836A Models
320GB640GB
NAND TypeMLC (Multi Level Cell)MLC (Multi Level Cell)
Read Bandwidth (64kB)735 MB/s750 MB/s
Write Bandwidth (64kB)510 MB/s550 MB/s
Read IOPS (512 Byte)100,00093,000
Write IOPS (512 Byte)141,000145,000
Mixed IOPS (75/25 r/w)67,00074,000
Access Latency (512 Byte)30 µs30 µs
Bus InterfacePCI-Express x4
For QK761A, QK762A and QK763A Models
365GB785GB1.2 TB
NAND TypeMLC (Multi Level Cell)MLC (Multi Level Cell)MLC (Multi Level Cell)
Read Bandwidth (1MB)900 MB/s1.5 GB/s1.5 GB/s
Write Bandwidth (1MB)575 MB/s1.1 GB/s1.3 GB/s
Read IOPS (Seq. 512 Byte)415,000443,000443,000
Write IOPS (Seq. 512 Byte)530,000530,000530,000
Read IOPS (Rand. 512 Byte)136,000141,000143,000
Write IOPS (Rand. 512 Byte)475,000475,000475,000
Read Access Latency68µs68µs68µs
Write Access Latency15µs15µs15µs
Bus InterfacePCI-Express Gen2 x4

RAM RequirementsThe HP IO Accelerator drivers use RAM for fast access to the storage metadata. The amount of RAM required is a fraction of the actual storage in use. It is important to ensure that the driver will have free RAM available as storage usage is increased. The amount of free RAM required by the driver is directly related to the size of the blocks used when writing to the drive. When smaller blocks are used, RAM usage increases. Here are the guidelines for memory needed based on the capacity of IO Accelerator and the Block Size of the write:Average

average block size 512 bytes --- > Minimum System RAM requirement for 640GB Mezz IO Accelerator ( 23 GB )

Hugepages are Not used by Database Buffer Cache if you have use_indirect_data_buffers=true

Hugepages are Not used by Database Buffer Cache [ID 829850.1]

why you should implement hugepages on linux


From metalink below

4.  Implement HugePages on Linux Environments

Applicable to Platforms:  ALL LINUX 64-Bit PLATFORMS

Why?:  Implementing HugePages greatly improves the performance of the kernel on Linux environments. This is especially true for systems with more memory. Generally speaking any system with more than 12GB of RAM is a good candidate for hugepages. The more RAM there is in the system, the more your system will benefit by having hugepages enabled. This is because the amount of work the kernel must do to map and maintain the page tables for this amount of memory increases with more memory in the system. Enabling hugepages greatly reduces the # of pages the kernel must manage, and makes the system much more efficient. If hugepages is NOT enabled, experience has shown that it is very common for the kernel to preempt the critical Oracle Clusterware or Real Application Clusters daemons, leading to instance evictions or node evictions.

2012-11-03

how to install oracle on violin memory array

a very good article http://flashdba.com/install-cookbooks/ol5u7-11-2-0-3-single-instance/

very well explained

2012-10-31

alternative to exadata

http://www.nyoug.org/Presentations/2012/June/Ault_Exadata.pdf

exadata versus violin memory array

http://regmedia.co.uk/2012/10/24/hp_violin_exadata_counter-deck.pdf

the new trend

http://www.dpie.com/datasheets/storage/violin/CIO_3200_whitepaper.pdf

HDDs spin continuously and large numbers are needed to meet the aggregate demand of enterprise applications where I/O is the typical bottleneck.  A typical high-end HDD supports 144GB of data, 300 IOPS  and consumes 20W of power.  Adding RAID protection overheads, over  1,000 drives and 20kW are required to support I/O rates of 220,000 IOPS  and transfers of 1 GByte/sec. Violin achieves this performance with just 20  flash memory modules (VIMMs) consuming less than 300W of power.

Violin resolves these bottlenecks by reducing latency from 5ms to 200 microseconds, a 25x improvement which significantly increases CPU  utilization. This dramatically lowers the need for server memory and CPUs while enabling more efficient virtualization and server consolidation..

PCIe flash cards are faster than SSDs, but are tied to individual servers.

Legacy storage systems featuring SSDs are designed to integrate flash  memory within existing HDD enclosures and use software-based RAID  controllers. This retrofitting approach results in (delivered) costs of  approximately $200 per GByte (RAID-1) and performance in the 10-30K  IOPS range with latency typically around 2ms or more. Violin Memory  Arrays, on the other hand, can easily integrate into the existing storage  network. Costs are now below $20 per GByte and price/performance  effectively increases by 500% or more.

2012-10-30

virus politia romana

http://forum.softpedia.com/topic/890694-virus-politia-romana/

how to have identity from sql server in oracle

http://nuijten.blogspot.ro/2012/10/oow-2012-little-things-make-me-happy.html

x int default s.nextval primary key
where s is a sequence


In sqlserver you would have

The following SQL statement defines the "P_Id" column to be an auto-increment primary key field in the "Persons" table:
CREATE TABLE Persons
(
P_Id int PRIMARY KEY IDENTITY,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255)
)

2012-10-25

ORA-20000: Statistics collection failed for all objects in schema

Bug 11808462 - dbms_stats raises ora-20000: statistics collection failed for all objects in database [ID 11808462.8]

2012-10-23

ASM after SAN upgrade

Alert: After SAN Firmware Upgrade, ASM Diskgroups ( Using ASMLIB) Cannot Be Mounted Due To ORA-15085: ASM disk "" has inconsistent sector size.  ID 1500460.1

2012-10-13

ntcontab.c

Installation of 11.2.0.3 : ntcontab.c:7:23: error: sys/types.h: No such file or directory. The package :glibc-headers already installed. Steps to identify and resolve the error. [ID 1404742.1]

4031 KGLH0

ORA-04031 Due To Excessive Growth In KGLH0 Heaps [ID 1351675.1]

2012-10-11

lant

“Când îi vezi cum zâmbesc fericiţi pentru că le-a mai crescut un pic salariul sau le-a mai scăzut un pic dobânda, te prefaci că nu le auzi zăngănitul lanţurilor de la picioare. Şi până la urmă, dacă lor li se pare că pot zburda cu bila de ocnaş legată de picior, cine eşti tu să le spui că nu vor fi liberi niciodată ?"

2012-09-25

1990-2012

"Nici un politician sau jurnalist de bun-simţ nu a reuşit să-i convingă vreodată cu adevărat pe votanţii nostalgiei comuniste că tocmai cei ce le promit întoarcerea la vremurile vopsite în roz de amintirea tinereţii lor îi mint şi îi buzunăresc fără jenă. Disperarea celor rătăciţi în tranziţie este prea mare şi nu poate fi risipită de cei ce le spun doar că trebuie să muncească mai mult şi mai bine pentru a se salva."

2012-09-20

2012-09-17

Libj9jit23.so

OUI Crash In Module Libj9jit23.so With IBM JDK/JRE 1.5 SR4 On AIX When Running On The New POWER7 Based Hardware [ID 1065579.1]

2012-09-14

Index inconsistency with interval partitions

Bug 10633840 - ORA-1502 on insert statement on INTERVAL partitioned table. ORA-8102 / ORA-1499 Index inconsistency [ID 10633840.8]
Can TIMESTAMP Data Type Be Used as an Interval Partitioning Key in Oracle 11g ? [ID 1433273.1]
How To Drop The Interval Partitions? [ID 1285036.1]
How To Introduce Interval Partitioning into a Range Partitioned Table [ID 854332.1]

how to partition by week a table

Interval Partitioning By Week [ID 757754.1]

2012-09-04

NotesSQL driver

http://stackoverflow.com/questions/4284197/lotus-notes-notessql-on-windows-2008-odbc-problem

NotesSQL is 32-bit only. 
If your Windows 7 is 64-bit, that's the problem.

NotesSQL is 32-bit. When you use Administrative Tools in 64-bit Windows to view ODBC drivers, it only shows the 64-bit drivers.

You need to run a separate program to view 32-bit ODBC drivers. 
You need to run the 32bit odbc client which is here:
C:\Windows\SysWOW64\odbcad32.exe

2012-08-31

error code 29506 while installing sql server management studio express

http://www.techrepublic.com/forum/questions/101-255598/error-29506-while-installing-sql-server-management-studio-express

Run a command prompt as an administrator and after that launch the .msi ( or exe ) file from there to install the management studio.

how to install ADT plugin offline

qdevarena.blogspot.com/2010/05/download-android-sdk-standalone-for.html

2012-08-30

use total recall instead of triggers


http://www.oracle.com/technetwork/database/storage/total-recall-whitepaper-171749.pdf

how to get file owner for a file in java

http://stackoverflow.com/questions/3096805/how-do-i-get-the-name-of-a-files-owner-in-java


That't not possible until Java 7. With Java 7 you could use Files#getOwner() for this.
Path path = Paths.get("/path/to/file.ext");
UserPrincipal owner = Files.getOwner(path);
String username = owner.getName();
Prior to Java 7 your best bet is running a command or JNI in combination with some platform native code. ( you could also use JANA library)

2012-08-29

Koksspac

Ora-07445: Exception Encountered: Core Dump [Koksspac()+352] [Sigsegv] [Addressnot Mapped To Object] [ID 1304534.1]

glassfish error message Interrupting idle Thread

GlassFish Server 3.x Log (server.log) Shows "Interrupting idle Thread" Messages [ID 1484459.1]

2012-08-28

2012-08-27

ORA-14039


Creation of Local Unique Partitioned Index Results in ORA-14039 [ID 209146.1]

how to automatically create partitions on a table


the following java program will help you to build the syntax for creating monthly partitions


package creare_automat_partitii_oracle;

/**
 *
 * @author
 *
 * rezultatul trebuie sa fie ceva de genul
 * ...
 * PARTITION P2012_11 VALUES LESS THAN (TO_DATE('01/12/2012', 'DD/MM/YYYY')) TABLESPACE EVAT04,
 * PARTITION P2012_12 VALUES LESS THAN (TO_DATE('01/01/2013', 'DD/MM/YYYY')) TABLESPACE EVAT04,
 * PARTITION P2013_12 VALUES LESS THAN (TO_DATE('01/01/2014', 'DD/MM/YYYY')) TABLESPACE EVAT04,
 * PARTITION PDEFAULT VALUES LESS THAN (MAXVALUE) TABLESPACE EVAT04 )
 *
 * Pentru indecsi, trebuie sa apara ceva de genul
 * CREATE INDEX invoices_idx ON invoices (invoice_date) LOCAL
 * (PARTITION invoices_q1 TABLESPACE users,
 *  PARTITION invoices_q2 TABLESPACE users,
 *  PARTITION invoices_q3 TABLESPACE users,
 *  PARTITION invoices_q4 TABLESPACE users);

 */
public class Creare_automat_partitii_oracle {

    static int iAn_start = 2004;
    static int iAn_final = 2014;
    static String sTablespace = "USERS"; // radacina cuvantului din numele tbs-urilor unde vor fi partitiile pe ani
    static String sCriteriu_partitionare = "create table .... (col1,col2...)  PARTITION BY RANGE (RUN_DATE)";
   
   

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       partitionare_dupa_luna();
    }
   
    public static void partitionare_dupa_luna() {
        StringBuilder sScript_index = new StringBuilder("create index ... on ....(...) LOCAL " + "(") ;
       
        System.out.println(sCriteriu_partitionare);
        System.out.println("(");


        for (int i_an = iAn_start; i_an <= iAn_final; i_an++) {
            for (int luna = 1; luna <= 12; luna++) {

                String sNume_partitie;
                StringBuilder sb = new StringBuilder();

                int iAn_urmator_la_range;
                String sLimita_superioara;

                //construiesc un string de tipul P2012_01
                sb.append("P");
                sb.append(i_an);
                sb.append("_");
                sb.append(String.format("%02d", luna)); //pt a formata corect la 2 zecimale luna .... P2012_01..P2012_02...P2012_12

                sNume_partitie = sb.toString();

                // treb sa afisez ceva de genul TO_DATE('01/02/2012', 'DD/MM/YYYY')
                String sLuna_urmatoare_la_range;

                //daca sunt in ultima luna a anului, atunci limita sup a partitiei e prima luna din anul urmator
                if (luna == 12) {
                    sLuna_urmatoare_la_range = "01";
                    iAn_urmator_la_range = i_an + 1; //i_an creste cu 1 , pentru ca e ultima luna din an iar limita sup e 01.01.anulurmator
                } else {
                    sLuna_urmatoare_la_range = "" + String.format("%02d", luna + 1); // limita lunii creste cu o unitate
                    iAn_urmator_la_range = i_an; //anul ramane neschimbat
                }

                sLimita_superioara = new String("(TO_DATE(\'01/" + sLuna_urmatoare_la_range + "/" + iAn_urmator_la_range + "\', \'DD/MM/YYYY\'))");

                //System.out.println(sNume_partitie + " --> " + sLimita_superioara);
                //numele tablespace-ului va contine si anul din care e partitia --> variabila i_an din primul for
                System.out.println(" PARTITION " + sNume_partitie + "  VALUES LESS THAN " + sLimita_superioara + " TABLESPACE " + sTablespace.concat("_" + i_an  ) + " ,");
               
                //construiesc si scriptul pentru partitionarea indecsilor
                sScript_index.append("\n" + "PARTITION " + sNume_partitie + " TABLESPACE " + sTablespace.concat("_" + i_an  ) + " ," );
            }
        }

        System.out.println(" PARTITION PDEFAULT VALUES LESS THAN  (MAXVALUE) TABLESPACE " + sTablespace);
        sScript_index.append("\n" + " PARTITION DEFAULT TABLESPACE " + sTablespace  + " ); ");

        System.out.println(");");
       
        System.out.println("");
        System.out.println("Scriptul pentru partitionarea indexului ");
        System.out.println(sScript_index);

    }
}