Oracle creates tablespaces and users

Source: Internet
Author: User

--- Create a tablespace in Oracle ---
Create tablespace ssitablespace
Datafile
'/Opt/Oracle/DB/oradata/iptvrpt/lv_ssitablespace1tbs' size 20 m autoextend on next 10 m maxsize 100 m
Extent management local segment space management auto;

--- Create a user in Oracle ---
Create user SSI identified by SSI default tablespace ssitablespace temporary tablespace temp;
Grant connect to SSI;
Grant resource to SSI;
Grant DBA to SSI;
Alter profile default limit failed_login_attempts unlimited password_life_time Unlimited

 

---- Use an SSI user to log on -----

@ Database. SQL

---- Complete -----

 

You can also write a batch.

Create the createtablespaceanduser. Sh file.

#! /Usr/bin/KSh

 
Net_svr = "BSS"
Export oracle_sid = $ net_svr
Link_str = "/As sysdba"

Echo "create tablespaces start ......"
Sqlplus "$ link_str" <eof1

Create tablespace ssitablespace
Datafile
'/Opt/Oracle/DB/oradata/iptvrpt/lv_ssitablespace1tbs' size 20 m autoextend on next 10 m maxsize 100 m
Extent management local segment space management auto;

 

Create user SSI identified by SSI default tablespace ssitablespace temporary tablespace temp;
Grant connect to SSI;
Grant resource to SSI;
Grant DBA to SSI;
Alter profile default limit failed_login_attempts unlimited password_life_time Unlimited

 

Exit

 

Link_str = "ssi/ssi"

Echo "load data start ......."

Sqlplus "$ link_str"

 

@./SQL/data. SQL

Echo "load data finish ......."
Eof1
Echo "create tablespaces end ......"

---- Complete -----

Related Article

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.