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