可以第一次启动Oracle Database Vagrant框,但不能将其备份

时间:2019-07-11 14:18:41

标签: oracle vagrant

我正在运行vagrant和virtualbox,尝试设置19.3 oracle数据库vagrant框。当我第一次打开包装盒时,要花一些时间,但是会复制数据库(使用现有数据)并设置所有内容。如果必须重新启动计算机,则可以将其重新启动。我明白了:

 ==> oracle-19c-vagrant: Forwarding ports...
        oracle-19c-vagrant: 1521 (guest) => 1521 (host) (adapter 1)
        oracle-19c-vagrant: 5500 (guest) => 5500 (host) (adapter 1)
        oracle-19c-vagrant: 22 (guest) => 2222 (host) (adapter 1)
    ==> oracle-19c-vagrant: Running 'pre-boot' VM customizations...
    ==> oracle-19c-vagrant: Booting VM...
    ==> oracle-19c-vagrant: Waiting for machine to boot. This may take a few minutes...
        oracle-19c-vagrant: SSH address: 127.0.0.1:2222
        oracle-19c-vagrant: SSH username: vagrant
        oracle-19c-vagrant: SSH auth method: private key
    ==> oracle-19c-vagrant: Machine booted and ready!
    ==> oracle-19c-vagrant: Checking for guest additions in VM...
    ==> oracle-19c-vagrant: Setting hostname...
    ==> oracle-19c-vagrant: Configuring proxy environment variables...
    ==> oracle-19c-vagrant: Configuring proxy for Yum...
    ==> oracle-19c-vagrant: Mounting shared folders...
        oracle-19c-vagrant: /vagrant => C:/Users/Matt/Documents/vagrant-boxes/OracleDatabase/19.3.0
==> oracle-19c-vagrant: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> oracle-19c-vagrant: flag to force provisioning. Provisioners marked to run always will still run.

当我尝试连接数据库时,出现此错误:

An existing connection was forcibly closed by the remote host, Authentication lapse 0 ms. 

使它再次起作用的唯一方法是无所事事地消灭并再次无所事事,这需要很多时间。有任何想法吗?以下是我的流浪文件。

#
# LICENSE UPL 1.0
#
# Copyright (c) 1982-2018 Oracle and/or its affiliates. All rights reserved.
# 
# Since: July, 2018
# Author: gerald.venzl@oracle.com
# Description: Creates an Oracle database Vagrant virtual machine.
# 
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
# 

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

# define hostname
NAME = "oracle-19c-vagrant"

unless Vagrant.has_plugin?("vagrant-proxyconf")
  puts 'Installing vagrant-proxyconf Plugin...'
  system('vagrant plugin install vagrant-proxyconf')
end

# get host time zone for setting VM time zone, if possible
# can override in env section below
offset_sec = Time.now.gmt_offset
if (offset_sec % (60 * 60)) == 0
  offset_hr = ((offset_sec / 60) / 60)
  timezone_suffix = offset_hr >= 0 ? "-#{offset_hr.to_s}" : "+#{(-offset_hr).to_s}"
  SYSTEM_TIMEZONE = 'Etc/GMT' + timezone_suffix
else
  # if host time zone isn't an integer hour offset, fall back to UTC
  SYSTEM_TIMEZONE = 'UTC'
end

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "ol7-latest"
  config.vm.box_url = "https://yum.oracle.com/boxes/oraclelinux/latest/ol7-latest.box"
  config.vm.define NAME

  config.vm.box_check_update = false

  # change memory size
  config.vm.provider "virtualbox" do |v|
    v.memory = 2048
    v.name = NAME
  end

  # add proxy configuration from host env - optional
  if Vagrant.has_plugin?("vagrant-proxyconf")
    puts "getting Proxy Configuration from Host..."
    if ENV["http_proxy"]
      puts "http_proxy: " + ENV["http_proxy"]
      config.proxy.http     = ENV["http_proxy"]
    end
    if ENV["https_proxy"]
      puts "https_proxy: " + ENV["https_proxy"]
      config.proxy.https    = ENV["https_proxy"]
    end
    if ENV["no_proxy"]
      config.proxy.no_proxy = ENV["no_proxy"]
    end
  end

  # VM hostname
  config.vm.hostname = NAME

  # Oracle port forwarding
  config.vm.network "forwarded_port", guest: 1521, host: 1521
  config.vm.network "forwarded_port", guest: 5500, host: 5500


  # Provision everything on the first run
  config.vm.provision "shell", path: "scripts/install.sh", env:
    {
       "ORACLE_BASE"         => "/opt/oracle",
       "ORACLE_HOME"         => "/opt/oracle/product/19c/dbhome_1",
       "ORACLE_SID"          => "ORCLCDB",
       "ORACLE_PDB"          => "ORCLPDB1",
       "ORACLE_CHARACTERSET" => "AL32UTF8",
       "ORACLE_EDITION"      => "EE",
       "SYSTEM_TIMEZONE"     => SYSTEM_TIMEZONE
    }

end

0 个答案:

没有答案