Oracle数据库中创建Schema的过程可以用代码来实现,本文我们就介绍了一个Oracle数据库创建Schema的代码示例,希望能够对您有所帮助。
首先执行下面的代码:
- clear screen;
- disconn;
- conn / as sysdba;
- drop user USER CASCADE;
- DROP TABLESPACE USER_INDX including contents and datafiles;
- DROP TABLESPACE USER_TS_TABLES including contents and datafiles;
- DROP TABLESPACE USER_TEMP including contents and datafiles;
- CREATE TABLESPACE USER_INDX
- NOLOGGING
- DATAFILE 'D:\APP\ADMINISTRATOR\ORADATA\ORCL\USER_INDX' SIZE 5120K AUTOEXTEND ON
- NEXT 32m maxsize 4096m
- EXTENT MANAGEMENT LOCAL
- ONLINE
- SEGMENT SPACE MANAGEMENT AUTO;
- CREATE TABLESPACE USER_TS_TABLES
- NOLOGGING
- DATAFILE 'D:\APP\ADMINISTRATOR\ORADATA\ORCL\USER_TS_TABLES' SIZE 5120K AUTOEXTEND ON
- NEXT 32m maxsize 4096m
- EXTENT MANAGEMENT LOCAL
- ONLINE
- SEGMENT SPACE MANAGEMENT AUTO;
- CREATE TEMPORARY TABLESPACE USER_TEMP
- TEMPFILE 'D:\APP\ADMINISTRATOR\ORADATA\ORCL\USER_TEMP' SIZE 5120K AUTOEXTEND ON
- NEXT 32m maxsize 8192m
- EXTENT MANAGEMENT LOCAL;
- create user USER IDENTIFIED BY USER
- default tablespace USER_TS_TABLES
- temporary tablespace USER_TEMP
- quota unlimited on USER_TS_TABLES;
然后执行一下的代码:
- GRANT CONNECT,RESOURCE,IMP_FULL_DATABASE TO USER;
- disconn;
- pause;
- conn USER/USER;
- @D:\0706\start.ddl;
- disconn;
关于Oracle数据库创建Schema的代码示例就介绍到这里了,希望本次的介绍能够对您有所收获!
【编辑推荐】
- Oracle数据库rman环境配置详解
- Oracle数据库不能使用索引的原因定位
- Oracle数据库rman常用命令的使用示例
- Oracle性能分析工具statpack安装使用详解
- 如何查看和修改Oracle数据库服务器端的字符集