Oracle database using sqlplus be automatic batch release

Updating applications published in the daily operation and maintenance of the enterprise is a relatively common work, replace the backup file, there will be update databases. This article describes how Oracle database for different applications by automating publishing a turn for the better equipped Taichung sqlplus tool.


Often encountered using PL / SQL graphical tool related Oracle database update operation, such as packages, triggers, stored procedures, and the data in the table view. If a single user on a single database updating small amounts of content, this operation can also be accepted, if the database server is more and want to switch to a different user to update a lot of content, this approach will be relatively inefficient red tape, the face of this scene, to achieve automatic background update is necessary.


How sqlplus in turn by a different Oracle database to complete the update in the background indicate the following:

dcbf7b3628e1a3cd5062b52b9c74d17c

requirements

According to the schematic in the background publish updates of the database requires a certain specification support, simply, is to make very clear sqlplus tool can get the following information:


  • Which instance which server to connect to what account updates?

  • How to account corresponding password should be passed to the command sqlplus?

  • Update that package, stored procedures or views?

  • Are there dependencies between multiple updates before and after?


Update file naming convention

By sqlplus commands to connect to the Oracle database needs to complete an update accounts, passwords, Oracle server's IP address, listening port, instance name, path to update file is located, used as follows:

0079nlvZly1g6udjqhr8nj30j701zdfo.jpg

Where the name, IP address, port, instance name belongs to the publicly available information, this part of the content can be updated along with the type of order and organization to update the file name together


[For example. _ Account _IP_ order instance name _XXX type], example:

01_admin_1.1.1.1_insA_package.pck


Password and related information storage

Information used by the database updates when sqlplus in this embodiment is stored on the sqlplus turn, can be acquired only the root account and password is stored in the form of ciphertext, the ciphertext stored in the password file the following path (document name account ciphertext): . .XXX / .IP address / ciphertext account , database instance name and port number stored in the file in the following path: .YYY / .IP address / instance name. , the entire only the root account can access the path. Examples are as follows:


7b2ee822f8f0e75100d51ea082efd109


Publishing process

Update file relevant norms have been determined well, the publishing process can be used to write a good script (shell or a bat, etc.) files to be updated polling execution, from sqlplus in turn will transfer the contents of the update to the corresponding Oracle server.


In this case combined with Kerry as "application publishing" The SaaS database will streamline the publishing process, call or timed release script to achieve real-time updates. Details below:


1e1a37691cd0985ae18105273634b4af

Oracle server log individually without switching back and forth different accounts, the updating process of the log as shown below:


017d26e31468220ac03387faff89a2e9



other instructions

In this case released by Oracle sqlplus update, you need to have the following premise:

  • Account and password information to be entered in advance into sqlplus in turn (be sure to ensure account security)

  • Oracle server information (IP, port, instance name) also need to enter in advance to turn sqlplus

  • Update file syntax and semantics must be standardized (e.g., end of line ";" number, header end position of the bag body "/") and the like

  • Database, coding sqlplus client as consistent as possible.


Author: Xu Han



This concludes the article ~

I thought of the coming Mid-Autumn Festival it! There is no'm looking forward to it ~

In advance I wish you a happy Mid-Autumn Festival !



Good Man Festival

Business complex data large, wide application how to do? Learn Solutions in distributed transactions!

SaaS design: Automatic start-stop design service examples 

Here select cloud service providers have taken the Raiders, please check ...


Guess you like

Origin blog.51cto.com/11811406/2437208