This application claims the benefit of Indian Patent Application Serial No. 20204104.2576 filed Sep. 30, 2020, which is hereby incorporated by reference in its entirety.
This technique relates generally to database cloning technique, and in particular, to a method and system for cloning database and associated application by creating dynamic script.
Database cloning is a complete and separate copy of the database and its associated application reside in a source server. Cloning of database and associated application is mainly done for development and support purpose and/or to carry out the steps and validate the same before performing upgrade on the database and its associated applications on source server. Presently, there are multiple ways the database and its applications can be cloned.
However, the present technologies require manual execution of commands or group of commands in a script (partial automation) on the respective or multiple servers separately. Further, the scripts are maintained on local file system or shared file system across multiple Servers through Network File System (NFS) mount which poses risk of access and even keeping track of the changes made in the script become difficult. Hence, there is a need of an improved technology for cloning database and associated application.
The present technique overcomes the above mentioned drawbacks and others by having a central repository connected with source and Multiple target servers through SSH protocol.
According to an example of the present technique, a method for cloning a database and associated application is disclosed. The method includes connecting a central server to a source server and one or more target servers through a network. Thereafter, the central server receives at least one input from a device of an end user, wherein the at least one input comprises an identifier of one of the one or more target servers to clone the database and associated application from the source server. After that, one or more parameter values related to the one of the one or more target servers selected by the end user are collected from one or more configuration files stored in a repository of the central server. Further, the method dynamically generates a source specific script to be executed on the source server and one or more target specific scripts to be executed on the one of the one or more selected target servers. Finally, the central server transfers the source specific script to the source server and the one or more target specific scripts to the one of the one or more selected target servers through the network to clone the database and associated application from the source server to the one of the one or more selected target servers.
According to an example of the present technique, a system for cloning a database and associated application is disclosed. The system includes a memory coupled to one or more processors which are configured to execute programmed instructions stored in the memory including, connecting a central server to a source server and one or more target servers through a network; receiving at least one input by the central server from a device of an end user, wherein the at least one input comprises an identifier of one of the one or more target servers to clone the database and associated application from the source server; collecting one or more parameter values related to the one of the one or more target servers selected by the end user from one or more configuration files stored in a repository of the central server; dynamically generating a source specific script to be executed on the source server and one or more target specific scripts to be executed on the one of the one or more selected target servers and transferring the source specific script to the source server and the one or more target specific scripts to the one of the one or more selected target servers through the network to clone the database and associated application from the source server to the one of the one or more selected target servers.
According to an example of the present technique, a non-transitory computer readable storage medium for cloning a database and associated application is disclosed. The computer readable storage medium which is not a signal stores computer executable instructions for connecting a central server to a Source server and one or more target servers through a network; receiving at least one input by the central server from a device of an end user, wherein the at least one input comprises an identifier of one of the one or more target servers to clone the database and associated application from the source server; collecting one or more parameter values related to the one of the one or more target servers selected by the end user from one or more configuration files stored in a repository of the central server; dynamically generating a source specific script to be executed on the Source server and one or more target specific scripts to be executed on the one of the one or more selected target servers and transferring the source specific script to the source server and the one or more target specific scripts to the one of the one or more selected target servers through the network to clone the database and associated application from the source server to the one of the one or more selected target servers.
Various embodiments of the technique will, hereinafter, be described in conjunction with the appended drawings. There is no intention to limit the scope of the technique to such blocks or objects, or to any particular technology. These simplified diagrams are presented by way of illustration to aid in the understanding of the logical functionality of one or more aspects of the instant disclosure and is not presented by way of limitation.
The foregoing has broadly outlined the features and technical advantages of the present disclosure in order that the detailed description of the disclosure that follows may be better understood. Additional features and advantages of the disclosure will be described hereinafter which form the subject of the claims of the disclosure. It should be appreciated by those skilled in the art that the conception and specific embodiment disclosed may be readily utilized as a basis for modifying or designing other structures for carrying out the same purposes of the present disclosure. It should also be realized by those skilled in the art that such equivalent constructions do not depart from the spirit and scope of the disclosure as set forth in the appended claims. The novel features which are believed to be characteristic of the disclosure, both as to its organization and method of operation, together with further objects and advantages will be better understood from the following description when considered in connection with the accompanying figures. It is to be expressly understood, however, that each of the figures is provided for the purpose of illustration and description only and is not intended as a definition of the limits of the present disclosure.
Exemplary embodiments of the present technique provide a method and system for cloning a database and associated application. This technique is also applicable for instances where there is more than one application are associated with the database provided. A Central Server is connected to Source and multiple Target environment over SSH protocol. The Central Server has a user interface through which end user can select the Target environment where the clone needs to be made. Central Server stores Configuration files containing various parameter values associated with the multiple target servers. Once, the end user selects target environment the corresponding parameter values are passed from the Configuration files to a base script stored in the central server. After collecting the parameter values, the central server dynamically generates the scripts to be executed on the source and the selected target server. Finally, the source specific script is sent to the source server and target specific scripts are sent to the target server to clone the database and its associated application.
a) Server Configuration File Parameters (Server_Pass-File):
The first entry of the server_pass-file should point to source server. The entry of the server_pass-file would be as follows:
The examples provided here are only for understanding purpose and not to limit the scope of this disclosure.
b) Database Configuration File Parameters (Database_Pass_File):
c) Common Environment File Parameters (Common_Env.Sh)
Once the central server receives the input from the end user regarding the target server which needs to be cloned, it validates if all the required parameters for the selected target server are defined in server configuration parameters files (server_pass-file) and in database configuration parameter files (database_pass_file). If any of the required parameters is null or not defined then the method will terminate. If all the required parameters are defined, then the central server access configuration parameters files (server_pass-file), database configuration parameter files (database_pass_file) and common environment files (common_env.sh) and collect all required parameters to clone the database and associated application of source server into the selected target server. Referring back to
The source server 406 comprises of source script execution engine 514, database information collection engine 516, application binaries backup engine 518 and application backup transfer engine 520. Source script execution engine 514 executes the script specific for source server received from central server 502. In an exemplary embodiment, if Oracle EBS needs to be cloned, then the script executes the command adpreclone.pl (adpreclone.pl is a standard command provided by Oracle EBS). The execution of the source specific script prepares the source system to be cloned by collecting information about the database by using database information collection engine 516 and creating generic templates and driver files from existing files that contain source-specific hard-coded values. These collected information is sent to the target server 408 through secured protocol which is part of application binaries backup engine 518. The application binaries backup engine 518 backs up the source application binaries using tar command (tar is standard Unix command widely used to create compressed archive files and that can be moved easily from one disk to another disk or machine to machine. It is also used to extract files from archive). The application backup transfer engine 520 transfer the backup taken by application binary backup engine 518 to target server 408 through secured protocol. If any of the step failed in this stage, the process exits with status failure by providing the details.
The target server 408 comprises of target script execution engine 524, target server shutdown engine 526, target server restoration engine 528 and target server post clone configuration engine 530. Target script execution engine 524 executes the target specific script which takes backup of (a) all the global configuration settings information for the database, (b) configuration files that define database addresses for establishing connections using unix cp command (cp is standard Unix command widely used to copying files from one location to another on same machine), (c) dba directories which point to operating system directory on the database server machine for reading and writing files and (d) various initialization parameters (cluster_database, db_file_name_convert, db_file_name_convert in init.ora) which are required in restoration stage. The target server shutdown engine 526 shuts down the application and database services in target server 408. For Stopping the application services, the script is executed on target server 408 which brings down the application services. In an exemplary embodiment of Oracle EBS cloning, the target server executes adstpall.sh (adstpall.sh is Oracle EBS provided instance specific script to stop all the services e.g. Weblogic Admin, Managed Server, Concurrent Manager, Apache and OPMN). Once the application services are down it also clears any process running on the server using fuser (fuser is a Unix utility used to find which process is using a file or a directory). Similarly, For stopping the database the script is executed on target server 408 which brings down the database using shutdown command then start the database in restricted mode and drop the database. This internally cleans up the datafiles on target server 408. target server restoration engine 528 restores the application and database running in the target server 408. For restoring the database, the script is executed on target server which dynamically generate a script which duplicates the database of the source server 406 on to the target server 408 by using a built in utility in the database itself. In an exemplary embodiment of cloning Oracle EBS, RMAN technique is followed. RMAN is a utility built into Oracle databases to automate backup and recovery process and also has the ability to duplicate a database. It also has the ability for configuring multi node database. For restoring the application, the script is executed on target server 408 which first cleans up the old application binaries using Unix rm command (rm command is helpful for removing files or directories). Once the cleanup is completed the application binaries backup which was transferred to the target server 408 from source server 406 is restored using tar command (tar is standard Unix command widely used to create compressed archive files and that can be moved easily from one disk to another disk or machine to machine. It is also used to extract files from archive). Target server post clone configuration engine 530 configures the database and application after restoration process is completed. For database configuration, the target server specific script recreates the dba directories which was backed up by target server execution engine 524. In addition to this, the commands are executed to clear tables which contain source server information and also to populate information of target server which we backed up by target server execution engine 524. In an exemplary embodiment of Oracle EBS cloning, the command FND_CONC_CLONE.SETUP_CLEAN is used to clean the source server information and command adautocfg.sh is used to populate target server information. For application post cloning configuration, the target specific script is executed which uses the templates and driver files those were created by source script execution engine 514 on the target environment. In an exemplary embodiment of Oracle EBS cloning, adcfgclone.pl utility is executed which uses the parameters to configure the target application. It also has the ability for configuring multi node application clusters. If it is multi node application, then it creates pairsfile (pairsfile is a basic text file which has context variables and values) to configure secondary application node (APPHOST2). For this, the already built in utilities in the database and application are used to configure the secondary application node. In an exemplary embodiment of Oracle EBS cloning, txkSetAppsConf.pl utility is used to configure the secondary application node. The target server post clone configuration engine 528 also performs the following actions:
In an exemplary embodiment of Oracle EBS cloning, Oracle utility FNDCPASS is used to change the application password, oracle utility txkManageDBConnectionPool.pl is used to update the application password, script adstpall.sh (already built in utility in Oracle EBS) is used to shutdown the application, script adautocfg.sh (already built in utility in Oracle EBS) is used to populate target server application information and use script adstrtal.sh (already built in utility in Oracle EBS) to start the application server.
A computer system may transmit and receive messages, data, and instructions, including program, i.e., application, code, through its respective communication link 622 and communication interface 614. Received program code may be executed by the respective processor(s) 612 as it is received, and/or stored in the storage device 306, or other associated non-volatile media, for later execution.
In an embodiment, the computer system operates in conjunction with a data storage system 606, e.g., a data storage system 624 that contains a database 620 that is readily accessible by the computer system. The computer system communicates with the data storage system 624 through a data interface 610. A data interface 610, which is coupled to the bus 608, transmits and receives electrical, electromagnetic or optical signals that include data streams representing various types of signal information, e.g., instructions, messages and data. In embodiments of the technique, the functions of the data interface 610 may be performed by the communication interface 614.
Computer system includes a bus 608 or other communication mechanism for communicating instructions, messages and data, collectively, information, and one or more processors 612 coupled with the bus 608 for processing information. Computer system also includes a main memory 602, such as a random access memory (RAM) or other dynamic storage device, coupled to the bus 608 for storing dynamic data and instructions to be executed by the processor(s) 612. The main memory 602 also may be used for storing temporary data, i.e., variables, or other intermediate information during execution of instructions by the processor(s) 612.
The computer system may further include a read only memory (ROM) 604 or other static storage device coupled to the bus 608 for storing static data and instructions for the processor(s) 612. A storage device 606, such as a magnetic disk or optical disk, may also be provided and coupled to the bus 608 for storing data and instructions for the processor(s) 612.
A computer system may be coupled via the bus 608 to a display device 606, such as, but not limited to, a cathode ray tube (CRT), for displaying information to a user. An input device 618, e.g., alphanumeric and other keys, is coupled to the bus 608 for communicating information and command selections to the processor(s) 612.
According to one embodiment of the technique, an individual computer system performs specific operations by their respective processor(s) 612 executing one or more sequences of one or more instructions contained in the main memory 602. Such instructions may be read into the main memory 602 from another computer-usable medium, such as the ROM 604 or the storage device 606. Execution of the sequences of instructions contained in the main memory 602 causes the processor(s) 612 to perform the processes described herein. In alternative embodiments, hard-wired circuitry may be used in place of or in combination with software instructions to implement the technique. Thus, embodiments of the technique are not limited to any specific combination of hardware circuitry and/or software.
The term “computer-usable medium,” as used herein, refers to any medium that provides information or is usable by the processor(s) 612. Such a medium may take many forms, including, but not limited to, non-volatile, volatile and transmission media. Non-volatile media, i.e., media that can retain information in the absence of power, includes the ROM 604, CD ROM, magnetic tape, and magnetic discs. Volatile media, i.e., media that cannot retain information in the absence of power, includes the main memory 602. Transmission media includes coaxial cables, copper wire and fiber optics, including the wires that comprise the bus 608. Transmission media can also take the form of carrier waves; i.e., electromagnetic waves that can be modulated, as in frequency, amplitude or phase, to transmit information signals. Additionally, transmission media can take the form of acoustic or light waves, such as those generated during radio wave and infrared data communications.
The above mentioned description is presented to enable a person of ordinary skill in the art to make and use the technique and is provided in the context of the requirement for obtaining a patent. Various modifications to the preferred embodiment will be readily apparent to those skilled in the art and the generic principles of the present technique may be applied to other embodiments, and some features of the present technique may be used without the corresponding use of other features. Accordingly, the present technique is not intended to be limited to the embodiment shown but is to be accorded the widest scope consistent with the principles and features described herein.
Number | Date | Country | Kind |
---|---|---|---|
202041042576 | Sep 2020 | IN | national |