A detailed explanation of Oracle database user creation method under Linux _oracle

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.