Initialize the bashshell script for Oracle users and tablespaces

Source: Internet
Author: User
The Linux script has not been written for a long time. Suddenly, you need to write a bashshell script to initialize Oracle users and tablespaces.

The Linux script has not been written for a long time. Suddenly there is a need to write a bash shell script to initialize Oracle users and tablespaces.

Homepage → Database Technology

Background:

Read News

Initialize the bash shell script for Oracle users and tablespaces

[Date: 2013-06-26] Source: Linux community Author: carefree [Font:]

The Linux script has not been written for a long time. Suddenly there is a need to write a bash shell script to initialize Oracle users and tablespaces.

Make a record for future Query

Call method:./user. sh oracle/u01/app/oracle/data_01.dbf/u01/app/oracle/index_01.dbf

The content is as follows:

#! /Bin/bash
#./User. sh oracle/u01/app/oracle/data_01.dbf/u01/app/oracle/index_01.dbf
Sqlplus-s system/$1 <
Create tablespace data_01
LOGGING
DATAFILE '$ 2' SIZE 5 M
Autoextend on next 20000 k maxsize 20000 M EXTENT MANAGEMENT LOCAL
Segment space management auto;

Create tablespace index_01
LOGGING
DATAFILE '$ 3' SIZE 5 M
Autoextend on next 20000 k maxsize 20000 M EXTENT MANAGEMENT LOCAL
Segment space management auto;

Create user db_hyjzw PROFILE "DEFAULT"
Identified by db_hyjzw default tablespace data_01
QUOTA UNLIMITED
ON data_01
Account unlock;
GRANT "CONNECT" TO db_hyjzw;
GRANT "DBA" TO db_hyjzw;
Alter user db_hyjzw quota unlimited ON index_01;
Exit
EOF

  • 0
  • ORA-01157 and ORA-01110 problems at Oracle Database startup

    Oracle order by sorting Optimization

    Oracle tablespace

    Image Information

    View All comments in this article (0)

    Comments

    Latest Information

    Popular this week

    Introduction to Linux community-advertisement service-website map-help Info-contact us
    The articles published on this site (LinuxIDC) do not mean that they agree with the statement or description. They only provide more information and do not constitute any suggestions.


    Copyright©2006-2014 Linux community All rights reserved Zhejiang ICP backup No. 06018118

    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.