Showing posts with label RHEL. Show all posts
Showing posts with label RHEL. 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)' 

Delete large number of files - LINUX

Delete large number of files - LINUX

Go to the folder location

cd < folder name>

A faster way of deleting files is the -delete flag:
find . -type f -delete
To show the filenames while deleting them:
find . -type f -print -delete
To show how many files will be deleted, then time how long it takes to delete them:
ls -1 | wc -l && time find . -type f -delete
 The above commands will remove all the files in the folder, then you can use rm -rf to remove the folder.

Linux Files


Linux Files

Path
Description

/etc/passwd - User Settings

/etc/group - Group settings for users.

/etc/hosts -  Host name lookup information

/etc/sysctl.conf  - Kernel parameters for Linux.

/var/log/messages  - Check System and error logs and messages

/etc/oratab  - Oracle Registered instance (DBCA)

/etc/fstab  - Files to check for File System entries

/home/oracle/.bash_profile  - Oracle user profile setting file in Linux.

/proc/meminfo  - To determine To determine the RAM size

/etc/redhat- release - get the OS release information

/etc/security/limits.conf  - Specify process and open files related limits

/etc/selinux/config  - Enable or disable security feature.

How to get out of the Linux Filesystem repair prompt after repairing the filesystem?

How to get out of the Linux Filesystem repair prompt after repairing the filesystem?

"shows me repair file system in red color"


This is the key: the filesystem is corrupted, probably due to an unclean shutdown. It needs to be repaired. Try entering the root password, which should give you a '#' prompt.
 

Type:
fsck -A -y

That will take a while and print out something about what it's fixing.
 

Once that has completed, type "exit".
You may need to restart the system again.

Linux: How to monitor the nproc limit

Linux: How to monitor the nproc limit

You probably know about 'nproc' limits in Linux which are set in /etc/limits.conf and checked with 'ulimit -u'. But do you know how to handle the monitoring and be alerted when you're close the fixed limit?

Nproc and ps
Nproc is defined at OS level to limit the number of processes per user. Oracle 11.2.0.4 documentation recommends the following:

oracle soft nproc 2047
oracle hard nproc 16384
 

But that is often too low, especially when you have the Enterprise Manager agent or other java programs running.

Do you want to check that you are far from the limit? then you can use 'ps'. But beware, 'ps' by default does not show all processes.
 

In Linux, when doing multithreading, each thread is implemented as a light-weight process (LWP). And you must use the '-L' to see all of them.

Let's take an example. I have a system where 'ps -u oracle' returns 243 lines. But including LWPs shows a lot more processes which is near the limit:

$ ps h -Led -o user | sort | uniq -c | sort -n
      1 dbus
      1 ntp
      1 rpc
      1 rpcuser
      2 avahi
      2 haldaemon
      2 postfix
    166 grid
    400 root
   1370 oracle
 

So the 'oracle' user has 1370 processes. That's high. And this is the actual number where the nproc limit applies.

'ps -Lf' can show the detail. And even without '-L' we can display the NLWP which is the number of threads per process:

ps -o nlwp,pid,lwp,args -u oracle | sort -n
NLWP   PID   LWP COMMAND
   1  8444  8444 oracleOPRODP3 (LOCAL=NO)
   1  9397  9397 oracleOPRODP3 (LOCAL=NO)
   1  9542  9542 oracleOPRODP3 (LOCAL=NO)
   1  9803  9803 /u00/app/oracle/product/agent12c/core/12.1.0.3.0/perl/bin/perl /u00/app/oracle/product/agent12c/core/12.1.0.3.0/bin/emwd.pl agent /u00/app/oracle/product/agent12c/agent_inst/sysman/log/emagent.nohup
  19 11966 11966 /u00/app/11.2.0/grid/bin/oraagent.bin
1114  9963  9963 /u00/app/oracle/product/agent12c/core/12.1.0.3.0/jdk/bin/java ... emagentSDK.jar oracle.sysman.gcagent.tmmain.TMMain
 

The Oracle 12c EM agent has started 1114 threads and the grid infrastructure 'oraagent.bin' has 19 threads. In addition to that I've a lot of other monothreaded processes. This is how we reach 1370 which is the exact value to compare to the nproc limit.

So what are the good values to set? About the high number of threads for EM agent 12c, there are a few bugs. And I suspect that 1000 threads is too much, especially when checking them with 'jstack' I see that they are "CRSeOns" threads that should not be used in 11.2.0.2 and higher. But that's another problem which I'm currently investigating. When you reach the nproc limit, the user will not be able to create new processes. clone() calls will return EAGAIN and that is reported by Oracle as:

ORA-27300: OS system dependent operation:fork failed with status: 11
ORA-27301: OS failure message: Resource temporarily unavailable
And that is clearly bad when it concerns an +ASM instance or archiver processes.

