Linux – List file count by Day
ls -lt | grep "^-" | awk '{ if($8 ~ /:/) $8=2011 Date_count=$6" "$7", "$8 freq[Date_count]++} END {for (date in freq) printf "%s\t%d\n", date, freq[date] }' | sort |
ls -lt | grep "^-" | awk '{ if($8 ~ /:/) $8=2011 Date_count=$6" "$7", "$8 freq[Date_count]++} END {for (date in freq) printf "%s\t%d\n", date, freq[date] }' | sort |
I normally have access to unix/linux systems through ssh (port 22) but firewall access is often disabled for ports like TNS (1521/1526), Emagent(1158), Grid (5500). How do you connect to those ports if you don’t have direct access through firewall ? … Use SSH tunneling.
p=$(lsof -t -i :1159); echo $p $(tr ‘\0′ ‘\n’ < /proc/$p/cmdline | tail -1)
4066 /u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_Server1.oracledbasupport.co.uk_TEST/config/server.xml
I need to remind myself on what machine & directory I am working on constantly. The easiest way to do so would be setting PS1 prompt under bash shell.
Comparing Files is one of very common task as a DBA, System Administrator. There are tonnes of Oracle,Websphere,linux configuration files. Often I have to compare one server to another and locate changes between environments.
Table of Contents
1.1 Objectives
1.2 Scope
2 System Configuration
2.1 Architecture
3 System Configuration
3.1 Machine Configuration
3.2 External/Shared Storage
4 Oracle Pre-Installation tasks
4.1 Redhat Pre-Requisite
4.2 Copy Oracle 10.2.0.1 software onto server
4.3 Unpack Files
4.4 Download Patches
4.5 Check kernel and update rpm files
4.6 Creating Required Operating System Groups and Users
4.7 Oracle required directory creation
4.8 Set Kernel Parameters
4.9 Create Oracle Profile
5 Oracle Software Configuration
5.1 Directory Structure
5.2 Download ASM packages
5.3 ASM package install
5.4 Configuring and Loading ASM
5.5 Creating ASM Disks
5.6 Installation
5.6.1 Database Only Installation
5.6.2 Installing the Listener
5.6.3 DBCA : Creating an ASM /Database Instance
netstat displays the contents of various network-related data structures in depending on the options selected.
vmstat - vmstat reports virtual memory statistics of process, virtual memory, disk, trap, and CPU activity.
./runInstaller
Starting Oracle Universal Installer…
Checking installer requirements…
Checking operating system version: must be B.11.11 or B.11.23. Actual B.11.11
Passed
iostat reports terminal and disk I/O activity and CPU utilization. The first line of output is for the time period since boot & each subsequent line is for the prior interval . Kernel maintains a number of counters to keep track of the values.
Find files older than 5 days: find . -mtime +5 -print | xargs ls -l | more
Remove files older than 5 days : find . -mtime +5 -print | xargs rm