For details about how to create Oracle database users in LINUX, linuxoracle
This article analyzes how to create an Oracle database user in LINUX. We will share this with you for your reference. The details are as follows:
1) log on to linux and Log On As an oracle user (if logged on as a root user, use the su-oracle command to switch to an oracle user)
2) First, open the listener command: lsnrctl start, sqlplus/nolog, conn/as sysdba, and then startup (this part of the command is used to open the oracle database)
3) Check the location where the user tablespace is normally placed: execute the following SQL:
SQL> select name from v$datafile;NAME--------------------------------------------------------------------------------E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBFE:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBFE:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBFE:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBFE:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF5 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.DBFONLINE YES SYSAUX E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBFONLINE YES UNDOTBS1 E:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBFONLINE YES USERS E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBFONLINE YES EXAMPLE E:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF5 rows selected
Generally, the preceding SQL statement finds the location of your tablespace file, which is 'e: \ APP \ ADMINISTRATOR \ ORADATA \ ORCL \'.
4) create a user tablespace:
CREATE TABLESPACE test datafile 'E:\APP\ADMINISTRATOR\ORADATA\ORCL\testNS.dbf'size 600M autoextend on next 50m maxsize unlimited;
5) create a user and specify the password and the user tablespace created above.
Copy codeThe Code is as follows: create user testUser identified by abc default tablespace test;
6) grant permissions
Copy codeThe Code is as follows: grant connect, resource, dba to testUser;
After the above operations, we can use testUser/abc to log on to the specified instance and create our own table.
I hope this article will help you with Oracle database programming.
Articles you may be interested in:
- How to create databases and users in oracle
- How to modify the username and password of an oracle Database
- The Oracle Method for deleting all tables under the current user applies to having or having no Delete permission
- Example of oracle user creation/deletion (oracle user deletion commands and authorization)
- Use shell scripts to delete tablespaces, create tablespaces, and delete users in oracle.
- How Does oracle delete users and provide solutions?
- How to add and authorize users, change passwords, unlock, and delete users in Oracle
- Oracle command line deletes and creates user code
- How to delete users and tablespaces in Oracle in Linux