2009-10-23

LINUX PACKAGES

Packages

RPMYUMDPKGDESCRIPTION
rpm -q –changelog [package]changelog
rpm -U/-i –test [package].rpmtest before install
rpm -qa –last | headinstallation time of last packages
rpm -ql [package]dpkg -L [package]file list installed by package
rpm -qf [file]yum provides [file]dpkg -S [file]package name which is owner of file
rpm -qi [package]yum info [package]dpkg -s [package]info
rpm -q [package]dpkg-query -W [package]package version
rpm -qayum list installeddpkg –listinstalled packages
yum list [package]available packages in repository (about 15000), or package version in repo
rpm -q –whatrequires [package]package needs
rpm -q –provides [package]search missing libs, files
rpm -q –whatprovides libc.so.6yum list provides [shared_obj]
yum whatprovides "\*bin/[file]"search in which package is file
yum whatprovides libpthread*
yum list extrasunoficial repo packages list
rpm -qR [pakiet]yum deplist [pakiet]dependency list
yum check-updateupdate check
yum list updates
rpm -qp –scripts [package].rpmscripts check
rpm -qlp [package].rpmrpm content check
yum -Cusing cache
yum search [string]search by names, descriptions, summaries
yum list [string]\*search by [string]
yum history
yum-complete-transactioncomplete transaction after power crash etc.
yum-complete-transaction –cleanup-onlyclean transaction without resume the aborted transactions
yum clean allremove all traces of the version from /var/cache/yum
yum –releasever=[release_nr_to_sync] distro-sync
yum –rebuilddbrebuild rpm database, recreate database index

yum history

yum history listlast 20 transactins
yum history list allall transactions
yum history list [ID]
yum history info [ID]all info about transaction
yum history package-list [package_name]

Action column

DDowngradeAt least one package has been downgraded to an older version.
EEraseAt least one package has been removed.
IInstallAt least one new package has been installed.
OObsoletingAt least one package has been marked as obsolete.
RReinstallAt least one package has been reinstalled.
UUpdateAt least one package has been updated to a newer version.

Altered column

<Before the transaction finished, the rpmdb database was changed outside Yum.
>After the transaction finished, the rpmdb database was changed outside Yum.
*The transaction failed to finish.
#The transaction finished successfully, but yum returned a non-zero exit code.
EThe transaction finished successfully, but an error or a warning was displayed.
PThe transaction finished successfully, but problems already existed in the rpmdb database.
sThe transaction finished successfully, but the –skip-broken command line option was used and certain packages were skipped.

Misc

rpmreapertool for removing packages and find dependencies
package-cleanup –orphansunsupported packages
yumdownloader [package]get rpm package
yumdownloader –source [package]getsource package
rpm2cpio [package].rpm | cpio -idvunpack rpm2cpio
rpm2cpio [package].rpm | cpio -twhat is inside rpm
yum grouplistzainstalowane i dostepne grupy
yum groupinstall '[group]'instalacja grupy
yum groupinfo '[group]'
yum groupremove '[group]'
yum –downloadonly updatedownload only
rpm –querytagsshow all tags
rpm -qa –queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"
rpm -qa –queryformat "%{NAME}-%{VERSION}-%{RELEASE}\t%{INSTALLTIME:date}"
rpm -qa –queryformat "%-40{NAME}%-20{VERSION}%-20{RELEASE}%{INSTALLTIME:date}\n"

Remarks

  • For RPM repos main database is located in /var/lib/rpm, it is BerkleyDB.

2009-10-21

LINUX RRDTOOL

describe database creation:
rrdtool create base.rrd -s 240 \
DS:DS-NAME:GAUGE | COUNTER | DERIVE | ABSOLUTE:HEARTBEAT:0:U \
RRA:CF:XFF:3:840
-s # step default is 300 sec
DS # DATA SOURCE
DS-NAME # variable name
RRA # ROUND ROBIN ARCHIVE - one archive in database
CF # CONSOLIDATION FUNCTION - MAX | MIN | AVERAGE | LAST
PDP # PRIMARY DATA POINT
XFF # XFILES FACTOR - factor, from 0 to 1 describe how many PDP can be   UNKNOWN before record will be write to database as UNKNOWN

