`
wrong1111
  • 浏览: 252474 次
  • 性别: Icon_minigender_1
  • 来自: 湖南
社区版块
存档分类
最新评论

create instants

 
阅读更多
CREATE DATABASE sample
   CONTROLFILE REUSE 
   LOGFILE
      GROUP 1 ('diskx:log1.log', 'disky:log1.log') SIZE 50K, 
      GROUP 2 ('diskx:log2.log', 'disky:log2.log') SIZE 50K 
   MAXLOGFILES 5 
   MAXLOGHISTORY 100 
   MAXDATAFILES 10 
   MAXINSTANCES 2 
   ARCHIVELOG 
   CHARACTER SET AL32UTF8
   NATIONAL CHARACTER SET AL16UTF16
   DATAFILE  
      'disk1:df1.dbf' AUTOEXTEND ON,
      'disk2:df2.dbf' AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
   DEFAULT TEMPORARY TABLESPACE temp_ts
   UNDO TABLESPACE undo_ts 
   SET TIME_ZONE = '+02:00';

 

2. 直接导入 数据库测试用户scott/tiger

 以管理员身份登录 

sql> sqlplus / as sysdba;
sql> @utlsampl 
sql>sqlplus  scott/tiger 或者 select username from dba_user where username='scott' 

 确认执行成功!

 

3,查看用户表空间

select username,default_tablespace from dba_users where username='scott';

 4,查看表空间使用情况

 select a.file_id "FileNo",  
        a.tablespace_name "Tablespace_name",  
        a.bytes "Bytes",  
        a.bytes - sum(nvl(b.bytes, 0)) "Used",  
        sum(nvl(b.bytes, 0)) "Free",  
        sum(nvl(b.bytes, 0)) / a.bytes * 100 "%free"  
        from dba_data_files a, dba_free_space b  
 where  a.file_id = b.file_id(+)  
 group by a.tablespace_name, a.file_id, a.bytes 
 order by a.tablespace_name;

 

 

 

 

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics