# File lib/arjdbc/tasks/oracle_database_tasks.rb, line 54 def self.load_enhanced_structure_dump unless defined? ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter ActiveRecord::ConnectionAdapters.module_eval do const_set :OracleEnhancedAdapter, ActiveRecord::ConnectionAdapters::OracleAdapter end end require 'arjdbc/tasks/oracle/enhanced_structure_dump' end
# File lib/arjdbc/tasks/oracle_database_tasks.rb, line 7 def create print "Please provide the SYSTEM password for your oracle installation\n>" system_password = $stdin.gets.strip establish_connection(config.merge('username' => 'SYSTEM', 'password' => system_password)) unless ( config = self.config ).key?('username') config = config_from_url(config['url']) if config['url'] end begin connection.execute "CREATE USER #{config['username']} IDENTIFIED BY #{config['password']}" rescue => e if e.message =~ /ORA-01920/ # user name conflicts with another user or role name connection.execute "ALTER USER #{config['username']} IDENTIFIED BY #{config['password']}" else raise e end end connection.execute "GRANT unlimited tablespace TO #{config['username']}" connection.execute "GRANT create session TO #{config['username']}" connection.execute "GRANT create table TO #{config['username']}" connection.execute "GRANT create sequence TO #{config['username']}" end
# File lib/arjdbc/tasks/oracle_database_tasks.rb, line 29 def drop self.class.load_enhanced_structure_dump establish_connection(config) connection.execute_structure_dump(connection.full_drop) end
# File lib/arjdbc/tasks/oracle_database_tasks.rb, line 35 def purge self.class.load_enhanced_structure_dump establish_connection(:test) connection.execute_structure_dump(connection.full_drop) connection.execute("PURGE RECYCLEBIN") rescue nil end
Generated with the Darkfish Rdoc Generator 2.