Looking for:
Ibm data studio for windows 10 64 bit2 Getting Started with IBM Data Studio for DB2 - . Ibm data studio for windows 10 64 bit
When the data is fragmented B. After many selects on the data C. After many updates on the data D. All the data B. Only the modified data after the last full backup C. Only the modified data after the full or incremental backup D. Only the modified data after any kind of backup E. It can also include stored procedures, user-defined functions and Data Web Services, which are described in subsequent chapters. Figure 4. In this chapter, we will use the Data perspective for our data development tasks.
The first step is to create a Data Development project. To create a new Data Development project, make sure you are in the Data perspective. You can select an existing connection or create a new one by clicking the New… button. Clicking Next will allow you to specify some application settings like default schema and default path as shown in Figure 4. If you decide to click Finish instead, default values will be used for these settings.
Note: The application process settings available on this wizard depend on the database server you are connecting to. The example show lists the settings available for DB2 servers. The default values for schema and path are generated based on the database server and the connection user ID.
Since all of the tables we will be using from the GSDB database are in the GOSALES schema, you should change the application settings to include that schema in the path and use it as the default schema, too. User assistance is only available when you have an established connection to the database, either in live or offline mode. Data Studio can help you with this as well by providing completion assist for the current path value, as shown in Figure 4.
A list of possible values will pop up, including all database schemas and keywords accepted as valid values for the default path. The subfolders of a project depend on the database server product and version used.
In this book, we describe both approaches, starting first with the editor and then achieving the same result using the SQL Builder. When referencing fully qualified table names, you can get multiple step user assistance, one for the schema name labeled 1 in Figure 4. Statement terminator: You can develop multiple SQL statements in a single SQL Editor window by ending each statement with a statement terminator character. The default terminator is a semi-colon. But you can change that to another character by right-clicking in the contents of the editor and selecting the context menu action Set Statement Terminator.
Once you click Finish, you will notice the new file Script1. The SQL Builder will also automatically open so that you can construct your statements, as shown in Figure 4. You can specify which tables will be included in the statement and, from those tables, select the columns to be returned or used for filtering. Start by following the instructions in the editor to add a table: 1.
Right-click in the middle pane and use the pop-up menu option Add table… to select a table from the database. You can choose them by selecting them directly from the pane that appears when you selected the table.
Expand the status and select the statement you want to see the results for, as shown in Figure 4. With this fundamental background, you are now prepared to do more advanced tasks, such as creating stored procedures, user-defined routines, and Data Web Services, described in subsequent chapters.
List and describe the DB2 application process settings that you can configure when creating a Data Development project. Database Development perspective B. Data perspective C. Database Debug perspective D. Resource E. None of the above. Which objects can be created in a Data Development perspective? Which tool or tools can be used to create SQL scripts? Project Explorer C. SQL Outline D. SQL Results E. None of the above 5 Chapter 5 — Developing SQL stored procedures Stored procedures provide an efficient way to execute business logic by reducing the overhead of SQL statements and result sets that are passed back and forth through the network.
Among the different languages that DB2 supports to write stored procedures, SQL is the language of preference because of its efficiency and simplicity. Moreover, SQL stored procedures are simpler to develop and manage because they have fewer pieces such as JARs or modules. Many people use Data Studio for stored procedure development and debugging. In this chapter, we focus on writing SQL procedures. All database access must go across the network, which, in some cases, can result in poor performance.
Figure 5. To improve application performance, you can create stored procedures that run on your database server. A client application can then simply call the stored procedures MYPROC shown in the figure to obtain results of all the SQL statements that are contained in the procedure. Because the stored procedure runs the SQL statements on the server for you, overall performance is improved. In addition, stored procedures can help to centralize business logic.
If you make changes to a stored procedure, the changes are immediately available to all client applications. Stored procedures are also very useful when deleting or updating large numbers of rows.
You can specify a cursor in a stored procedure, and then loop through the result and delete or update rows. This reduces locking activity and is useful in an OLTP environment. Each data development project is associated with a single database connection. See Chapter 1 for information about downloading and creating the sample and Chapter 2 for information about creating a connection to that database. Chapter 5— Developing SQL stored procedures Data Studio provides helpful wizards, editors and views to productively create, deploy, run, view output, edit and debug stored procedures.
The overview of the steps to develop a stored procedure in Data Studio is shown in Figure 5. The first step is to create the stored procedure. The stored procedure appears in the Data Project Explorer view in the Stored Procedures folder under the project in which you created it. Next, you deploy the SQL procedure. If it is successfully deployed, the SQL procedure can be found in the database when you drill down from the Data Source Explorer.
Next, run the stored procedure for testing purposes. View the output or results from your test run. When you run the SQL procedure, you can determine whether the run is successful and whether its result sets are what you expect. You can also test the logic of the routine and the accuracy of output arguments and result sets. When you run a stored procedure from Data Studio, the results of the stored procedure are displayed in the SQL Results view.
At this point, you could optionally use the editor to make changes to the stored procedure depending on your business need. The routine editor is a tool to view and edit the source code. Finally, the last step is to optionally debug the stored procedure, which requires that you actually deploy the stored procedure for debugging. In other words, there is an option on deployment that you must specify to enable the integrated debugger.
By stepping through your code while you are running in debug mode and viewing the results, you can discover problems with your stored procedure and make the necessary changes. In this example we will create the stored procedure illustrated in Listing 5. This stored procedure will accept one input parameter and return one output parameter with the objective of testing a conditional IF statement.
Start Data Studio and open the GettingStarted workspace. Chapter 5— Developing SQL stored procedures 2. The Data Project Explorer holds data development projects that contain data routines like stored procedures, user-defined functions, web services, XML files and SQL scripts.
In the Data Project Explorer view, right-click the white space within the view. Click Next as shown in Figure 5. This is illustrated in Figure 5. You will create a new stored procedure in the stored procedure wizard.
Data Studio supports creating stored procedures in three languages on DB2 9. In this example, you will create a SQL stored procedure. As shown in Figure 5. The stored procedure resource is now added to the Stored Procedures folder in the Data Project Explorer.
Find the new procedure called SP1. Find the new routine editor view called SP1. Your views should resemble Figure 5.
Before you can run your stored procedure against your database, you must deploy it which means compiling the source code on the DB2 server. Select Deploy as shown in Figure 5. In the Deploy Routines window, make sure the target schema is correct and take the rest of the defaults. Select Finish as illustrated in Figure 5. Data Studio provides several views which provide quick access to informational output.
When you deploy a stored procedure in the Data Project Explorer, a stored procedure object will be created in the specified database folder in the Data Source Explorer.
Move on to the next section to run the stored procedure. Select Run. The result set for SP1 is shown in the Result1 tab as illustrated in Figure 5. You will edit your existing stored procedure to include parameters and a conditional IF statement. Then add an input parameter, an output parameter and an IF statement as shown in Figure 5. In the Data perspective tool bar, click on the File Save button. Move on to the next step to deploy the modified stored procedure for debugging.
Before you can debug a stored procedure, you must deploy it for debugging. Follow these steps: 1. Select Deploy. In the Deploy Options window, take all the defaults and select Next as shown in Figure 5.
The Routine Options page lets you enable debugging. To enable debugging, check Enable debugging as shown in Figure 5. Select Debug… as shown in Figure 5. Note: If you have not deployed for debug as described in the previous section, the Debug option on the menu will be grayed out. Go back and deploy the stored procedure with the Enable debugging option checked.
After successfully deploying for debugging, when you run SP1, a window appears that lets you specify the initial values of input parameters. Select OK. Set breakpoints. In the Debug perspective there is a Debug task bar, as shown in Figure 5. Change a variable value.
The Variables view in the Debug perspective lets you change the value of your input parameter. Enter the value 2 as shown in Figure 5. Resume the debugger. If you set a breakpoint, the resume will progress to the next breakpoint. In the Debug editor, the highlighted line and the blue arrow in the left margin indicate the current line of code being debugged.
Step Into the code. In the Debug perspective on the task bar, select the green Resume icon, finish running the stored procedure. View the results. You will view your stored procedure input and output parameter values.
Now you can try it on your own. Note the procedure has one intentional bug for you to discover. The output of the procedure should be 2, 3 or 4.
In addition, by encapsulating the database logic, those stored procedures can be called and used by multiple applications. You also learned about the typical process for developing, deploying, and debugging stored procedures.
Using a default stored procedure, you learned that stored procedures are stored in the Stored Procedures folder of a Data Development project, and you also learned how to edit an existing stored procedure using the Routine editor. After being deployed to the target schema, the stored procedure will appear in the Data Source Explorer for that database connection.
To debug a stored procedure, you must first deploy it for debug, which will activate the debugger. A key fact to remember is that the integrated debugger is only activated when a stored procedure is specifically deployed for debug. Using the Debug perspective, you learned how to set breakpoints and how to resume running a stored procedure after reaching a breakpoint.
You also learned how to change the value of a variable using the Variables view of the Debug perspective.
What is one likely reason that the Debug option would be inactivated grayed out when you right click on the stored procedure in the Data Development project? Which Data perspective view contains the status of the operation you performed?
Which Debug perspective view allows you to change a variable value? Which Debug perspective view lists your breakpoints by line number? Which procedure languages does Data Studio 2. Deploying a stored procedure in Data Studio means which one of the following: A. Source code exists as a file on the DB2 server B. Source code exists as a file in your workspace C.
Compiling the source code in your workspace D. Compiling the source code on the DB2 server E. Which is the correct order to develop a stored procedure in Data Studio? Create a procedure, view the output or results, deploy a procedure, run a procedure, debug a procedure Chapter 5— Developing SQL stored procedures B.
Create a procedure, debug a procedure, deploy a procedure, run a procedure, view the output or results, C. Create a procedure, deploy a procedure, run a procedure, view the output or results, debug a procedure D. Create a procedure, deploy a procedure, view the output or results, run a procedure, debug a procedure E. View the status of running your stored procedure in which view in the Data perspective? SQL Results B. SQL Editor E. Which of the following icons enables you to resume running the stored procedure after a breakpoint?
Data Web Service provides a tooling and runtime framework that makes it easy to create Web services based on database operations, like SQL statements and stored procedure calls, using a simple drag and drop action. All Web service artifacts are generated by Data Studio tooling. The generated Web services can be directly deployed to an application server and tested with the built-in Web Services Explorer.
You do not need to download anything other than the server itself. Appendix E contains information that can help you with different situations, such as options for consuming Web services using different clients, customizing the messages, and much more. There are a multitude of materials on the Web about Web services, and you can also refer to the ebook entitled Getting Started with Web 2.
In summary, however, Web services are designed to allow for communication between machines in a loosely coupled fashion. Data Web Services, in particular, refer to the ability to wrap Web services around the logic provide by the database. For example, you might already have a SQL script or stored procedure that provides business logic for returning the current price of a particular item in inventory from the database.
Using Data Web Services, you are simply making it much easier for a Web application or other client to invoke that capability, perhaps even as simple as putting the HTTP request in a Web browser.
Data Studio and Optim Development Studio supports the development and deployment of Data Web Services without you having to write a single line of code.
Figure 6. For example, there is a query to return all information about an employee when an employee number is provided. There is an update statement to update the first name of an employee based on an employee number; there is a stored procedure that does some bonus calculations, and there is an XQuery that is retrieving information from an XML document.
Using Data Studio, these operations can be converted to data Web services without any coding on your part.
A few clicks are all you need to have the Data Web Service created for you. Create the service 2. Test the service. The service runtime artifacts are packaged as a Java EE Web application. You can apply additional settings for security, monitoring, logging and so on during the deployment phase. There is no manual coding necessary. You can manipulate the XML message format by assigning an XSL script, perhaps if your messages need to follow a particular industry standard format or if you want to generate an HTML document from the contents of the message.
Accept all preset selections, as shown in Figure 6. Select Next. You will receive a warning message because this version is a 1. You might need the Administrator ID and Administrator Password at a later time when you try to log on to the Administration console from within or outside of Data Studio. You have successfully added the WebSphere Application Server Community Edition instance to your Data Studio, and the server definition also appears in the lower right corner of your Data Studio window as shown Figure 6.
All you need is an active connection to your DB2 instance and a Data Development project based on that connection. Typically a Web service represents a set of operations with business logic which are grouped together because they are related — mainly from a business level perspective, but also for other reasons like security requirements, data structures, quality of service, and so on.
In the database world, stored procedures are the prime candidates to become Web service operations since they can contain a significant amount of business logic. The SQL statements and stored procedures used for this example are relatively simple. The logic is kept simple since we focus on how to add a stored procedure to a Web service rather than the stored procedure programming itself. We use SQL stored procedures here, but you can add procedures written in any language to a Web Service.
It has only input and output parameters. Using the information you learned in Chapter 5, create the following procedure you can cut and paste the text below into the SQL procedure editor. It returns a result set containing all products from the catalog for a given product type. For Web services both notations work, but the named parameter markers are preferable since the names will be used for the input parameter names of the resulting Web service operation.
If question mark notation is used the parameter names are just a sequence of p1, p2, …, pN. It looks to the underlying operating system or LDAP for authentication.
Your db2admin account is this account. That being said Windows introduces a different security scheme. Philip Nelson. It has been totally stable. You'll not notice a lot of difference in functionality if you've been keeping your 4. If you've not been applying 4. However the big thing about it is that the underlying Eclipse version has been brought up to date.
This has two main benefits for us. But more importantly for us, it brings the Eclipse to a version where lots of the plugins we want to use are going to continue working - we were starting to struggle with a lot of plugins, particularly those for the various source control packages we use since the versions for the Eclipse in 4.
This new version has fixed these problems. Incidentally, I only discovered after I'd upgraded my first installation in situ one sometimes gets carried away and reads the release notes afterwards that you are supposed to do a clean install rather than installing over 4.
I've done both and not had a problem with either approach. There will be an update to Installation Manager first in either case. I guess if you have problems then you'll probably be asked by support to do a clean install, but that is not really a big deal. Key point is that I've never experienced any stability issues with DS 4. Phil On 6 February at , Myron Miller. Posted Oct 09, AM. Sincerely, Mirco. Chapter 1 — Overview and installation Figure 1. A successful install. From the success screen shown in Figure 1.
You will be asked to select a Workspace name. Enter GettingStarted as the name of your workspace as shown in Figure 1. Note: A workspace is a location for saving all your work, customizations, and preferences.
Your work and other changes in one workspace are not visible if you open a different workspace. The workspace concept comes from Eclipse. Chapter 1 — Overview and installation 37 You will see links to online resources and to information about connecting to a database and a tutorial on starting a data development project.
Feel free to explore some of these materials, or go ahead and click on the X as shown in Figure 1. After you close the Welcome screen, the default perspective comes up. A view shows your resources, which are associated with editors. The default perspective for Data Studio is the Data perspective as shown in Figure 1. You can see the names of the various views there including Data Project Explorer and Outline. Note: If by some chance you already had a workspace named GettingStarted, it would appear with the default views under which you had previously saved it.
This concept is from Eclipse, so if you are familiar with Eclipse, you may skip this section. The Workbench aims to achieve seamless tool integration and controlled openness by providing a common paradigm for the creation, management, and navigation of workspace resources.
Each Workbench window contains one or more perspectives. Perspectives contain views and editors and control what appears in certain menus and tool bars based on a certain task or role. So you will see different views and tasks from the Debug perspective for Java debugging than you will for the Data perspective.
One way to open a different perspective is to click on the icon shown below in Figure 1. Chapter 1 — Overview and installation 39 As you can see by comparing Figure 1. The outline in this case, for example, would work with Java source code in the editor.
The explorer shows Java packages as opposed to database objects. Note: For more information about perspectives and views, see the ebook Getting Started with Eclipse. As we described earlier, views are the windows you see on workbench such as Data Source Explorer and Properties. A view is typically used to navigate a hierarchy of information, open an editor, or display properties for the active editor.
The changes that you make to the views their sizes and positions , and the resources that you create in the views are saved in your workspace, as we mentioned previously. Chapter 1 — Overview and installation 41 The views shown in Figure 1.
Data Source Explorer This view allows you to administer a database. It automatically displays detected databases, but you can add new database connections. Properties This view shows the properties of the object currently selected in the workspace. For some objects, you can use this view to edit properties, such as making changes to database objects selected in the Data Source Explorer. From this view you can also see the SQL Results tab, which brings up that view, described below.
Outline Displays an outline of a structured file that is currently open in the editor area and lists structural elements. Table 1. See Figure 1. Chapter 1 — Overview and installation 43 We encourage you to play around with the views and perspectives in the Workbench. For people not familiar with Eclipse, it can seem a bit strange to have views appearing and disappearing.
If you get to the point where you just want it back to the way it was before you started playing, you can reset the perspective from the Window menu as shown in Figure 1. The next time you open the Perspective, it will be restored to the default layout.
Install Data Studio following the instructions in this chapter. Spend some time getting comfortable with the Data Studio Workbench. For example: Change to the Data perspective. Close the Outline view. Minimize and maximize some of the view windows. Reset the Data perspective to its default setting. Explore the product documentation. Read the product overview and take the relevant tutorials. The relevant product Chapter 1 — Overview and installation 45 overview and tutorials for Data Studio are highlighted above, but you should explore other topics in the task-oriented navigation on the left.
There is an active discussion forum at www. You will learn more about some of these other products and capabilities in Chapter 8. Installation instructions for the stand-alone package are described in Appendix C. We also reviewed how to navigate the Eclipse Workbench for Data Studio, including how to open up different perspectives and how to manipulate views in a perspective. What open source platform is Data Studio tooling built on? True or false: Data Studio can be used at no charge with supported databases.
Which of the following development capabilities is not included in Data Studio? NET development D. Data Web Services development Which of the following database administrative capabilities is provided in Data Studio? Browse data objects and view their properties B. Recover databases C. Create, alter, and drop database objects D.
Authorize users to access database objects E. All of the above 8. Which of the following correctly reflects the downloadable package options for the Data Studio product?
Binary and source B. Free and chargeable E. None of the above 9. What is the name of the Eclipse view used to browse of the projects that hold SQL scripts, Data Web Services artifacts, and stored procedures? Thin Client B. Data Source Explorer C.
Data Project Explorer D. Outline E. None of the above In which Eclipse view do results of SQL operations appear? Data Source Explorer B. Properties C. Editor E. This chapter discusses how to manage your DB2 database environment using Data Studio. It also assumes you are using the IDE package of Data Studio, although for database administration tasks, the capability is the same in the standalone package. In this chapter you will learn: How to stop and start a DB2 instance How to create and connect to a database.
How to create tables, views and indexes. How to manage users and grant them access to database objects. Note: This book does not explain basic DB2 concepts, but shows you how to work with them. There are other responsibilities such as complying with data privacy requirements that are beyond the scope of Data Studio but are covered in other IBM solutions.
You can read more about this in Chapter 8. This chapter briefly explains some basic things DBAs need to know need to know, such as managing instances and connections, and then goes into managing objects, views and indexes and granting privileges. In the next chapter, we will describe tasks required to support availability and maintenance, such as managing table spaces, updating statistics, importing and exporting data, managing user privileges, managing buffer pools, and so on.
You may notice that this view is similar in many ways to the Data perspective, and you can do the same tasks in the Data perspective; however, the Database Administration perspective is tailored to suit the needs of DBAs and is laid out to provide a more straightforward user interface for those tasks.
Figure 2. For more details regarding the perspectives and their views refer to Chapter 1. This spike can last for a few seconds.
The keystroke activity was high; that is, open a notepad, write in it, and close the notepad every three seconds. Resources are needed only on manager. No resources are required on target servers. There is a spike in CPU and memory utilization whenever recorded video is converted. This spike can last for a few minutes per video conversion.
Nothing herein should be construed as constituting an additional warranty. Micro Focus shall not be liable for technical or editorial errors or omissions contained herein.
❿ ❿
Comments
Post a Comment