September 2010
M T W T F S S
« Feb    
 12345
6789101112
13141516171819
20212223242526
27282930  

update plesk statistics

**********************************************************
*/usr/local/psa/admin/sbin/statistics –calculate-one –domain-name=domain*
**********************************************************

Export mysql to file

select * into outfile '/tmp/outfile.txt' fields terminated by ',' from my_table_name;

Add Arabic keyboard to linux (Gentoo)

I’ve never thought that some day I’ll use an Arabic Keyboard on linux but I CHOOOOKED it is very simple, just edit your Xorg file and add arabic code in addition to (ALT+SHIFT) key, below is Configuration file - part keyboard :

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbLayout" "us,ar"
Option "XKbOptions" "grp:alt_shift_toggle"
EndSection

Rebuild all indexes once


declare
index_name VARCHAR2(100);
CURSOR i_c is select index_name from user_indexes;
begin
open i_c;
loop
fetch i_c into index_name;
EXIT WHEN i_c%NOTFOUND;
EXECUTE IMMEDIATE ('alter index ' || index_name || ' rebuild');
end loop;
end;

Alter tablespace for table(s)

In oracle they call changing TABLESPACE for a Table(s) is Move, thus, you can move table between tablespaces by using this query

ALTER TABLE TABLE_NAME MOVE TABLESPACE TABLE_SPACE_NAME

LAMP on Gentoo

LAMP
{
L=LINUX
A=APACHE
M=MYSQL
P=PHP
}
Install and configure on gentoo
1- emerge apahce2
1.1 vim /etc/conf.d/apache2
1.2 APACHE2_OPTS=”-D PHP5″
2- emerge mysql
3- emerge php
4- restart apache2

Ref #1
Ref #2

Analysis query

explain plan for
SELECT * FROM (SELECT ROWNUM as nrow, USERNAME,NAME,to_char(STARTDATE,'YYYY-MM-DD') as STARTDATE,to_char(EXPIRYDATE,'YYYY-MM-DD') as EXPIRYDATE FROM USERS u) where nrow >= 100 and nrow <= 200;

select * from table(dbms_xplan.display);

Oracel Grant

Grant scheme to another user
GRANT SELECT ON SCHEMA.TABLE TO USER;

Grant Package to user
grant execute on sys.dbms_sql to user;

نهاية العـــــــــــــــــــــــــــــــــــالم

نهاية العالم للشيخ عبدالحميد كشك رحمة الله عليه

The end of whole world

كشك رحمة الله عليه

10g, Control File

Control Files

A control file is a small binary file that is created during database creation. A control file tracks many of the internal database functions, such as the structure of the database, datafile locations, synchronization information, and backup and recovery information. Anytime there is a major change in the structure of the database, such as when a redo log file is added, the control file is updated with the new information. During database startup, the control file opens the datafiles and redo log files.

There are views that can be used to display control file information.

Control File Information Views

View Displays
V$DATABASE Database information from the control file.
V$CONTROLFILE List of control file names.
V$CONTROLFILE_RECORD_SECTION Information about control file record sections.
V$PARAMETER Control file names as specified in the CONTROL_FILES initialization parameter.