OCP 11g Chapter 4 exercises, ocp11g Chapter 4 exercises

Source: Internet
Author: User

OCP 11g Chapter 4 exercises, ocp11g Chapter 4 exercises

Exercise 4-1 configure Oracle Net

In this exercise, we will use graphical tools and command line tools to build a complete Oracle Net environment. As a result, you can see the differences between Windows and Linux systems.

1. Create the directory used by the Oracle Net configuration file, and set the location of the TNS_ADMIN variable. Directory pointing to this location does not matter, as long as the Oracle user has the right to create, read, and write data.

In Linux:

Mkdir/u01/oracle/net

Export TNS_ADMIN =/u01/oracle/net

Make sure that all work is performed from the painting with variable settings from now on.

In Windows:

Mkdir d: \ oracle \ net

Create the registry key TNS_ADMIN and set it to the string variable in the registry of the Oracle Home Branch. This is usually HKEY_LOCAL_MACHINE \ SOFTWARE \ ORACLE \ KEY_OraDb11g_home1

2. Run the TNSPING command from the operating system prompt to check whether the variable is read:

Tnsping orcl

Because no file exists in the TNS_ADMIN directory, the error "TNS-03505: Failed to resolve name" will be returned. In Windows, you need to start a new command prompt to find the new TNS_ADMIN value from the registry.

3. start Net Manager. in Linux, run netmgr. in Windows, start it from the "Start" menu. the top line of the Net Manager window displays the location of the Oracle Net file. if this is not a new directory, the TNS_ADMIN variable is set incorrectly.

4. Create a new listener: the Local branch of the Battle card navigation tree. The Listeners item is highlighted, and then click the "+" icon.

5. Enter the listener name "NEWLIST" and click OK.

6. Click Add Address.

7. For Address 1, select "TCP/IP" as the protocol, and enter "127.0.0.1" as the host, and "2521" as the port. Figure 4-11 shows the result.

 

8. Create a Service name: highlight the Service Naming item in the navigation tree, and then click the "+" icon.

9. Enter "NEW" as the NEW service name and click Next.

10. Select "TCP/IP" as the Protocol and click Next.

11. Enter "127.0.0.1" as the host name and "2521" as the port, and then click Next.

12. Enter "SERV1" as the service name and click Next.

13. Click Finish. If you try to perform the test, the test will fail. The result is displayed in Figure 4-12.

14. Click the File and Save Network Configuration menu to Save the Configuration. This will create the listener. ora File and tnsnames. ora File in the TNS_ADMIN directory.

15. Use the editor to check the two files.

The LISTENER. ORA file is as follows:

NEWlIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 2521 ))

)

The TNSNAMES. ora file is as follows:

NEW =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 2521 ))

)

(CONNECT_DATA =

(SERVICE_NAME = SERV1)

)

)

16. Use lsnrctl start newlist from the operating system prompt

17. Use tnsping new in the operating system prompt to test the connection string.

18. Use sqlplus/as sysdba to connect to the database through operating system authentication and ignore any listeners.

19. Set the service_names parameter and local_listener parameter for the running instance (memory only, not set in the parameter file). The new refrigerator listener registers the new service name:

Alter system set service_names = serv1 scope-memory;

Alter system set local_listener = new scope = memory;

Alter system register;

 

20. At the operating system prompt, use lsnrctl service newlist to confirm that the new service has been registered with the new listener.

21. log on using the following code to confirm that the new network environment has taken effect:

Sqlplus system/oracle @ new

 

 

Exercise 4-2 set up a shared server environment

This exercise is a continuation of step 21 in exercise [4-1]. You need to configure the Shared Server and confirm that it can run.

1. Set the dispatchers and shared_servers parameters and register them with the listener. The command is as follows.

Alter system set dispatchers = '(protocol = tcp) (dispatchers = 2)' scope = memory;

Alter system set shared_servers = 4 scope = memory;

Alter system register;

2. query view V $ PROCESS to check that the scheduler and sharing server have been started. Find the processes named S000, S001, S002, S003, D000, and D001.

Select program from v $ process order by program;

3. In the operating system Prompt window, confirm that the scheduler has registered with the listener.

Lsnrctl services newlist

4. connect through the listener and confirm that the connection is performed through the Shared Server mechanism.

Connect system/oracle @ new;

Select d. name, s. name from v $ dispatcher d, v $ shared_server s, v $ circuit c

Where d. paddr = c. dispatcher and s. paddr = c. server;

This query displays the scheduling program connected to the session and the Shared Server process that executes the query.

5. restore to the initial configuration to clean up the environment

Alter system set local_listener = ''scope = memory;

Alter system set service_names = ''scope = memory;

Alter system set dispatchers = ''scope = memory;

Alter system set shared_servers = 0 scope = memory;

Alter system register;

In the operating system Prompt window, use lsnrctl stop newlist to stop the listener.

Unset the TNS_ADMIN variable. in Linux, use export TNS_ADMIN = ''. In Windows, delete the TNS_ADMIN registry key.

 

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.