【oracle】表空间的管理

版权声明:原创手打 转载请注明来源 https://blog.csdn.net/qq_42774325/article/details/81913179

 

  1. 查询当前数据库已经有的表空间与数据文件
    select t.ts#,t.name,f.name from v$datafile f,v$tablespace t
    where f.ts#=t.ts#;
     
     
  2. 查询用户u1下的数据段
    select *  from dba_segments where owner=’U1’;
     
  3. 创建一个新的表空间,数据文件默认与当前表空间位置一样,大小10M
    select * from v$tablespace;
    select name from v$tablespace;
    create tablespace tbs3 datafile
    ‘/u02/app/oracle/oradata/orcl/tbs301.dbf’ size 10M;
     
     
  4. 查询表空间的详细信息
    select * from dba_tablespaces;
     
  5. 修改表空间的状态
    select tablespace_name,status from dba_tablespaces;
     
    alter tablespace tbs3 offline;
     
    alter tablespace tbs3 online;
     

猜你喜欢

转载自blog.csdn.net/qq_42774325/article/details/81913179
今日推荐