orale 命令行创建&删除数据库
创建数据库文件
CREATE TABLESPACE MyDataBase LOGGING DATAFILE 'D:\Oracle\database\MyDataBase.dbf' SIZE 00M AUTOEXTEND ON NEXT 3M MAXSIZE 500M EXTENT MANAGEMENT LOCAL;
MyDataBase:数据库名称 D:\Oracle\database\MyDataBase.dbf:数据库文件目录
创建数据库临时文件
create temporary TABLESPACE MyDataBase_temp tempfile 'D:\Oracle\database\MyDataBase_temp.dbf' SIZE 00M AUTOEXTEND ON NEXT 3M MAXSIZE 500M EXTENT MANAGEMENT LOCAL;
MyDataBase_temp:数据库临时文件名称 D:\Oracle\database\MyDataBase_temp.dbf:数据库临时文件目录
创建用户与上述两个文件形成映射关系
CREATE USER username IDENTIFIED BY password DEFAULT TABLESPACE MyDataBase TEMPORARY TABLESPACE MyDataBase_temp;
username:用户名
password:密码
MyDataBase:映射的数据库名称
MyDataBase_temp:映射的数据库临时文件名称
添加用户权限
grant connect,resource,dba to username;
grant create session to username;
删除数据库
conn sys/dwh as sysdba;
drop tablespace MyDataBase including contents and datafiles;
drop tablespace MyDataBase_temp including contents and datafiles;
删除用户
drop user username cascade;
小小测试一枚