1,表空间
(1)创建一个表空间,表空间名字叫test_tablespace
- create tablespace test_tablespace
(2)表空间的文件存放的路径以及文件的名字
- datafile 'D:\oracle\product\10.2.0\db_1\oradata\test_tablespace.dbf'
(3)表空间的大小以及其自动扩展的大小
- size 200m autoextend on next 10m maxsize 20480m;
(4)与上面类似,创建一个临时表空间test_tablespace_tmp
(5)彻底删除表空间(表空间以及表空间文件),可以用pl/sql中的tablespace找到test_tablespace,右键删除,或者用sql删除(级联删除),建议不要这样使用
- drop tablespace test_tablespace including cascade;
(6)只删除表空间
- drop tablespace test_tablespace;
(7)只删除表空间,没有删除表空间文件,然后重建这个表空间
- create tablespace test_tablespace
- datafile 'D:\oracle\product\10.2.0\db_1\oradata\test_tablespace.dbf'
- size 200m autoextend on next 10m maxsize 20480m;
2,账户
(1)创建用户,名为test,其密码为test
- create user test identified by test
(2)修改用户名。有两个方法,一是用exp的方法将用户信息导出,然后删掉这个用户,再重新创建一个新用户,将用户信息导入到新用户里面。第二个方法是:
- 以dba登陆
- conn / as sysdba;
- 查询需要更改的用户名(必须大写)
- select user#,name,password from user$ where name='TEST';
- USER# NAME PASSWORD
- ---------- ------------------------------ ---------------------------
- 78 TEST 21EDA78F89D6FACD
- update user$ set name='TEST_BAK' where user#=78;
用户指向默认的表空间
转载于:https://blog.51cto.com/orcldba/884142