If you want to change table, you can use alter table. You can add or drop constraint, add or drop column, modify column name or type, modify table name with alter table statement.
Add, Drop and Modify Column
ALTER TABLE employees ADD (birth_date varchar2(20));
ALTER TABLE employees MODIFY (birth_date date);
ALTER TABLE employees MODIFY (birth_date not null);
ALTER TABLE employees DROP COLUMN birth_date;
Add and Drop Constraint
ALTER TABLE employees ADD CONSTRAINT pk_emp_id PRIMARY KEY(employee_id);
ALTER TABLE employees DROP CONSTRAINT pk_emp_id;
ALTER TABLE employees ADD CONSTRAINT fk_dept_id FOREIGN KEY(department_id) REFERENCES departments(department_id);
ALTER TABLE employees DROP CONSTRAINT fk_dept_id;
ALTER TABLE employees ADD CONSTRAINT ck_salary CHECK (salary > 2000);
ALTER TABLE employees DROP CONSTRAINT ck_salary;
SET UNUSED option
The Set Unused option marks one or more columns as unused so that they can be dropped when the demand on system resources is lower. This clause does not actually remove the target columns from each row in the table. Thus, the response time is faster than if you executed the drop clause. After a column has been marked as unused, you have not access to that column. You can use the Drop Unused Columns option to remove the columns that are marked as unused.
ALTER TABLE employees SET UNUSED COLUMN last_name;
ALTER TABLE employees DROP UNUSED COLUMNS;
Give Quota to User
ALTER USER username QUOTA 2G ON USERS;
If you want to add any object or data to database, you have to give ouota to user.
13,918 total views, no views today