The next time if your manager asks you how big is our Oracle database size? Do this...
An oracle database consists of data files, redo log files, control files, temporary files. Whenever you say the size of the database this actually means the summation of these files.
The biggest portion of a database's size comes from the datafiles. To find out how many megabytes are allocated to ALL datafiles:
SQL> select sum(bytes)/1024/1024 "Meg" from dba_data_files;
To get the size of all TEMP files:
SQL> select nvl(sum(bytes),0)/1024/1024 "Meg" from dba_temp_files;
To get the size of the on-line redo-logs:
SQL> select sum(bytes)/1024/1024 "Meg" from sys.v_$log;
To get the size of the control files use,
SQL> select sum(BLOCK_SIZE*FILE_SIZE_BLKS/1024/1024) "MEG" from v$controlfile;
So to get the total size of the database just sum these.
SQL> select a.data_size+b.temp_size+c.redo_size+d.controlfile_size "total_size in MB"
from ( select sum(bytes)/1024/1024 data_size
from dba_data_files ) a,
( select nvl(sum(bytes),0)/1024/1024 temp_size
from dba_temp_files ) b,
( select sum(bytes)/1024/1024 redo_size
from sys.v_$log ) c,
( select sum(BLOCK_SIZE*FILE_SIZE_BLKS)/1024/1024 controlfile_size
from v$controlfile) d;
Subscribe to:
Post Comments (Atom)
APACHE - failed to start
[On] Red Hat Enterprise Linux Server release 7.4 (Maipo) Apache was not running and attempt to start the httpd service failed. The natural t...
-
[Tested On] CentOS Linux release 7.4.1708 (Core) # wget https://ftp.postgresql.org/pub/source/v9.6.6/postgresql-9.6.6.tar.gz # tar xvzf post...
-
Your new IT project requires you to setup postgresql database and most of the time we get to the postgresql website and download the version...
-
# openssl s_client -connect localhost:443
No comments:
Post a Comment