The goal of the nproc limit is only to prevent 'fork bombs' where a process forks forever and exhausts all resources. So there is no problem to increase this limit. However if you set it high for some users ('oracle' and 'grid' usually), it can be a good idea to monitor the number of processes with the ps h -L above. Because having too many processes is suspect and increasing the limit just hides a process leak and defer the failure.

In 'ps h -L -o' The argument 'h' is there to remove the header line, and '-L' to show all processes including LWP. Then you can count with 'wc -l'.

The proof
In order to be sure that 'ps h -L' gives the exact number, I have tested it. In case you want to check this on your system, here is how to do it. And please report any difference.

First, set your limit to 1024 processes. This is a limit for my user, and the limit is set for my shell and all its child processes:

[oracle@VM211 ocm]$ ulimit -u 1024
Now you can check it:

[oracle@VM211 ocm]$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 15919
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes (-u) 1024
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

[root@VM211 ocm]# ps h -Lu oracle | wc -l
1023
 

Recommended values for Oracle
Currently this is what is set on Oracle linux 6 for 11gR2 by the preinstall package (in /etc/security/limits.conf):

oracle   soft   nproc    16384
oracle   hard   nproc    16384


For 12c, these are set in /etc/security/limits.d/oracle-rdbms-server-12cR1-preinstall.conf which overrides /etc/security/limits.conf:

oracle soft nproc 16384
oracle hard nproc 16384
And just for your information, here is what is set in the ODA X4-2:

oracle soft nproc 131072


So what do you want to set? You probably don't want it too low and experience 'resource temporarily unavailable'. But what you don't want either is 100000 processes on your server. So my recommendation is to set it high but monitor it when the number of processes reaches something that is not sensible. Then you prevent having the system down in case of process leak, but you can detect it and ask for a patch.


Special thanks to Mr. Franck Pachot for such easy illustration.
Regards
Shahzad

Master Note For Oracle Database Server Installation (Doc ID 1156586.1)

Master Note For Oracle Database Server Installation (Doc ID 1156586.1)
-------------------------------------------------------------------------------------------
Applies to:
Oracle Server - Enterprise Edition - Version: 8.1.7.0 to 11.2.0.2.0 - Release: 8.1.7 to 11.2
Information in this document applies to any platform.

Purpose
This Master Note is intended to provide an index and references to the most frequently used My Oracle Support Notes with respect to Oracle Database Installation.This Master Note is subdivided into categories to allow for easy access and reference to notes that are applicable to your area of interest, within INSTALLATION.This includes the following categories:

* Certification

* Installation Guides

* OS Requirements

* Scripts

* Silent Install

* Diagnostic Tools

* Known Issues

* General Information

* Using My Oracle Support Effectively

* Generic Link



Scope and Application
This note guides you through the process of Oracle Database Installation.

This note applies to the following versions of these products:

Oracle Server - Enterprise Edition - Version: 8.1.7.1 to 8.1.7.x
Oracle Server - Enterprise Edition - Version: 9.0.1.1 to 9.0.1.x
Oracle Server - Enterprise Edition - Version: 9.2.0.1 to 9.2.0.x
Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 10.2.0.x
Oracle Server - Enterprise Edition - Version: 11.1.0.6 to 11.1.0.x
Oracle Server - Enterprise Edition - Version: 11.2.0.1 to 11.2.0.x



Master Note For Oracle Database Server Installation
Certification
For the latest Database Certification always refer to My Oracle Support (MOS) Certify section.

At the same time the documentation listed below help you in understanding the Oracle Database Certification:

Note.415166.1 Oracle Database Client Certification Notes 10g Release 2 (10.2.0.3) for Microsoft Windows Vista
Note.161818.1 Oracle Database (RDBMS) Releases Support Status Summary
Note.207303.1 Client / Server / Interoperability Support Between Different Oracle Versions
Note.77627.1 Oracle Database Server product support Matrix for Windows 2000
Note.266043.1 Support of Linux and Oracle Products on Linux
Note.464754.1 Certified Software on Oracle VM
Note.753601.1 SUPPORT FOR ORACLE DATABASE ON WPARS UNDER AIX 6.1

Installation Guides
Oracle Database documentation, 11g Release 2 (11.2).
Installation manuals and platform-specific books are included in this link.

Oracle Database documentation, 11g Release 1 (11.1).
Installation manuals and platform-specific books are included in this link.

Oracle Database documentation, 10g Release 2 (10.2).
Installation manuals and platform-specific books are included in this link.

Oracle Database documentation, 10g Release 1 (10.1).
Installation manuals and platform-specific books are included in this link.

Oracle9i documentation, Release 2 (9.2).
Oracle9i documentation, Release 1 (9.0.1).
Installation manuals and platform-specific books are included in this search, for 9.2 only.

