Monthly Archives: August 2012

RHEL上安装Node.js

Step 1:
If you have already installed git, then you can omit this step.
Install git: Login as root and execute:
#yum install git

Step 2:
安装g++,也是要用root账号:
#yum install gcc-c++

Step 3:
nodejs官网下载稳定版:
wget http://nodejs.org/dist/v0.10.20/node-v0.10.20.tar.gz
或到github获取最新的node.js源代码(最新版通常为pre版,不推荐使用):
git clone git://github.com/joyent/node.git

Step 0:
这里突然发现Python的版本不符合要求,因为在执行./configure命令时居然诡异的报错。
一查发现node.js要求Python版本大于2.5。笔者的版本居然是2.4.3。于是,升级Python先。
执行如下命令:
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
tar -jxvf Python-2.7.3.tar.bz2
cd Python-2.7.3
./configure
make
这里使用root账号执行:make install

Step 4:
使用普通用户,进入node.js目录,执行:
./configure
make
这里使用root账号执行:make install

安装node.js时会自动安装npm。

Step 5:
安装多版本管理器。Node.js的更新速度相当快,有时候旧的API甚至会不被新版本兼容,以至于代码不能向下兼容。而一方面为了尝试新版本的功能,一方面要保持相对稳定的环境,咋办呢?还好Node.js社区开发了多版本管理器,用于在一台机器上维护多个版本的Node.js实例,可按需切换。笔者安装的是n,直接执行如下命令:
npm install -g n
安装完n之后,可以用如下的方式安装任意版本的Node.js:
n 0.8.8
如果该版本已经安装,则会将环境切换到该版本。
运行n即可列出所有已经安装的Node.js版本。
如果要不切换环境但是想指定某个脚本的版本,可以用这个命令:
n use 0.8.8 demo.js


Data Warehouse For Ever原创文章,转载请注明出处

Solution for ORA-01031: insufficient privileges during MView job

Today I created a materialized view, but during the corresponding job running, an error occurred.
The following text is the error message in the Oracle alert file:

Mon Aug 13 19:00:54 2012
Errors in file /opt/oracle/admin/dacdb/bdump/dacdb_j000_20861.trc:
ORA-12012: error on auto execute of job 225
ORA-12008: error in materialized view refresh path
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2251
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2457
ORA-06512: at "SYS.DBMS_IREFRESH", line 685
ORA-06512: at "SYS.DBMS_REFRESH", line 195
ORA-06512: at line 1

The materialized view was created by a DBA user, but why still “insufficient privileges”?
Finally I found the solution:
Grant a dba role to the user is USELESS!
The privileges must be EXPLICITLY granted!

eg:

GRANT SELECT ON dw_meta.md_dw_cbu_indicator_info TO CBU_DP;
GRANT SELECT ON dw_meta.md_dw_cbu_table_info TO CBU_DP;
GRANT SELECT ON dw_meta.md_dw_cbu_report TO CBU_DP;


Data Warehouse For Ever原创文章,转载请注明出处