Showing posts with label Oracle Database Administration. Show all posts
Showing posts with label Oracle Database Administration. Show all posts

TKPROF

TKPROF

Obtain the trace file. The below will give the location on the database server:

select name, value from v$diag_info where name like '%Trace%';
OR
select name, value from v$parameter where name like 'user_dump_dest'

2. Convert to TKPROF

tkprof <filename.trc> <output_filename_SORT.txt> explain=apps/<password> sort='(prsela,exeela,fchela)' 

Oracle Listener (LSNRCTL)

>> Display Oracle Listener Status

$ lsnrctl status

>> Start Oracle Listener
$ lsnrctl start

>> Stop Oracle Listener

$ lsnrctl stop

>> Restart Oracle Listener

$ lsnrctl reload

>> Available Listener Commands 

$ lsnrctl help
  • start - Start the Oracle listener
  • stop - Stop the Oracle listener
  • status - Display the current status of the Oracle listener
  • services - Retrieve the listener services information
  • version - Display the oracle listener version information
  • reload - This will reload the oracle listener SID and parameter files. This is equivalent to lsnrctl stop and lsnrctl start.
  • save_config – This will save the current settings to the listener.ora file and also take a backup of the listener.ora file before overwriting it. If there are no changes, it will display the message “No changes to save for LISTENER”
  • trace - Enable the tracing at the listener level. The available options are ‘trace OFF’, ‘trace USER’, ‘trace ADMIN’ or ‘trace SUPPORT’
  • spawn - Spawns a new with the program with the spawn_alias mentioned in the listener.ora file
  • change_password – Set the new password to the oracle listener (or) change the existing listener password.
  • show - Display log files and other relevant listener information.

>> Help menu for specific listener command
$ lsnrctl help show

lsnrctl: error while loading shared libraries: /u01/Oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied

lsnrctl: error while loading shared libraries: /u01/Oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied

When starting listener got error :-
[oracle@otm bin]$ lsnrctl
lsnrctl: error while loading shared libraries: /u01/Oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied

Solution :-
The sestatus command provides a configurable view into the status of SELinux.

You can use the command getenforce to see the current mode of SELinux. To disable SELinux temporarily you can use the command setenforce Permissive. In permissive mode the denials will still occur and will be logged but the operations will not be blocked. Permissive mode is the recommend mode by Oracle Support.

For permanent change

[root@otm ]# cd /etc
[root@otm ]# ls -alh grub.conf
lrwxrwxrwx 1 root root 22 Aug 25 16:25 grub.conf -> ../boot/grub/grub.conf
[root@otm etc]# cp grub.conf grub.conf_ORG
[root@otm etc]# ll grub*
lrwxrwxrwx 1 root root 22 Aug 25 16:25 grub.conf -> ../boot/grub/grub.conf
-rw------- 1 root root 865 Aug 25 17:04 grub.conf_ORG

vi grub.conf


To change from enforcing to permissive we will add enforcing=0 to end of the line beginning with kernel.
Example