Rails oracle 数据库创建用户指定表空间

weeweee · June 15, 2012 · Last by weeweee replied at June 16, 2012 · 3276 hits

用的是 oracle 数据库。 使用 rake db:create 创建数据库用户,总是指定到默认表空间上,怎么才能让用户创建在我指定的表空间?

目前没有办法做到这样(当然你可以改代码 C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\activerecord-oracle_enhanced-adapter-1.4.1\lib\active_record\connection_adapters\oracle_enhanced.rake 文件,行 ActiveRecord::Base.connection.execute "CREATE USER #{config['username']} IDENTIFIED BY #{config['password']}"),更简单的方法是,用 Oracle 的 sqlplus,新建 user:

create user railsapp identified by app_password default tablespace railsapp_tb;
grant resource to railsapp;

然后直接用 rake db:migrate。

哦,多谢啊

You need to Sign in before reply, if you don't have an account, please Sign up first.