OS Requirements
Most of the installation and relinking issues appear if you don't satisfy the minimum requirements for the installation. Therefore if you are raising any SR for installation issue it is better to ensure that you have all these requirements mentioned in the below articles before raising the SR.

The documentation listed below help you in understanding the OS Requirements for Oracle Database Installation:
Generic
Note.169706.1 Oracle Database on Unix AIX,HP-UX,Linux,Mac OS X,Solaris,Tru64 Unix Operating Systems Installation and Configuration Requirements Quick Reference (8.0.5 to 11.2)
Note.268025.1 Server Installation - Unix Knowledge Browser Product Page
Note.750540.1 What are the requirements for an Oracle Home Name in the Inventory?
Note.389678.1 Are Compilers Necessary for Oracle RDBMS Installation?

Linux
Note.376183.1 Defining a "default RPMs" installation of the RHEL OS
Note.851598.1 Master Note of Linux OS Requirements for Database Server
Note.761261.1 Recommended metalink articles for Oracle Database 10gR2 installation on zLinux (s390x)
Note.415182.1 DB Install Requirements Quick Reference - zSeries based Linux
Note.341507.1 Oracle Database Server on Linux on IBM POWER

AIX
Note.889464.1 Is Oracle 10g And 11g Database Compatible With AIX Version 6.1
Note.859856.1 Oracle 10g R2 database server software for AIX 6.1
Note.417451.1 How To Determine Whether an APAR has been Fixed in AIX Version/Maintenance Level
Note.201019.1 AIX Quick Start Guide - 9.2.0 RDBMS Installation
Note.182037.1 AIX Quick Start Guide - 9.0.1 RDBMS Installation
Note.109843.1 AIX Quick Start Guide - 8.1.X RDBMS Installation
Note.109842.1 AIX Quick Start Guide - 8.0.X RDBMS Installation

Solaris
Note.201021.1 SOLARIS Quick Start Guide - 9.2.0 RDBMS Installation
Note.148673.1 SOLARIS Quick Start Guide - 9.0.x RDBMS Installation
Note.108413.1 SOLARIS Quick Start Guide - 8.0.X RDBMS Installation
Note.108306.1 SOLARIS Quick Start Guide - 8.1.X RDBMS Installation
Note.743042.1 Requirements for Installing Oracle 11gR1 RDBMS on Solaris 10 SPARC 64-bit
Note 971464.1 FAQ - 11gR2 requires Solaris 10 update 6 or greater

HP-UX
Note.201023.1 HP-UX Quick Start Guide - 9.2.0 RDBMS Installation
Note.154360.1 HP-UX Quick Start Guide - 9.0.x RDBMS Installation
Note.108387.1 HP-UX Quick Start Guide - 8.1.X RDBMS Installation
Note.108381.1 HP-UX Quick Start Guide - 8.0.X RDBMS Installation

Scripts
Note.296665.1 Pre-Install checks for 10gR1 RDBMS (10.1.x) - Linux AMD64/EM64T Platforms
Note.283749.1 Pre-Install checks for 10gR1 RDBMS (10.1.x) - Linux Itanium 64 (IA64) Platforms
Note.283748.1 Pre-Install checks for 10gR1 RDBMS (10.1.x) - Linux x86 Platforms
Note.189256.1 UNIX Script to Verify Installation Requirements for Oracle 8.0.5 to 9.2 versions of RDBMS

Silent Install
Note.136660.1 Working Response files for a silent install of Oracle Server on MS-Windows- Part 1 of 3
Note.136661.1 Database Configuration Response file for performing silent install - Part 2 of 3
Note 136662.1 Network Configuration Reponse file for performing silent install - Part 3 of 3
Note 388451.1 How to create a Response File for Silent Installation?
Note 885643.1 How to install 11gR2 Database/Client Software in Silent mode without using response file
Note 808275.1 How to install Oracle Database Patchset software in Silent mode without using response file
Note 782919.1 How to install Oracle Database Server software silently with customized listener configuration
Note 782918.1 How to install/deinstall Oracle Database Server software silently without response file
Note 435680.1 Response File Installation of Database Server 10.2 (Suppressed or Silent mode)
Note 434803.1 Silent Installation for Oracle Server 10.1
Note 434315.1 How Can You Install Oracle Without Using The Oracle Universal Installer( runInstaller) GUI and Xserver especially When Doing A Remote Installation ?
Note 405124.1 How to Prevent a Silent Install from Prompting for User Input to Run the 'root.sh' Script
Note 228916.1 How to Troubleshoot a Silent Installation

