Wednesday, April 22, 2009

Oracle cheat sheets commands part-iv

1)alter profile: Miscellaneous

ALTER ROLE my_role IDENTIFIED BY password;
ALTER ROLE my_role NOT IDENTIFIED;

2)alter rollback segment: Online/Offline

ALTER ROLLBACK SEGMENT rbs01 OFFLINE;
ALTER ROLLBACK SEGMENT rbs01 ONLINE;

3)alter rollback segment: Shrink

ALTER ROLLBACK SEGMENT rbs01 SHRINK;
ALTER ROLLBACK SEGMENT rbs01 SHRINK TO 100M;

4)alter rollback segment: storage Clause

ALTER ROLLBACK SEGMENT rbs01 STORAGE(NEXT 50M OPTIMAL 100M);

5)alter session: Enable and Disable Parallel Operations

ALTER SESSION ENABLE PARALLEL DML PARALLEL 3;
ALTER SESSION ENABLE PARALLEL DDL;
ALTER SESSION DISABLE PARALLEL QUERY;

6)alter session: Resumable Space Management

ALTER SESSION ENABLE RESUMABLE TIMEOUT 3600;
ALTER SESSION DISABLE RESUMABLE;

7)alter session: Set Session Parameters

ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM ARCHIVE LOG START;
ALTER SYSTEM ARCHIVE LOG STOP;
ALTER SYSTEM ARCHIVE LOG ALL;
ALTER SYSTEM ARCHIVE LOG THREAD 1 ALL;
ALTER SYSTEM ARCHIVE LOG ALL TO 'C:\oracle\allarch';

8)alter table: Move Table

ALTER TABLE parts move TABLESPACE parts_new_tbs PCTFREE 10 PCTUSED 60;

9)alter table: Table Column – Remove

ALTER TABLE parts DROP (part_location);
ALTER TABLE parts DROP (part_location, part_bin);

10)alter table: Table Column – Rename

ALTER TABLE parts RENAME COLUMN part_location TO part_loc;