Create Table space and users in Oracle

Source: Internet
Author: User

-- Create Table space mytest

Create tablespace mytest

Datafile '/u01/APP/Oracle/oradata/healthybox/mytest01.dbf' size 200 m
Extent management local;

-- Create user Tester
Create user tester identified by Tester
Default tablespace mytest;

-- Assign the following Permissions

Grant connect, DBA to Tester;

Grant exp_full_database, imp_full_database, resource, create any sequence to Tester;

Grant create any trigger, create any view, create table, drop any view to Tester;

Grant exp_full_database, imp_full_database, resource, create any sequence to Tester;

-- Create an auto-increment Field

Create sequence studentid_sequence -- create a sequence named userid_sequence
Increment by 1 -- auto-increment by 1 each time
Start with 1 -- auto-increment from 1
Nomaxvalue -- no maximum value
Nocycle -- non-circular

Insert into student (ID, stdname, stdnum) values (studentid_sequence.nextval, 'ruby', 22 );

-- It can also be written in the trigger to implement

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.