database tools, oracle, sql server, db2, monitor, monitoring, performance
home
who are we
products
database product monitor
database product reorg
database product capacity planning
external alerting device
customers
partners
links
competition us and them
oracle dba scripts
contact us
our mail list
[ Jan, 2008 ]
B.G.S Software products are becoming popular in china. (See Brochure)

[ Jan, 2008 ]
We have a BLOG for feedbacks and information sharing. (Visit our blog)

[ Oct, 2006 ]
Capacity Planning Package for Oracle Database is now included in the monitor!. More...

[ Jul, 2006 ]
Build a package of the monitor especially to monitor your application and database. Provide a monitoring tool 'built in' in your product. More...

[ Jul, 2006 ]
New object called "History Keeper" was added to the monitor. This object allows saving history of the monitor into a repository in the database.
It's possible to define the frequency of saving a sample, and the number of days to keep in the repository.

[ Jun, 2006 ]
New electronic equipment called "External alerting device" (made by B.G.S.) was added to the monitor.
The device connects to the PC's parallel port and can activate a siren & light alert (wired or wireless). It's possible to define thresholds and statuses to activate the alert.

Oracle Database Scripts


Using List Partitions (Supported in Oracle 9i and above) - Note:149116.1 in Metalink:


The Script:


-- Create table with list partitions
CREATE TABLE employees_reg_p
(region VARCHAR2(15),
nm varchar2(100))
partition BY LIST (REGION)
(partition Zone_1 VALUES('R1','R10','R11','R12'),
partition Zone_2 VALUES('R13','R14','R15','R16'),
partition Zone_3 VALUES('R17','R18','R19','R2'),
partition Zone_4 VALUES('R20','R21','R22','R23'),
partition Zone_5 VALUES('R24','R25','R26','R27'),
partition Zone_6 VALUES('R28','R29','R3','R30'),
partition Zone_7 VALUES ('R31','R32','R4','R5'),
partition Zone_8 VALUES ('R6','R7','R8','R9'));

-- Drop a value from a specification of list partition (first must delete rows from partition)
-- (Cannot drop the last value in the list of a partition, at least one value must stay!)
Delete employees_reg_p WHERE region in ('R32', 'R22');
ALTER TABLE employees_reg_p modify partition zone_4 DROP values ('R22');
ALTER TABLE employees_reg_p modify partition zone_7 DROP values ('R32');

-- Truncate Partition
ALTER TABLE employees_reg_p TRUNCATE PARTITION ZONE_3 DROP STORAGE;

-- Move Partition
ALTER TABLE employees_reg_p MOVE PARTITION ZONE_3 TABLESPACE users;

-- Insert a row into partition (dont specify the partition)
insert into employees_reg_p values('R2','name 1');

-- Select values only from the specified partition
select * from employees_reg_p partition (zone_3);

-- Change contents of partition 'zone_3' with another table called: 'tst'
create table tst as select * from employees_reg_p;
alter table employees_reg_p EXCHANGE PARTITION ZONE_3 WITH TABLE tst WITHOUT VALIDATION;

Donate 5$

If you found this information useful, don't be cheap, donate 5 dollars (with PayPal):