日期:2014-05-16  浏览次数:20549 次

Linux 连接Oracle数据库执行SQL

连接Linux主机

[root@m132 ~]#

?

切换用户

[root@m132 ~]# su - oracle

?

解决中文乱码

[oracle@m132 ~]$ export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

?

登录SqlPlus

[oracle@m132 ~]$ sqlplus / as sysdba

?

SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 31 09:12:10 2013

?

Copyright (c) 1982, 2009, Oracle. ?All rights reserved.

?

?

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

With the Partitioning, Data Mining and Real Application Testing options

?

SQL>?

?

执行SQL脚本,创建表空间,用户,分配权限。

SQL> @@/oradata/wsp/wsp.sql;

?

Tablespace created.

?

?

User created.

?

?

Grant succeeded.

?

SQL>?