
Query to find the space used by a table in Oracle
Query to find the space used by a table SELECT DS.TABLESPACE_NAME , SEGMENT_NAME , ROUND(SUM(DS.BYTES) / (1024 \ * …
bashrc is the best place to add aliases and Bash related functions. The Bash shell looks for the . bashrc file in the home directory and executes it in the current shell using source.
Certain Linux machines won’t have ORACLE profile set globally for all users, So if you need to invoke oracle command line commands like tnsping from command line without navigating to ORACLE installation directory then you have to do the following.
Go to your home directory and update “.bashrc_profile” to add the following
# oracle profile
if [ -f $HOME/.oracle ] ; then
. $HOME/.oracle
fi
Go to your home directory and add a new file “.oracle” with below contents, The ORACLE_HOME will change based on your oracle installation directory and oracle version
# oracle home path
export ORACLE_HOME=/opt/oracle/client/product/12.1.0/64bit_client
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
CLASSPATH=.:$ORACLE_HOME/jdbc/lib/classes12.zip:$ORACLE_HOME/jdbc/lib/nls_charset12.zip
export CLASSPATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH
Query to find the space used by a table SELECT DS.TABLESPACE_NAME , SEGMENT_NAME , ROUND(SUM(DS.BYTES) / (1024 \ * …
Query to find database uptime SELECT host_name , instance_name , TO_CHAR(startup_time, 'DD-MM-YYYY HH24:MI:SS') …