Oracle Database Batch File

Source: Internet
Author: User
Tags sqlplus

Directory structure

Init script
|----orcl_sql|----init_user.sql|----tab_home.sql        |----Tab_user.sql |----init.bat


Init.bat

@echo Off@echo---------------------------------------------------------------------@echo ^|               ^| @echo ^|                                                                   Roadside parking System Remote initialization database scripting tool ^| @echo ^| ^| @echo---------------------------------------------------------------------@echo ^|if exist orcl_sql/ Parmeter.sql (CD orcl_sqldel-p PARMETER.SQLCD ...) Set Ip=127.0.0.1set port=1521set sid=orclset managername=systemset password=adminset newUserName=testset newUserPWD=   Test@echo ^|   Ip:127.0.0.1@echo ^|   Port:1521@echo ^|   Sid:orcl@echo ^|   Managername:system@echo ^|   Password:admin@echo ^|   Newusername:test@echo ^|   Newuserpwd:testrem set/p ip=^|   Ip:rem set/p port=^|   Port:rem set/p sid=^|   Sid:rem set/p managername=^|   Managername:rem set/p password=^|   Password:rem set/p newusername=^|   Newusername:rem set/p newuserpwd=^| Newuserpwd: @echo DefiNE username=%newusername%> orcl_sql/parmeter.sql@echo define password=%newuserpwd%>> orcl_sql/parmeter.sql @echo @orcl_sql/init_user.sql>> orcl_sql/parmeter.sqlif not exist C:\TABLESPACE (MD C:\TABLESPACE) Sqlplus% managername%/%password%@%ip%:%port%/%sid% @orcl_sql/parmeter.sqlif exist orcl_sql/parmeter.sql (CD Orcl_sqldel-p Parmeter.sqlcd..)                                                      Sqlplus%newusername%/%newuserpwd%@%ip%:%port%/%sid% @orcl_sql/tab_home.sql@echo ^|                                                                   @echo---------------------------------------------------------------------@echo ^|               ^| @echo ^|                                                                   Roadside parking System Remote Initialize database script end ^| @echo ^| ^| @echo---------------------------------------------------------------------Pause



Init_user.sql

CREATE tablespace tablespance_park datafile ' C:\TABLESPACE\PARK. DBF ' SIZE 1000M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;     CREATE USER &username identified by &password DEFAULT tablespace Tablespance_park;  GRANT Create Table,create view,create TRIGGER, CREATE sequence,create PROCEDURE to &userName; GRANT UNLIMITED tablespace to &userName; GRANT CREATE SESSION to &username;grant Select on V_$statname to &username;grant Select on V_$sesstat to &user Name;grant Select on V_$session to &username;grant Select on V_$mystat to &userName; EXIT;

</pre><strong><span style= "font-size:24px" ></span></strong><pre name= "code" Class= "plain" >

Tab_home.sql

@orcl_sql/tab_user.sql@orcl_sql/tab_role.sql@orcl_sql/tab_menu.sql .....



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Oracle Database Batch File

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.