Diagnostic Tools
Note.181459.1 How To Troubleshoot an Oracle Database Software Installation on UNIX
Note.780551.1 How To Diagnose Linking Errors During Base Install of Oracle RDBMS
Note.757964.1 Oracle Universal Installer ( OUI ) Error Messages and Solution Reference List

Known Issues
Note.833732.1 How To quick Deal with Relink, make, Failed on Linux ? Errors bin/sh /usr/bin/cc cannot execute binary file. or undefined reference to `dl_iterate_phdr@GLIBC_x.x.y'.
Note.848700.1 11gR1 on Solaris failing at relink phase with errors like "ld fatal relocation error" and then "ld fatal library -lclntsh not found"

Note.820135.1 What Does -ignoreSysPrereqs Ignore When Invoking runInstaller?
Note.867562.1 11gR1 OUI Error "fatal libCrun.so.1 open failed No such file or directory"
Note.852241.1 Installation of 11G fails on relink with INFO ld fatal library -lumem not found
Note.849336.1 Unable to launch OUI
Note.832074.1 AIX 6.1 "Dependent module /usr/lib/libXpm.a(shr_64.o) could not be loaded" Error Attempting To Execute 11.1.0 runInstaller

Note.1083353.1 11gR2 Pre-requirement APAR's check fail for AIX 6.1
Note.879102.1 Stand Alone 11.1.0.6 Silent Installation on AIX 5.3 Fails On Prerequisite Check For rsct.basic.rte(0.0) and rsct.compat.clients.rte(0.0)
NOTE:966929.1 - 11gR2 INSTALL ERRORS on Solaris 10
NOTE:989727.1 - 11GR2 INSTALL ON SOLARIS FAILS MANY PREREQUISITE CHECKS

General Information
Note.168607.1 Oracle Server Installation FAQ
Note.787705.1 How to identify correct Oracle Database software to install on Linux platform
Note.317257.1 Running Oracle Database in Solaris 10 Containers - Best Practices
Note.131321.1 How to Relink Oracle Database Software on UNIX
Note.738771.1 How to Log Good Service Request for Relink issues?
Note.458893.1 Oracle Universal Installer (OUI) FAQ
Note.736819.1 How to Log Good Service Request for Oracle Universal Installer (OUI) issues?
Note.429074.1 Can You Run Different Releases Of The Oracle Database On The Same Computer At The Same Time?

Using My Oracle Support Effectively
Note 374370.1 New Customers Start Here
Note 747242.5 My Oracle Support Configuration Management FAQ
Note 868955.1 My Oracle Support Health Checks Catalog
Note 166650.1 Working Effectively With Global Customer Support
Note 199389.1 Escalating Service Requests with Oracle Support Services

Generic Links
Note 854428.1 Patch Set Updates for Oracle Products
Note 1061295.1 Patch Set Updates - One-off Patch Conflict Resolution
Note 268895.1 Oracle Database Server Patchset Information, Versions: 8.1. 7 to 11.2.0
Note 161549.1 Oracle Database Server and Networking Patches for Microsoft Platforms
Note 161818.1 Oracle Database (RDBMS) Releases Support Status Summary
Information on Critical Patch Updates (CPU's)
About Oracle
Oracle Corporation, an enterprise software company, engages in the development, manufacture, distribution, servicing, and marketing of database, middleware, and application software worldwide.
The company was founded in 1977 and is headquartered in Redwood City, California.

Find files in Unix

Find files in Unix

> FIND FILES THAT WERE MODIFIED/ACCESSED WITHIN A SPECIFIED TIME
            $   find  /<your path>  -mtime   1  -type   f
This command would return files modified  in the last 24 hours .
You can use -mtime option to return a list of files that were last modified N*24 hours ago. For example to find a file in last month (30 days) you would need to use -mtime +30 options.

-mtime +30   means you are looking for a file modified 30 days ago.
-mtime -30    means less than 30 days.
-mtime 30      If you skip + or – it means exactly 30 days
      -type f      searches only for files and not directories
 

To list the files in the directory tree that were modified within the past five minutes, type
$  find /<your path>  -mmin -5
 

To return a list of files that were accessed in the last 24 hours you would need to use the–atime option.
$  find  /<your path>   -atime   1  -type   f  


> FINDING FILES WITH A SPECIFIC EXTENTION WITHIN A DIRECTORY
         $  find   /<your path>   -name  “*.cfg”
The command –name matches the file names with the specified pattern
 


> FINDING FILES BASED ON THE FILE-PERMISSIONS
Files with execute permission for group :
$ find /<your path>  -perm g=x   -type f
Files with execute permission for others:
$ find /<your path>  -perm  o=x   -type f
Where ‘g’ denotes groups and ‘o’ denotes others. x denotes execute permission.

To Check number of CPU’s in the Server

To Check number of CPU’s in the Server

Linux

cat /proc/cpuinfo | grep “processor”|wc –l
HP-UX
ioscan -C processor | grep processor | wc –l
SUN Solaris
psrinfo -v|grep “Status of processor”|wc –l
AIX
lsdev -C|grep Process|wc –l
To identify High Disk I/o using Unix command
/usr/bin/ps -eo pid,user,pcpu,args | grep -v %CPU |  sort -nbk 3 | tail -25

To report the current CPU Activity

sar -u 1 5

sar utility can be used to provide various information about the server resources.

In the above example the parameters used and the details are as mentioned below
-u option is for CPU related information
1 is the frequency of execution of the command in seconds
5 is the number of times the command should be executed.
So the command displays the CPU information every 1 second for 5 times.

It reports the CPU related usage by the user(%usr), system(%sys), the CPU Wait for I/O(%wio) and the Idle Percentage(%idle).

Sample Output

14:08:17    %usr    %sys    %wio   %idle   physc
14:08:18      25        0          0           75       4.00
14:08:19      25        0          0           74       4.00
14:08:20      25        0          0           75       4.00
14:08:21      25        0          0           75       4.00
14:08:22      25        0          0           75       4.03
Average       25        0          0           75       4.01

Crontab example


 Crontab example

Copying file in same server

==========


* * * * * <command> #Runs every minute
30 * * * * <command> #Runs at 30 minutes past the hour
45 6 * * * <command> #Runs at 6:45 am every day
45 18 * * * <command> #Runs at 6:45 pm every day
00 1 * * 0 <command> #Runs at 1:00 am every Sunday
00 1 * * 7 <command> #Runs at 1:00 am every Sunday
00 1 * * Sun <command> #Runs at 1:00 am every Sunday
30 8 1 * * <command> #Runs at 8:30 am on the first day of every month
00 0-23/2 02 07 * <command> #Runs every other hour on the 2nd of July

==========
CREATE :-

testCron.txt

ENTRY :-

*/1 * * * * scp -rp /Oracle/CRONTAB_TEST/TEST/PRIM/* /Oracle/CRONTAB_TEST/TEST/SEC/

SUBMIT :-

crontab testCron.txt

EDIT :-

crontab -e

REMOVE :-

crontab -r



Change DATE TIME Linux

Change DATE TIME Linux
Check date
$ date



Change Date
date -s "2 OCT 2006 18:00:00"


=========================

Printer url linux Oracle

Printer url linux Oracle

http://localhost.localdomain:631/

===============================

Troubleshooting ORA-27300 ORA-27301 ORA-27302 Errors



Troubleshooting ORA-27300 ORA-27301 ORA-27302 Errors

NOTE:848387.1 - With NUMA Enabled, Database Fails To Open With ORA-600[ksbmoveme4], ORA-27300, ORA-27301, ORA-27302 Errors Reported
NOTE:300956.1 - Ora-27302: sskgxpsnd1 - Starting Instance
NOTE:314179.1 - Instance Startup Fails With Error ORA-27154,ORA-27300,ORA-27301,ORA-27302
NOTE:3411021.8 - Bug 3411021 - Oracle process may die due to ORA-27300/ORA-27301/ORA-27302 at skgxppost1
NOTE:746888.1 - ORA-27302: Failure Occurred at: skgxpvfymmtu Signalled in the Alert.log
BUG:7620133 - HIGH NUMBER OF DBW* PROCESSES SPAWNED IN 11.1.0.7
NOTE:458442.1 - 10.2.0.3 PMON Crashes on Startup on AIX 5L 5.3 ML05 -- Works on ML06
NOTE:277399.1 - DBMS_SCHEDULER Fails To Execute Jobs With Program_type EXECUTABLE On HP-UX
NOTE:392006.1 - Ora-27300 OS system dependent operation:fork failed with status: 11
NOTE:295832.1 - Unable To Create Database Ora-00603, ORA-27300
NOTE:1252265.1 - ORA-27300 ORA-27301 ORA-27302: failure occurred at: skgpalive1
NOTE:438205.1 - ORA-27300 ORA-27301 ORA-27302 ORA-27157 Database Crash
NOTE:453959.1 - Cannot Connect As "/ as sysdba" ORA-27140 ORA-27300 ORA-27301 ORA-27302 And ORA-27303 In Trace File
NOTE:356640.1 - ORA-27300, ORA-27301, ORA-27302: Failure Occurred At: Skgpalive1 During 'Shutdown'
NOTE:465002.1 - Database Crash With Error ORA-00490
NOTE:466370.1 - ORA-7445 [ACCESS_VIOLATION] [unable_to_trans_pc] [UNABLE_TO_WRITE] ORA-27301: OS failure message: Not enough storage ORA-27300 ORA-27302
NOTE:225349.1 - Implementing Address Windowing Extensions (AWE) or VLM on 32-bit Windows Platforms
NOTE:371074.1 - ORA-27300 ORA-27301 ORA-27302 in alert log. Cannot connect to database.
BUG:7232946 - ORA-600[KSKRECONFIGNUMA2] CAUSES INSTANCE CRASH
NOTE:580552.1 - Database Crashes With ORA-04030 ORA-07445 ORA-27300 ORA-27301 ORA-27302
NOTE:557153.1 - ORA-27370 ORA-27301 (Permission denied) When Running Job Of Type EXECUTABLE
BUG:3411021 - LMD PROCESS CRASH DUE TO ORA-27300/ORA-27301/ORA-27302 AT SKGXPPOST1
NOTE:560309.1 - Database Cannot Start Due to Lack of Memory
BUG:6991131 - ORA-27300, ORA-27301 AND ORA-27302 HAPPENED DURING SHUTDOWN USING SRVCTL
NOTE:364353.1 - ORA-00603 ORA-27504 ORA-27300 ORA-27504 in the Alert Log
NOTE:1274030.1 - Startup Instance Failed with ORA-27140 ORA-27300 ORA-27301 ORA-27302 and ORA-27303 on skgpwinit6
NOTE:949468.1 - Database Startup Fails with ORA-27300: OS system dependent operation:semget failed with status: 28
NOTE:6629265.8 - Bug 6629265 - Intermittent ORA-27504 / ORA-27300 ioctl error 11
BUG:9059053 - ORA-00603 ORA-27504 ORA-27300 ORA-27301 ORA-27302 IN ALERT.LOG
NOTE:1038058.6 - LIST OF UNIX ERRORS AND EXPLANATIONS
NOTE:297498.1 - Resolving Instance Evictions on Windows Platforms
BUG:10010310 - ORA-27300: INVALID_PROCESS_ID FAILED WITH STATUS: 0; ORA-27302: SKGPALIVE1
NOTE:6441119.8 - Bug 6441119 - Instance crash due to ORA-27300 / ORA-27152

Empty the linux buffer cache

Empty the Linux buffer cache

sync && echo 3 > /proc/sys/vm/drop_caches


Configuring Unix / Linux File and Directory Access Rights

Configuring Unix / Linux File and Directory Access Rights
 

Below are some other examples of how to use the chmod command:

>> full access for everybody:
chmod 777 filename
>> full access for owner and group privileges but other users can only read and execute:
chmod 775 filename
>> full access for owner, but restricting group and other user privileges to only read and execute for files in the directory:
chmod 755 dirname
>> full access for the owner with no access rights or privileges for anyone else:
chmod 700 filename
chmod 700 -r /path/to/folder
>> no access to files in directory for group or other users and owner restricted to read and execute privileges to prevent the accidental deletion or modification of

files in the directory:
chmod 500 dirname
>> allowing the owner and group read and write access to a file, allowing others in the group to edit or delete the file as well as the owner, but with no access for

other users:
chmod 660 filename

===============================

How to configure VNCSERVER


How to configure VNCSERVER

 
Configuring VNC Server Access on a Redhat Linux5.8

I will show how to configure VNC server on Red Hat server and using VNC Viewer connect the server remotely from Windows XP.

1. Introduction

VNC allows you to open a remote GUI session to your
server and thus providing you with a full graphical
interface accessible from any remote location.

VNC allows you to open a remote GUI session to your
server and thus providing you with a full graphical interface accessible from any remote location.


2. Configure steps:-

Edit /etc/sysconfig/vncservers, and add the following to the end of the file.Hear my port=4
VNC User=root
save it.


[root]# vi /etc/sysconfig/vncservers


# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"


VNCSERVERS="4:root"
VNCSERVERARGS[4]="-geometry 1600x1200"

or

If you want multiple VNC session than you can use below lines add /etc/sysconfig/vncservers file.

VNCSERVERARGS[1]="-geometry 640x480" VNCSERVERARGS[2]="-geometry 640x480" VNCSERVERARGS[3]="-geometry 800x600"

3. Reset VNC User password.

Use below command-

[root]# vncpasswd
Password: XXXXX
Verify: XXXXX

This password you can use connection time.


4. firewall setting

If you have firewall enable on Red Hat, be sure that your firewall configuration won’t block connection from remote computer by open port TCP 5901 for remote access. Open Applications -> System Settings -> Security Level. Add ’5901:tcp’ on Other ports.
Note: VNC uses TCP protocol on port 5901.




5. start the vncserver.

[root]#
service vncserver start
[root]#
service vncserver stop

[root]#

service vncserver status


service vncserver restart

Now you can connect Red Hat server from remote computer. On my Windows XP computer, open VNC Viewer on Windows XP, type IP Address of Red Hat server with number as a username specify. In this example, I want to remote to Red Hat server as ‘root’ user which I assign as number 2 in step 2 and my Red Hat server is 10.110.141.220. So I type ’10.110.141.220:1′.
Note: You can download VNC Viewer for free at Download VNC® Viewer

Type your password for ‘root’ user which has been assign in step 3.
 


Now you have connect to Red Hat server remotely. But you’ll see that the interface looks different. You have to do a little thing more.




6. If You want to execs Server Desktop Than do next steps.

On Red Hat server, open terminal and type ‘vi /home/username/.vnc/xstartup’.

In this example,
I type ‘vi /home/admin/.vnc/xstartup’.


Note: If you going to enable remote access for user ‘root’, the file would be at ‘/root/.vnc/xstartup’.

[root@sujeet ~]# vi /root/.vnc/xstartup

UN-commit below 2 lines after that save it.

unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

7. Restart VNCSERVER

[root@sujeet ~]# service vncserver restart

Shutting down VNC server: 4:root [ OK ]
Starting VNC server: 4:root
New 'sonu.oracle.com:4 (root)' desktop is sujeet.oracle.com:4

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/chintels.chintels.com:4.log [ OK ]

8. Now you can connect Red Hat server from remote computer. On my Windows XP computer, open VNC Viewer on Windows XP, type IP Address of Red Hat server with number as a username specify. In this example, I want to remote to Red Hat server as ‘root’ user which I assign as number 2 in step 2 and my Red Hat server is 10.110.141.220. So I type ’10.110.141.220:1′.

Note: You can download VNC Viewer for free at Download VNC® Viewer


Type your password for ‘root’ user which has been assign in step 3.




Find vnc processes id.
[root]# ps -ef | grep vnc | grep root

Create tar file

Create tar file

tar -zvcf file.tar.gz file1 file2 dir1 dir2
eg :-  tar -zcvf CLN_12_1_3_AR.tar.gz CLN_12_1_3_AR


>> Details of tar :-
tar -tvf backup.tar.gz

>> UNTAR in current location

tar -xvf <file>.tar.gz

>> UNTAR in one particular directory
tar -xvf <file>.tar.gz -C /Oracle/test2
eg :-  tar -xvf test_bkp-31Dec13.tar.gz -C /Oracle/test_bkp2

Basic Linux Commands

Basic Linux  Commands

>> To check the present working directory

 [root@database ~]# pwd
/root

>> To show the contents of a directory (folder)

[root@database ~]# ls
3145.zip  args1    database_notes  Documents   ifcfg-eth1_March25  linux_image.iso  names         phonenubers  uln_migrate             uln_register.tar
args      BegPerl  Desktop         hello2.plx  index.html.1        mbox             oradiag_root  scripts   

>> To see more details including the permission regarding the contents of a directory (folder)

[[root@database ~]# ls -l
total 3511620
-rw-r--r--  1 root   root       422670 Dec 30 10:29 3145.zip
-rwxr--r--  1 root   root          105 Apr  8 21:45 args
-rwxr--r--  1 root   root           32 Apr  8 21:51 args1
drwxr-xr-x 17 root   root         4096 Dec 30 10:31 BegPerl
-rw-r--r--  1 root   root         5022 Jan  5 09:55 database_notes
drwxr-xr-x  3 root   root         4096 Mar 25 04:45 Desktop
drwx------  3 root   root         4096 Mar 30 21:33 Documents

>> To see all contents including hidden files of a directory (folder)

[root@database ~]# ls -a
.              .bashrc         .eggcups         .gstreamer-0.10     mbox                 scripts                 uln_register.tar             .xauthgXJKsS
..             BegPerl         .elinks          .gtkrc-1.2-gnome2   .metacity            .sqldeveloper           .vboxclient-clipboard.pid    .xauthixsRh6


>> To see tree structure of nested directories

[root@database ~]# ls -R /opt
/opt:
ORCLfmap
sqldeveloper
sun
VBoxGuestAdditions-4.2.6

/opt/ORCLfmap:
prot1_32

/opt/ORCLfmap/prot1_32:
bin
etc
log

/opt/ORCLfmap/prot1_32/bin:
Fmputl

>> To see a file starting from f

[root@database ~]# ls f*

>> To see a file have a middle string as disk

[root@database ~]# ls /bin/*disk*

>> To see a file whose length is 3 charaters

[root@database ~]# ls ???

>> To see a file which starts with single char & ends up with any number of character

[root@database ~]# ls ?edh*

>> To create a file
[root@database ~]# cat > file1

>>  To see file content
[root@database ~]# cat file1


>> To append a file

[root@database ~]  cat >> file1

[root@database ~] cat file1 file2 >> file3 #redirecting output to file3

[root@database ~] cat file3

>>  To create a file using touch command

[root@database ~]# touch f1 f2 f3 f4

[root@database ~]# ls

>>  Creating a single directory

[root@database ~]# mkdir dir

>> Creating multiple directories

[root@database ~]# mkdir dir1 dir2 dir3 dir4

[root@database ~]# ls

anaconda-ks.cfg  dir   dir2  dir4  f2  f4     file2  install.log     
labmanual
Desktop          dir1  dir3  f1    f3  file1  file3  install.log.syslog

>>  To create nested directories

[root@database ~]# mkdir -p d1/d2/d3/d4

>> To see the tree structure

[root@database ~]# ls -R d1
d1:
d2

d1/d2:
d3

d1/d2/d3:
d4

d1/d2/d3/d4:


>> To change a directory

[root@database ~]# cd dir1

[root@database ~]# cd ..

[root@database ~]# cd ../..

[root@database ~]# cd -
/root

[root@database ~]# pwd
/root

[root@database ~]# cd

[root@database ~]# pwd
/root

[root@database ~]#

13. To remove files

[root@database ~]# rm file1

rm: remove regular file `file1'? y

