Posts

Showing posts from November, 2016

Is it safe to move/recreate alertlog while the database is up and running

 Is it safe to move/recreate alertlog while the database is up and running?? It is totally safe to "mv" or rename it while we are running. Since chopping part of it out would be lengthly process, there is a good chance we would write to it while you are editing it so I would not advise trying to "chop" part off -- just mv the whole thing and we'll start anew in another file. If you want to keep the last N lines "online", after you mv the file, tail the last 100 lines to "alert_also.log" or something before you archive off the rest. [oracle@Linux03 trace]$ ls -ll alert_* -rw-r-----. 1 oracle oracle    488012 Nov 14 10:23 alert_orcl.log I will rename the existing alertlog file to something   [oracle@Linux03 trace]$ mv alert_orcl.log alert_orcl_Pre_14Nov2016.log [oracle@Linux03 trace]$ ls -ll alert_* -rw-r-----. 1 oracle oracle 488012 Nov 14 15:42 alert_orcl_Pre_14Nov2016.log [oracle@Linux03 trace]$ ls -ll alert_* Now lets create some activity ...

Directory permissions granted to a user in database

Querying directory permissions granted to a user SELECT grantee, table_name directory_name, LISTAGG(privilege, ',') WITHIN GROUP (ORDER BY grantee)   FROM dba_tab_privs  WHERE table_name =' DPUMP' group by GRANTEE,TABLE_NAME; SAMPLE output: GRANTEE              DIRECTORY_NAME                 GRANTS             -------------------- ------------------------------ -------------------- SCOTT                  DPUMP                       READ,WRITE          TIGER              ...

Failed to auto-stop Oracle Net Listener using ORACLE_HOME/bin/tnslsnr

Usage : we can use dbshut script file in $ORACLE_HOME/bin to shutdown  database & listener.  [oracle@Linux03 bin]$ ps -ef|grep pmon oracle   20693     1  0 10:57 ?        00:00:00 ora_pmon_ orcl oracle   21133 19211  0 11:01 pts/0    00:00:00 grep pmon [oracle@Linux03 bin]$ dbshut Processing Database instance "orcl": log file /u01/app/oracle/product/12.1.0.2/db_1/shutdown.log [oracle@Linux03 bin]$ ps -ef|grep pmon oracle   21287 19211  0 11:09 pts/0    00:00:00 grep pmon [oracle@Linux03 bin]$ Error : Failed to auto-stop Oracle Net Listener using ORACLE_HOME/bin/tnslsnr [oracle@Linux03 bin]$ dbshut Failed to auto-stop Oracle Net Listener using ORACLE_HOME/bin/tnslsnr  Solution (same as above): edit dbshut script and change From : ORACLE_HOME_LISTNER=$1   To : ORACLE_HOME_LISTNER=$ORACLE_HOME Note :   One pre-req for this script...

dbstart: line 275: ORACLE_HOME_LISTNER: command not found

Usage : we can use dbstart script file in $ORACLE_HOME/bin to start database & listener. [oracle@Linux03 bin]$ ps -ef|grep pmon oracle   20588 19211  0 10:56 pts/0    00:00:00 grep pmon [oracle@Linux03 bin]$ dbstart Processing Database instance "orcl": log file /u01/app/oracle/product/12.1.0.2/db_1/startup.log [oracle@Linux03 bin]$ ps -ef|grep pmon oracle   20693     1  0 10:57 ?        00:00:00 ora_pmon_orcl oracle   21035 19211  0 10:57 pts/0    00:00:00 grep pmon [oracle@Linux03 bin]$  Common error with dbstart script : Error : /u01/app/oracle/product/12.1.0.2/db_1/bin/dbstart: line 275: ORACLE_HOME_LISTNER: command not found [oracle@Linux03 bin]$ dbstart /u01/app/oracle/product/12.1.0.2/db_1/bin/dbstart: line 275: ORACLE_HOME_LISTNER: command not found Solution : Edit dbstart script and change (~ line 275) From : ORACLE_HOME_LISTNER=$1 To...