Oracle DatabaseMediumCreate SchemaThe process can be implemented using code. This article describes a sample code for creating a Schema for an Oracle database, hoping to help you.
First, execute the following code:
- 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;
Then run the following code:
- GRANT CONNECT,RESOURCE,IMP_FULL_DATABASE TO USER;
- disconn;
- pause;
- conn USER/USER;
- @D:\0706\start.ddl;
- disconn;
The sample code for creating a Schema in an Oracle database is introduced here. I hope this introduction will be helpful to you!