example:
rrdtool create base.rrd -s 240 \
DS:input:COUNTER:600:0:U \
RRA:AVERAGE:0.5:3:840

base.rrd #database file
-s 240 #record step in database are set to 240 sec
input #data chain name
COUNTER #counter type
(COUNTER - best for increasing values as network interfaces counters, you take into account that interface network counters is roll back when achieve top value 232 or 2 64 and start from zero value
GAUGE - best for non increasing values)

example of counting data:
value of first probe = 100
value of second probe = 150
value of third probe = 180

for counter type - COUNTER
will be calculate difference 150-100=50 and 180-150=30
then depends on RRA ( AVERAGE, MAX, MIN or LAST),
values will be:
for AVERAGE=(50+30)/2=40,
for MAX=50,
for MIN=30,
for LAST=30

for counter type - GAUGE
will not be calculate difference
then depends on RRA
for AVERAGE= (100+150+180)/3=143,
for MAX=180,
for MIN=100,
for LAST=180

600 #600 sec, between each probe before probe will be marked as UNKNOWN,
0 #minimal value
U #maximal value "U" is UNKNOWN
0.5 #ratio of UNKNOWN probes 0-1, 0.5 means 50%
3 #result of CF function will be get from 3 probes but 50% from them can be UNKNOWN
840 #maximal amount of probes which can be store in database (amount of records), you can not resize database file so it must be set at startup.

let's calculate how many probes should be store in our database during week:

from previous settings we assume that value is generated from 3 probes which are collected every 240 sec
3*240=720 sec.
so final value will be store in database every 720 sec
720/60=12 min.
means that every value in our html chart will be refresh every 12 min.

3600/720=5 probes per hour
24*3600/720=120 probes per day,
7*24*3600/720=840 probes per week

other:
rrdtool dump [baza.rrd] [plik.xml] #export database to xml file
rrdtool fetch [baza.rrd] AVERAGE -s -6[min | h] #get records from last 6 min | hour.

OTHER LINKS

CSS
gs.statcounter.com
regex tester

2009-10-13

ORACLE BINARY CLONE

How to copy binaries to other server:
  1. turn off database and all services
  2. make backup of ORACLE_HOME dir
    at new server:
  3. make new ORACLE_HOME
  4. set other system variables
  5. put ORACLE_HOME from previous backup
  6. set user and group ORACLE_HOME dir
  7. remove .ora files from ORACLE_HOME/network/admin
  8. run command:
    ORACLE_HOME/oui/bin/runInstaller -clone -silent ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=new_Oracle_home_name
  9. run script root.sh
  10. try run dbca

2009-10-01

ORACLE SCRIPTS

podane za Oracle® Database Reference 10g Release 2 (10.2) Part Number B14237-04

Table B-1 Creating the Data Dictionary Scripts

Script Name Needed For Description

catalog.sql

All databases

Creates the data dictionary and public synonyms for many of its views

Grants PUBLIC access to the synonyms

catproc.sql

All databases

Runs all scripts required for, or used with PL/SQL

catclust.sql

Real Application Clusters

Creates Real Application Clusters data dictionary views


Table B-2 Creating Additional Data Dictionary Structures

Script Name Needed For Run By Description

catblock.sql

Performance management

SYS

Creates views that can dynamically display lock dependency graphs

catexp7.sql

Exporting data to Oracle7

SYS

Creates the dictionary views needed for the Oracle7 Export utility to export data from the Oracle Database in Oracle7 Export file format

caths.sql

Heterogeneous Services

SYS

Installs packages for administering heterogeneous services

catio.sql

Performance management

SYS

Allows I/O to be traced on a table-by-table basis

catoctk.sql

Security

SYS

Creates the Oracle Cryptographic Toolkit package

catqueue.sql

Advanced Queuing


Creates the dictionary objects required for Advanced Queuing

catrep.sql

Oracle Replication

SYS

