———-user’in sahip olduğu rollerin listesini verir—————-

select * from user_role_privs;

——————-tüm user’ları görmek için——————-

select username from dba_users;

—————————-ALTER TABLESPACE——–

————————tablespace’in adını değiştirir———–

ALTER TABLESPACE test RENAME TO test0;

———————tablespace’e datafile eklemek————–

alter tablespace test add datafile ‘D:\oracle\product\10.2.0\oradata\orcl\test2.dbf’size 10M
AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED;

————-tablespace’i 20mb olarak artırır————————-

ALTER TABLESPACE test AUTOEXTEND ON NEXT 20M MAXSIZE UNLIMITED;

–tablespacedeki tüm datafile’lerin adını ve büyüklüğünü verir—–

SELECT file_name, bytes FROM sys.dba_data_files WHERE tablespace_name = ‘TEST’;

select file_name,file_id,tablespace_name,bytes,status,online_status from sys.dba_data_files where tablespace_name=’test’
————tablespace’i offline ve online duruma getirme——
alter tablespace test offline;
————- select * from hastalar;
alter tablespace test online;—————————-

————datafile’ı offline ve online duruma getirme——-

ALTER DATABASE DATAFILE ‘D:\oracle\product\10.2.0\oradata\orcl\test2.dbf’ offline;

shutdown immediate;
startup mount;

ALTER DATABASE DATAFILE ‘D:\oracle\product\10.2.0\oradata\orcl\test2.dbf’ online;

——–datafile’ın adını değiştirir———————–

sql>shutdown immediate;

manuel olarak,dizindeki ‘test’ datafile’ının adını değiştiriyoruz.

sql>HOST MOVE D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL2\TEST.DBF D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL2\INTERBASE.DBF

SQL>alter database rename file ‘D:\oracle\product\10.2.0\oradata\orcl2\test.dbf’ to ‘D:\oracle\product\10.2.0\oradata\orcl2\INTERBASE.dbf’;

sql>alter database open;
—————————————————
ALTER TABLESPACE test DROP DATAFILE ‘D:\oracle\product\10.2.0\oradata\orcl\test2.dbf’;

———tabloyu başka tablespace’e taşıma———

ALTER TABLE table_name MOVE TABLESPACE tablespace_name

ALTER TABLE orhan.deneme MOVE TABLESPACE users