Create a tablespace, user, and permission assignment script in Oracle

Source: Internet
Author: User
-- 1. Create tablespace
Create tablespace hmlp datafile 'd: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ hmlp. dbf'
Size 200 m autoextend on next 10 m maxsize unlimited;
Alter database datafile 'd: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ hmlp. dbf' autoextend on;

-- Drop tablespace hmlp including contents and datafiles cascade constraints;

-- 3. create user, associate with temp tablespace and tablespace
Create user hmlpuser identified by beyondsoft
Default tablespace hmlp
Temporary tablespace temp;

-- Alter user hmlpuser identified by beyondsoft
-- Default tablespace hmlp
-- Temporary tablespace temp;

-- Drop user hmlpuser cascade;

-- 4. Grant user to connect, resource and DBA
Grant connect, resource to hmlpuser;
Grant sysdba to hmlpuser;

-- 5. GANT select, update, insert, delete to user on any table
Grant select any table to hmlpuser;
Grant update any table to hmlpuser;
Grant insert any table to hmlpuser;
Grant delete any table to hmlpuser;
Grant all privileges to hmlpuser;

Grant select any dictionary to hmlpuser;

Zookeeper ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Log on to the created table with the user hmlpuser, so that the current user has the permission to access and operate these tables.

Create Table hm_app_error_log
(
Error_date date,
Error_code varchar2 (10 byte ),
Description varchar2 (3000 byte ),
Page_name varchar2 (50 byte ),
Method_name varchar2 (50 byte ),
Line_no varchar2 (4 byte)
) Tablespace hmlp

......

Create unique index hm_user_u01 on hm_user
(Emp_id)
Logging
Tablespace hmlp
Pctfree 10
Initrans 2
Maxtrans 255
Storage (
Initial 1 m
Minextents 1
Maxextents Unlimited
Pctincrease 0
Buffer_pool default
)
Noparallel;

-- Add Constraints

Alter table hm_summ_program_with_cust_ref add (
Constraint hm_prgm_custref_uk
Unique (status, component, program, day_id, cust_ref)
Using index hm_prgm_custref_uk );

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.