oracle 创建/删除 表空间和用户

-----创建表空间
create tablespace JTKMS datafile 'E:\app\xys\oradata\orcl\zqdb.dbf' size 50m autoextend on next 50m maxsize 512m extent management local;

-----创建表用户
create user newkm identified by newkm default tablespace JTKMS temporary tablespace temp quota unlimited on JTKMS;

--删除表空间,如果其他表空间中的表有外键等约束关联到了本表空间中的表的字段,就要加上CASCADE CONSTRAINTS

drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS;

  

--删除表用户,说明: 删除了user,只是删除了该user下的schema objects,是不会删除相应的tablespace的。

drop user username cascade

  


设置数据库字符集
conn /as sysdba;
>shutdown immediate; (把database停了)
2
3 >startup mount; (把database重开)
4
5 >alter system enable restricted session;
6
7 >alter system set job_queue_processes=0;
8
9 >alter system set aq_tm_processes=0;
10
11 >alter database open;
12
13 >alter database character set utf8;
14
15 OR
16
17 >alter database character set internal_use utf8;
18
19 >shutdown immediate;
20
21 >startup; (重开正常oracle)

posted @ 2019-02-25 16:05  加菲猫and大白  阅读(1321)  评论(0编辑  收藏  举报