Link to home
Start Free TrialLog in
Avatar of marrowyung
marrowyung

asked on

Create table and table space using Toad for Oracle

Dear all,

We are using Toad 9.7.2.5 for Oracle, how can we:

1) Create table
2) Create tablespace and assign that table to that tablespace.
3) set growth limit for the expansion of that table?

anyway to make sure Toad send alert by email/prompt it when the storage reach the alert and critical level so that we can start adding more disk?
Avatar of ajexpert
ajexpert
Flag of United States of America image

For #2 and #3 you will need DB Module of TOAD

See attached
Avatar of marrowyung
marrowyung

ASKER

I dont see anything attached, please attach again !

I never hear about that as all Toad I use can connect to the DB and run query, just like I right click a table and select "generate script", and I get this:

DROP TABLE ADMDBCA.AFR_BILLFLWUP CASCADE CONSTRAINTS;

CREATE TABLE ADMDBCA.AFR_BILLFLWUP
(
  BILL_YEAR       NUMBER(4)                     NOT NULL,
  BILL_MONTH      NUMBER(2)                     NOT NULL,
  SECUSER_ID      VARCHAR2(25 BYTE)             NOT NULL,
  BFLWUP_DATE     DATE                          NOT NULL,
  BFLWUP_COMMENT  VARCHAR2(2048 BYTE)           NOT NULL
)
TABLESPACE DENVER
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE INDEX ADMDBCA.AI_BILLFLWUP ON ADMDBCA.AFR_BILLFLWUP
(BILL_YEAR, BILL_MONTH)
LOGGING
TABLESPACE DENVER_IDX
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          128K
            MINEXTENTS       1
            MAXEXTENTS       UNLIMITED
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
NOPARALLEL;


DROP SYNONYM USRDBCA.AFR_BILLFLWUP;

CREATE SYNONYM USRDBCA.AFR_BILLFLWUP FOR ADMDBCA.AFR_BILLFLWUP;

Open in new window

SOLUTION
Avatar of ajexpert
ajexpert
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
it seems that script out something from Toad is easy..

Will Toad tell you how many space left for that tablespace? how can we control the expand of the tablespace so that if the table is expanding more toward 100MB, it will stop expands and alert prompt out ?

For example, how to change the following to make use of disk space limit?

CREATE TABLESPACE DEN_DATAMART_SAN2B DATAFILE 
  'G:\ORACLE\ORADATA\xxx\xxx_DATAMART_SAN2B_02.DBF' SIZE 6144M AUTOEXTEND ON NEXT 1024M MAXSIZE 6144M,
  'G:\ORACLE\ORADATA\xxx\xxx_DATAMART_SAN2B_01.DBF' SIZE 6144M AUTOEXTEND ON NEXT 1024M MAXSIZE 6144M
LOGGING
ONLINE
PERMANENT
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;

Open in new window


what is block size means? it means that for each data page of Oracle, it writes data in a 8K page? what is the theory ?
ASKER CERTIFIED SOLUTION
Avatar of Mark Geerlings
Mark Geerlings
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
markgeer,

"1) should be: create tablespace [name_you_like] as '[disk location you like]'
2) should be: create a table and assign it to a tablespace."

"3) you can control the "next" extent size for a table and you can control the maximum number of extents, so that gives you the ability to set a maximum size for a table."

Please show me some URL to understand the basic information about extent.

"4) No, TOAD does not send alerts.  You can use Oracle's OEM (Oracle Enterprise Manager) to send alerts, but not TOAD.  TOAD can run queries or reports, and these could indicate a problem"

Thanks and good answer ! I reserver all mark to you. I keep learning from you.

but someone told me that, as I am doing the 10g right now, using OEM is dangerous for 10g and can kill the 10g DB server from time to time. So I use Toad.

"Start with Oracle's default block size of 8k, until you get more experience with Oracle.  "

The MS SQL one use 8K and a chuch of 8K, which make up of 8x 8K page, one 64 K each time it write data to the disk. So I think it is a good match between Oracle and MS SQL.

I see from Toad that Oracle has block size and extent, what is extent about ?

some kind of script has "EXTENT MANAGEMENT LOCAL AUTOALLOCATE", is that mean Oracle automatically manage the extent ??