14. To remove an empty directory

[root@database ~]# rmdir dir1

[root@database ~]# ls
anaconda-ks.cfg  Desktop  dir2  dir4  f2  f4     file3        install.log.syslog
d1               dir      dir3  f1    f3  file2  install.log  labmanual

15. To remove a directory
[root@database ~]# rm -rf dir

[root@database ~]# ls
anaconda-ks.cfg  Desktop  dir3  f1  f3  file2  install.log         labmanual
d1               dir2     dir4  f2  f4  file3  install.log.syslog

To copy files

[root@database ~]# cp anaconda-ks.cfg file1

To copy folders

[root@database ~]# cp -r dir2 Desktop

To rename  directories and files

[root@database ~]# mv dir3 d4


[root@database ~]# ls
anaconda-ks.cfg  d4       dir2  f1  f3  file1  file3        install.log.syslog
d1               Desktop  dir4  f2  f4  file2  install.log  labmanual

To move directories and files

[root@database ~]# mv dir2 /opt

[root@database ~]# ls
anaconda-ks.cfg  d4       dir4  f2  f4     file2  install.log         labmanual
d1               Desktop  f1    f3  file1  file3  install.log.syslog


[root@database ~]# cd /opt

[root@database ~]#  ls
dir2

To search a word from single or multiple file’s