Runs all SQL scripts for enabling database replication

catrman.sql

Recovery Manager

RMAN or any user with GRANT_RECOVERY_CATALOG_OWNER role

Creates recovery manager tables and views (schema) to establish an external recovery catalog for the backup, restore, and recovery functionality provided by the Recovery Manager (RMAN) utility

dbmsiotc.sql

Storage management

Any user

Analyzes chained rows in index-organized tables

dbmspool.sql

Performance management

SYS or SYSDBA

Enables DBA to lock PL/SQL packages, SQL statements, and triggers into the shared pool

userlock.sql

Concurrency control

SYS or SYSDBA

Provides a facility for user-named locks that can be used in a local or clustered environment to aid in sequencing application actions

utlbstat.sql and utlestat.sql

Performance monitoring

SYS

Respectively start and stop collecting performance tuning statistics

utlchn1.sql

Storage management

Any user

For use with the Oracle Database. Creates tables for storing the output of the ANALYZE command with the CHAINED ROWS option. Can handle both physical and logical rowids.

utlconst.sql

Year 2000 compliance

Any user

Provides functions to validate that CHECK constraints on date columns are year 2000 compliant

utldtree.sql

Metadata management

Any user

Creates tables and views that show dependencies between objects

utlexpt1.sql

Constraints

Any user

For use with the Oracle Database. Creates the default table (EXCEPTIONS) for storing exceptions from enabling constraints. Can handle both physical and logical rowids.

utlip.sql

PL/SQL

SYS

Used primarily for upgrade and downgrade operations. It invalidates all existing PL/SQL modules by altering certain dictionary tables so that subsequent recompilations will occur in the format required by the database. It also reloads the packages STANDARD and DBMS_STANDARD, which are necessary for any PL/SQL compilations.

utlirp.sql

PL/SQL

SYS

Used to change from 32-bit to 64-bit word size or vice versa. This script recompiles existing PL/SQL modules in the format required by the new database. It first alters some data dictionary tables. Then it reloads the packages STANDARD and DBMS_STANDARD, which are necessary for using PL/SQL. Finally, it triggers a recompilation of all PL/SQL modules, such as packages, procedures, and types.

utllockt.sql

Performance monitoring

SYS or SYSDBA

Displays a lock wait-for graph, in tree structure format

utlpwdmg.sql

Security

SYS or SYSDBA

Creates PL/SQL functions for default password complexity verification. Sets the default password profile parameters and enables password management features.

utlrp.sql

PL/SQL

SYS

Recompiles all existing PL/SQL modules that were previously in an INVALID state, such as packages, procedures, and types.

utlsampl.sql

Examples

SYS or any user with DBA role

Creates sample tables, such as emp and dept, and users, such as scott

utlscln.sql

Oracle Replication

Any user

Copies a snapshot schema from another snapshot site

utltkprf.sql

Performance management

SYS

Creates the TKPROFER role to allow the TKPROF profiling utility to be run by non-DBA users

utlvalid.sql

Partitioned tables

Any user

Creates tables required for storing output of ANALYZE TABLE ...VALIDATE STRUCTURE of a partitioned table

utlxplan.sql

Performance management

Any user

Creates the table PLAN_TABLE, which holds output from the EXPLAIN PLAN statement


Table B-4 Upgrade and Downgrade Scripts

Script Name Needed For Description

catdwgrd.sql

Downgrading

Provides a direct downgrade path from the new Oracle Database 10g release

catupgrd.sql

Upgrading

Provides a direct upgrade path to the new Oracle Database 10g release

utlu102i.SQL

Pre-Upgrade Information

Analyzes the database to be upgraded, detailing requirements and issues for the upgrade to release 10.2

utlu102s.SQL

Post-Upgrade Status

Displays the component upgrade status after an upgrade to release 10.2


Table B-5 Java Scripts

Script Name Description

initjvm.sql

Initializes JServer by installing core Java class libraries and Oracle-specific Java classes

rmjvm.sql

Removes all elements of the JServer

catjava.sql

Installs Java-related packages and classes