Oracle creates databases and users
In the past, mysql and SQL server were mostly used during development, while Oracle was rarely used and unfamiliar. mysql and SQL server were used in a similar way, the usage of Oracle is different from that of Oracle. When creating a database, Oracle needs to correspond to one user. Generally, the database corresponds to one user, mysql and SQL server can directly create a database by using the create databse "Database Name", while creating a database in Oracle requires the following three steps:
1. Create two database files
2. Create a ing between the user and the file created above.
3. add permissions to users
1. Create two database files (monitor. dbf and monitor_temp.dbf)
Create tablespace monitor logging datafile 'e: \ app \ owner \ oradata \ orcl \ monitor. dbf'
SIZE 100 m autoextend on next 32 m maxsize 500 m extent management local;
Create temporary tablespace monitor_temp tempfile 'e: \ app \ owner \ oradata \ orcl \ monitor_temp.dbf'
Size 100 m autoextend on next 32 m maxsize 500 m extent management local;
2. Create a ing between the user and the file created above (the user name is monitor and the password is monitor)
Create user monitor identified by monitor default tablespace monitor temporary tablespace monitor_temp;
3. Add Permissions
Grant connect, resource, dba to monitor;
Grant create session to monitor;
Sometimes database deletion and user deletion are also used. The delete statement is also provided here.
4. delete a database
Drop tablespace monitor including contents and datafiles;
5. delete a user
Drop user monitor cascade;
Hands-on test is available.