[root@database ~]# grep tom  /etc/passwd /etc/group /etc/gshadow

/etc/passwd:tom:x:500:500::/home/tom:/bin/bash
/etc/group:tom:x:500:
/etc/gshadow:tom:!::

[root@database ~]# cat /etc/passwd | grep tom

To see the type of file

[root@database ~]# file *

To view the date

[root@database ~]# date

[root@database ~]# date -s "07/15/2008 00:06:00 "
 mm/dd/yyyy hh:mm:ss
Tue Jul 15 00:06:00 EDT 2008

[root@database ~]# cal

[root@database ~]# cal 12 2008

[root@database ~]# man mkdir

[root@database ~]# man cal

To see the content screen wise

[root@database ~]# ls -l /bin  | less


Visual Interface (VI)


Commands to Go into Insert mode

To open a file use vi

e.g.
# vi test.txt

i   -  inserts the text at current cursor position
I   -  inserts the text at  beginning of line
a   -  appends the text after current cursor position
A   -  appends the text at end of line
o   -  inserts a line below current cursor position
O   -  inserts a line above current cursor position
r   -  replace a single char at current cursor position

Commands at execute mode

:q -  quit without saving
:q!   -  quit forcefully without saving
:w   -  save
:wq   -  save & quit
:wq! -  save & quit  forcefully
:x -  save & quit
:sh -  Provides temporary shell
:se nu -  Setting line numbers
:se nonu -  Removing line numbers
:84   -  Press enter goes to line 84

>> To move the cursor, press the h,j,k,l keys as indicated.   
             ^
             k              Hint:  The h key is at the left and moves left.
       < h       l >               The l key is at the right and moves right.
             j                     The j key looks like a down arrow
             v

w forward   word to word
b     back side word to word

>> Command's at command mode

dd   -  Deletes a line
2dd   -  Deletes 2 lines
yy   -  Copy a line
2yy   -  Copies 2 lines
p -  put  (deleted or copied text)
u -  Undo (can undo 1000 times)
Ctrl+r -  Redo
G - Moves cursor to last line of file
5G - Moves cursor to 5th line of file
Shift+ZZ -  save & quit
/ -  locate word


>> To find and replace words
:1,$s///gc

e.g.
:1,$s/world/universe/gc

1-- To start the search at from 1st line
$ -> End of File
s -> substitute
g -> global
c -> confirmation

>> To power off machine

# poweroff