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 <EOF
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