Skip to main content

Partitioned Tables TESTING

create table prime ( x primary key ) as  select user_id from all_users;
create table DEMO1  as select user_id from all_users;
alter table DEMO1 add constraint DEMO1_pk primary key(user_id);
alter table DEMO1 add constraint DEMO1_fk foreign key(user_id) referencesp(x);  2

create table DEMO2 (username varchar2(30),user_id number, created date  ) partition by hash(user_id) partitions 8;

exec dbms_redefinition.can_redef_table( user, 'DEMO1' );
exec dbms_redefinition.start_redef_table( user, 'DEMO1', 'DEMO2' );
****************************************
variable nerrors number
begin
dbms_redefinition.copy_table_dependents
( user, 'DEMO1','DEMO2',copy_indexes => dbms_redefinition.cons_orig_params,num_errors => :nerrors );
end;
/
***************************************

exec dbms_redefinition.finish_redef_table( user, 'DEMO1', 'DEMO2' );
select dbms_metadata.get_ddl( 'TABLE', 'DEMO1' ) from dual;
 
CREATE TABLE "SCOTT"."DEMO1"
   (    "USERNAME" VARCHAR2(30),
        "USER_ID" NUMBER CONSTRAINT "SYS_C0011002" NOT NULL ENABLE NOVALIDATE,
        "CREATED" DATE,
         CONSTRAINT "DEMO1_PK" PRIMARY KEY ("USER_ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "USERS"  ENABLE NOVALIDATE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
  STORAGE(
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "USERS"
  PARTITION BY HASH ("USER_ID")
 (PARTITION "SYS_P61" SEGMENT CREATION IMMEDIATE
  TABLESPACE "USERS"
 NOCOMPRESS ,
 PARTITION "SYS_P62" SEGMENT CREATION IMMEDIATE
  TABLESPACE "USERS"
 NOCOMPRESS ,
 PARTITION "SYS_P63" SEGMENT CREATION IMMEDIATE
  TABLESPACE "USERS"
 NOCOMPRESS ,
 PARTITION "SYS_P64" SEGMENT CREATION IMMEDIATE
  TABLESPACE "USERS"
 NOCOMPRESS ,
 PARTITION "SYS_P65" SEGMENT CREATION IMMEDIATE
  TABLESPACE "USERS"
 NOCOMPRESS ,
 PARTITION "SYS_P66" SEGMENT CREATION IMMEDIATE
  TABLESPACE "USERS"
 NOCOMPRESS ,
 PARTITION "SYS_P67" SEGMENT CREATION IMMEDIATE
  TABLESPACE "USERS"
 NOCOMPRESS ,
 PARTITION "SYS_P68" SEGMENT CREATION IMMEDIATE
  TABLESPACE "USERS"
 NOCOMPRESS )


 

Comments

Popular posts from this blog

Hard dependency with ip address Oracle RAC Cluster.

Command error out due to hard dependency with ip address [-Node1]/app/grid/oracle/product/11.2.0/grid/bin>./crsctl relocate resource RDBMS_DB -n Node2 CRS-2527: Unable to start 'RDBMS_DB' because it has a 'hard' dependency on 'sDB' CRS-2525: All instances of the resource 'sDB' are already running; relocate is not allowed because the force option was not specified CRS-4000: Command Relocate failed, or completed with errors. [-Node1]/app/grid/oracle/product/11.2.0/grid/bin>./crsctl relocate resource sDB  -n Node2 CRS-2529: Unable to act on 'DB' because that would require stopping or relocating 'LISTENER_DB', but the force option was not specified CRS-4000: Command Relocate failed, or completed with errors. [-Node1]/app/grid/oracle/product/11.2.0/grid/bin>./crsctl relocate resource LISTENER_DB  -n Node2 CRS-2527: Unable to start 'LISTENER_DB' because it has a 'hard' dependency on 'sD...

12c. Monthly Database Growth from OEM 12c.

SELECT alloc.TARGET_NAME,TO_DATE(TO_CHAR(alloc.timestamp, 'MON RR'), 'MON RR') AS CALENDAR_MONTH,        alloc.tablespace AS TABLESPACE,        round(avg(alloc.avg_size_mb), 2) AS SIZE_MB,        round(avg(used.avg_used_mb), 2) AS USED_MB,        round(avg(alloc.avg_size_mb - used.avg_used_mb), 2) AS FREE_MB,        round(avg((used.avg_used_mb*100)/ decode(alloc.avg_size_mb, 0, 1, alloc.avg_size_mb)), 2) AS USED_PCT,        round(max(alloc.max_size_mb), 2) AS SIZE_MAX_MB,        round(max(used.max_used_mb), 2) AS USED_MAX_MB,        round(max(alloc.avg_size_mb - used.avg_used_mb), 2) AS FREE_MAX_MB,        round(max((used.avg_used_mb*100)/decode(alloc.avg_size_mb, 0, 1, alloc.avg_size_mb)), 2) AS USE...

19C NID ( Rename Database)

 [oracle@localhost ~]$ nid DBNEWID: Release 19.0.0.0.0 - Production on Thu Dec 23 00:05:36 2021 Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved. Keyword     Description                    (Default) ---------------------------------------------------- TARGET      Username/Password              (NONE) DBNAME      New database name              (NONE) LOGFILE     Output Log                     (NONE) REVERT      Revert failed change           NO SETNAME     Set a new database name only   NO APPEND      Append to output log           NO HELP        Displays these messages    ...