This article analyzes the Oracle database user creation method under Linux. Share to everyone for your reference, specific as follows:
1 login to Linux, login with Oracle (if root is logged in, switch to Oracle user after login with su-oracle command)
2 first to open the Listener command as follows: Lsnrctl start, then Sqlplus/nolog, then Conn/as sysdba, then startup (this part of the command is used to open the Oracle database)
3 View the location where we normally place the user table space: Execute the following sql:
Sql> select name from V$datafile;
NAME
--------------------------------------------------------------------------------
E:\APP\ Administrator\oradata\orcl\system01. DBF
E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01. DBF
E:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01. DBF
E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01. DBF
E:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01. DBF
5 rows selected
or the following SQL statement:
Sql> select Status,fuzzy,tablespace_name,name from V$datafile_header;
STATUS FUZZY tablespace_name NAME
---------------------------------------------------------------------- ----------------------------------------------------
ONLINE YES SYSTEM E:\APP\ADMINISTRATOR\ORADATA \orcl\system01. DBF
ONLINE YES sysaux E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01. DBF
ONLINE YES UNDOTBS1 E:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01. DBF
ONLINE YES USERS E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01. DBF
ONLINE YES EXAMPLE E:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01. DBF
5 rows selected
The top of the SQL generally will be your user table space file location to find out, here is ' E:\APP\ADMINISTRATOR\ORADATA\ORCL\ '.
4 Create user table space:
CREATE tablespace test datafile ' E:\APP\ADMINISTRATOR\ORADATA\ORCL\testNS.dbf '
size 600M autoextend on next 50m MaxSize Unlimited;
5 Create the user, specify the password and the user table space created above
Copy Code code as follows:
CREATE USER TestUser identified by ABC DEFAULT tablespace test;
6) Granting of authority
Copy Code code as follows:
Grant CONNECT,RESOURCE,DBA to TestUser;
After that, we can create our own table by using the TESTUSER/ABC login to specify the instance.
I hope this article will help you with your Oracle database program design.