Thursday, 25 August 2016

How to increase the size of tablespace?

A tablespace can have multiple datafiles.

SQL> select tablespace_name,sum(bytes/1024/1024) from dba_data_files group by tablespace_name;

TABLESPACE_NAME                SUM(BYTES/1024/1024)
------------------------------                 --------------------
USERDATA                                         100
SYSAUX                                              200
UNDOTBS                                           100
SYSTEM                                               200

Here the system tablespace size is 200m if we want to increase the system tablespace size to 230m then?there are 2 ways 1)add datafile with size 30m   2)resize the system tablespace.


add the new datafile system1.dbf with size 30m.

SQL> alter tablespace system add datafile '/u01/app/oracle/system1.dbf' size 30m;

Tablespace altered.

SQL> select tablespace_name,sum(bytes/1024/1024) from dba_data_files group by tablespace_name;

TABLESPACE_NAME                SUM(BYTES/1024/1024)
------------------------------ --------------------
USERDATA                                        100
SYSAUX                                             200
UNDOTBS                                          100
SYSTEM                                             230

now the size of system tablespace is changed from 200 to 230mb.but before there is only one system datafile but now two datafiles for system tablespace.

SQL> select tablespace_name,file_name,bytes/1024/1024 from dba_data_files;

TABLESPACE_NAME                FILE_NAME                      BYTES/1024/1024
------------------------------ ------------------------------ ---------------
SYSTEM                         /u01/app/oracle/system.dbf                 200
SYSTEM                         /u01/app/oracle/system1.dbf                 30

2nd way is resizing the system tablespace datafile system.dbf from 200  to 230m.

SQL> alter database datafile '/u01/app/oracle/system.dbf' resize 230m;

Database altered.

SQL> select tablespace_name,file_name,bytes/1024/1024 from dba_data_files;

TABLESPACE_NAME                FILE_NAME                      BYTES/1024/1024
------------------------------ ------------------------------ ---------------
SYSTEM                         /u01/app/oracle/system.dbf                 230
SYSTEM                         /u01/app/oracle/system1.dbf                 30







How do i see the size of tablespace?

SQL> select tablespace_name,sum(bytes/1024/1024) from dba_data_files group by
           tablespace_name;

           TABLESPACE_NAME                           SUM(BYTES/1024/1024)
           ------------------------------                          --------------------
           USERDATA                                                       100
           SYSAUX                                                            200
           UNDOTBS                                                         100
           SYSTEM                                                             200

For finding the size of temp tablespace?

SQL> select tablespace_name,sum(bytes/1024/1024) from dba_temp_files group by tablespace_name;

TABLESPACE_NAME                                         SUM(BYTES/1024/1024)
------------------------------                                         -------------------
TEMPX                                                                          100


Temp tablespace will not show under dba_data_files.where it will show?

SQL> select tablespace_name,file_name from dba_data_files;

TABLESPACE_NAME                                                  FILE_NAME
------------------------------                                        ------------------------------
SYSTEM                                                            /u01/app/oracle/system.dbf
SYSAUX                                                            /u01/app/oracle/sysaux.dbf
UNDOTBS                                                        /u01/app/oracle/undotbs.dbf
USERDATA                                                      /u01/app/oracle/userdata.dbf

Temp tablespace will not show under dba_data_files it will show under dba_temp_files.

SQL> select TABLESPACE_NAME,FILE_NAME from dba_temp_files;

TABLESPACE_NAME                FILE_NAME
------------------------------ ------------------------------
TEMPX                          /u01/app/oracle/tempx.dbf


tablespace management in oracle 11g?

By default there are 5 tablespaces.we can create more and more tablespaces.

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS
TEMPX
USERDATA

If we want to know the status,contents,block_size of tablespaces?

SQL> select tablespace_name,status,contents,block_size from dba_tablespaces;

TABLESPACE_NAME                STATUS    CONTENTS              BLOCK_SIZE
------------------------------ --------- --------- ----------
SYSTEM                               ONLINE               PERMANENT                     8192
SYSAUX                               ONLINE               PERMANENT                     8192
UNDOTBS                            ONLINE               UNDO                                  8192
TEMPX                                 ONLINE               TEMPORARY                      8192
USERDATA                          ONLINE               PERMANENT                      8192

The default block size is 8k.system tablespace contains base tables.sysaux tablespace contains tables related to tools.

to check the datafiles for tablespaces?
SQL> select tablespace_name,file_name,file_id,bytes/1024/1024,autoextensible from dba_data_files;
TABLESPACE_NAME                FILE_NAME            FILE_ID BYTES/1024/1024    AUT
------------------------------ -------------------- ------- --------------- ---
SYSTEM                         /u01/app/oracle/syst      1                              200                                       NO
                                        em.dbf

SYSAUX                         /u01/app/oracle/sysa       2                             200                                      NO
                                        ux.dbf

UNDOTBS                        /u01/app/oracle/undo       3                          100                                    NO
                                        tbs.dbf

USERDATA                       /u01/app/oracle/user       4                           100                                     NO
                                        data.dbf





How to change the putty terminal background colour from black to white?


In the categories select Window--->Colours--->select use system colours(tick it) and click apply
now the putty background colour will change from black to white.

Tuesday, 23 August 2016

how to install vmware on windows 7?

In this video i installed the vmware 11 on my windows 7 laptop 64-bit.i also entered license key for vmware.plz watch this video.