销售电话: 1-800-867-1380

Creating an Oracle Database 12c virtual machine in Windows Azure

更新时间: 2013年11月

The following example shows you how you can create a virtual machine based on a Microsoft-provided Oracle Database 12c image running on Windows Server 2012 in Windows Azure.

To create an Oracle Database 12c virtual machine in Azure

  1. Log in to the Windows Azure Management Portal.

  2. Click New, click Compute, click Virtual Machine, and then click From Gallery.

  3. Select Oracle Database 12c Standard Edition (Preview) on Windows Server 2012 or Oracle Database 12c Enterprise Edition (Preview) on Windows Server 2012, review the information about this image (such as minimum recommended size), and then click Next.

  4. Specify a value for Virtual Machine Name.

  5. Specify a size for the VM.

  6. Specify a user name for the VM. Note that this user is for remotely logging into the VM; this is not the Oracle database user name.

  7. Specify and confirm a password for the VM, and then click Next.

  8. For Cloud Service, select Create a new cloud service.

  9. Provide a unique value for Cloud Service DNS Name.

  10. Select a region appropriate for your application.

  11. For Storage Account, select Use an automatically generated storage account.

  12. For Availability Set, select (None), and then click Next.

  13. Do not add any endpoints at this time. Click Complete, and the process of creating a virtual machine will begin. After the virtual machine has a status of Running, proceed to the next step.

To create your database using the Oracle Database 12c virtual machine in Azure

  1. Log in to the Windows Azure Management Portal.

  2. Click Virtual Machines.

  3. Click the name of the virtual machine that you want to log in to.

  4. Click Connect.

  5. Respond to the prompts as needed to connect to the virtual machine. When prompted for the administrator name and password, use the values that you provided when you created the virtual machine.

  6. Create an environment variable named ORACLE_HOSTNAME with its value set to the computer name of the virtual machine. You can create an environment variable using the following steps:

    1. Click Windows Start, type Control Panel, click the Control Panel icon, click System and Security, click System, and then click Advanced system settings.

    2. Click the Advanced tab, and then click Environment Variables.

    3. Under the System variables section, click New to create the variable.

    4. In the New system variable dialog, enter ORACLE_HOSTNAME for the name of the variable, and enter the computer name of the virtual machine as the value. To determine the computer name, open a command prompt and run SET COMPUTERNAME (the output of that command will contain the computer name).

    5. Click OK to save the new environment variable and close the New system variable dialog.

    6. Close the other dialog boxes that were opened by the control panel.

  7. Click Windows Start, and then type Database Configuration Assistant. Click the Database Configuration Assistant icon.

  8. Within the Database Configuration Assistant wizard, provide values as needed for each dialog box step:

    1. Step 1: Click Create Database and then click Next.

      创建数据库
    2. Step 2: Enter a value for Global database name. Enter and confirm a value for Administrative Password; this password will be for your Oracle database SYSTEM user. Uncheck Create As Container Database. Click Next.

      默认配置
    3. Step 3: The Pre-Requisites check should proceed automatically, advancing to Step 4.

    4. Step 4: Review the Create Database – Summary options, and then click Finish.

      创建数据库摘要
    5. Step 5: The Progress Page will report the status of your database creation.

      “进度”页
    6. After your database is created, you’ll have the option to use the Password Management dialog. Modify password settings if needed for your requirements, and then close the dialog boxes to exit the Database Configuration Assistant wizard.

To confirm your database is installed

  1. Still logged in to your virtual machine, start a SQL Plus command prompt: Click Windows Start, then type SQL Plus. Click the SQL Plus icon.

  2. When prompted, log in using the user name of SYSTEM and the password that you specified when you created the Oracle database.

  3. Run the following command at the SQL Plus command prompt:

    select * from GLOBAL_NAME;
    
    The result should be the global name of the database that you created.

    SQL Plus

Allowing your database to be reached remotely

To allow your database to be reached remotely (for example, from a client computer running Java code), you’ll need to start the database listener, open port 1521 in your virtual machine’s firewall, and create a public endpoint for port 1521.

Start the database listener

  1. Log in to your virtual machine.

  2. Open a command prompt.

  3. At the command prompt, run the following:

    lsnrctl start
    

(You can run lsnrctl status to check the status of the listener. When you want to stop the listener, you can run lsnrctl stop.)

Open port 1521 in your virtual machine’s firewall

  1. While still logged in to your virtual machine. click Windows Start, type Windows Firewall with Advanced Security, and then click the Windows Firewall with Advanced Security icon. This opens the Windows Firewall with Advanced Security management console.

  2. Within the firewall management console, click Inbound Rules in the left hand pane (if you don’t see Inbound Rules, expand the top node in the left hand pane), and then click New Rule in the right hand pane.

  3. For Rule Type, select Port and click Next.

  4. For Protocol and Port, select TCP, select Specific local ports, enter 1521 for the port, and then click Next.

  5. Select Allow the connection and click Next.

  6. Accept the defaults for the profiles for which the rule applies and click Next.

  7. Specify a name for the rule and optionally a description, and then click Finish.

Create a public endpoint for port 1521

  1. Log in to the Windows Azure Management Portal.

  2. Click Virtual Machines.

  3. Click the name of the virtual machine that you’re using for your Oracle Database virtual machine.

  4. Click Endpoints.

  5. Click Add.

  6. Ensure Add Standalone Endpoint is checked and click Next.

  7. Specify a name for the endpoint, use TCP for the protocol, use 1521 for the public port, and use 1521 for the private port.

  8. Click Complete.

Enabling Oracle Database Enterprise Manager remote access

If you want to enable remote access to Oracle Database Enterprise Manager, open port 5500 in your firewall, and create a virtual machine endpoint for 5500 in the Windows Azure management portal (using the steps shown above for opening port 1521 and creating an endpoint for 1521). Then, to run the Oracle Enterprise Manager from the remote computer, open a browser to the URL in the form of http://<<unique_domain_name>>:5500/em. (You can determine the value for <<unique_domain_name>> within the Windows Azure Management Portal by clicking Virtual Machines and then selecting the virtual machine that you are using to run Oracle Database).

Additional resources

Now that you’ve set up your virtual machine and created your database, see the following topics for additional information.

另请参阅

本文是否对您有所帮助?
(1500 个剩余字符)
感谢您的反馈
显示:
© 2014 Microsoft