The following mydata is the user name and database name. In this way, you do not need to create an instance or use the orcl Sid.
====================================== Script start ================== ====================
Set echo off
Prompt
Prompt specify password for mydata as parameter 1:
Define pass = & 1
Prompt
Prompt specify default tablespeace for mydata as parameter 2:
Define TBS = & 2
Prompt
Prompt specify temporary tablespace for mydata as parameter 3:
Define ttbs = & 3
Prompt
Prompt specify password for sys as parameter 4:
Define pass_sys = & 4
Prompt
Prompt specify Log Path as parameter 5:
Define log_path = & 5
Prompt
-- The first dot in the spool command below is
-- The SQL * Plus concatenation character
Define spool_file = & log_path.mydata_main.log
Spool & spool_file
Rem ============================================== ======================
Rem cleanup Section
Rem ============================================== ======================
Drop user mydata cascade;
Rem ============================================== ======================
Rem create user
Rem tmydataee separate commands, so the create USER command
REM will succeed regardless of the existence of
Rem demo and temp tablespaces
Rem ============================================== ======================
Create user mydata identified by & pass;
Alter user mydata default tablespace & TBS
Quota unlimited on & TBS;
Alter user mydata temporary tablespace & ttbs;
Grant create session, create view, alter session, create sequence to mydata;
Grant create synonym, create database link, resource to mydata;
Rem ============================================== ======================
Rem grants from sys Schema
Rem ============================================== ======================
Connect sys/& pass_sys as sysdba;
Grant execute on SYS. dbms_stats to mydata;