hana studio安装使用教程(windows版)
<p>hana studio</p>
<p>安装HANA studio</p>
<pre><code>1.复制解压包HDB_STUDIO_WINDOWS_X86_64.zip 然后解压
2.进入解压后的HDB_STUDIO_WINDOWS_X86_64目录
3.点击hdbsetup.exe,开始安装
3.选择保存的路径,然后点next
4.下一步next
4.点install
5.等待中,大概3-4分钟
6.最后点Finish安装完成</code></pre>
<p>使用HANA studio</p>
<pre><code>1.进入安装目录启动SAP HANA STUDIO
2.连接HANA服务器
在左边的窗体中展开菜单,点击有&quot; + &quot;加号的图标 Add System
在打开的窗口中,填写以下内容:
host:demo.upyuan.com (写HANA虚拟机IP地址或者域名)
Instance Number: 00
Description: 可不填
选下一步输入,HANA数据库,用户名密码:
User Name: SYSTEM
Password: Apple789
选下一步,点Finish连接
3.新建用户
连接上HDB后打开左边菜单HDB(SYSTEM)下的Security
右键点击Users
选择New User
输入 User Name :
Password
Confirm
Force password change on next logon 选no
点击右上角绿色的右箭头图标确认提交,用户新建成功。
4左边Security菜单下Users
点击当前用户
输入 Password: 密码 Confirm:确认输入密码
在下边的Object Privileges菜单里 点击 &quot; + &quot; 号图标
把**改为SYSTEM 回车在列表中选择SYSTEM
点击右上角绿色的右箭头图标确认提交
5.然后用新用户登陆
在左边的窗体中展开菜单,点击有&quot; + &quot;加号的图标 Add System
在打开的窗口中,填写以下内容:
host:demo.upyuan.com (写HANA虚拟机IP地址或者域名)
Instance Number: 00
Description: 可不填
选下一步输入,HANA数据库,用户名密码:
User Name: (新用户)
Password: Apple789 (新用户密码)
选下一步,点Finish连接
6.在Catalog目录下选择当前用户点击右键
然后选择New table
table Name 为新表名
Schema 为当前用户库
Type一般是默认的 column store
然后添加表字段
</code></pre>
<p>HDBsql语句下面示例中LEWISNEW为新用户的schema</p>
<pre><code>-- 建表
create column table &quot;LEWISNEW&quot;.&quot;USERTEST&quot;(
&quot;ID&quot; INTEGER not null,
&quot;NAME&quot; NVARCHAR (6) null,
&quot;CLASS&quot; NVARCHAR (15) null,
primary key (&quot;ID&quot;) )
--插入语句
INSERT INTO &quot;LEWISNEW&quot;.&quot;USERTEST&quot; VALUES(1,'lewis','new class')
-- 查询语句
SELECT TOP 1000 * FROM &quot;LEWISNEW&quot;.&quot;USERTEST&quot;;
SELECT &quot;ID&quot;,&quot;NAME&quot;,&quot;CLASS&quot; FROM &quot;LEWISNEW&quot;.&quot;USERTEST&quot;;</code></pre>
<p>修改权限 这表必须在SYSTEM用户下加权限 ('indexserver.ini', 'system'中system为要加的用户名)</p>
<pre><code>ALTER SYSTEM ALTER CONFIGURATION ('indexserver.ini', 'system') set ('import_export', 'enable_csv_import_path_filter') = 'false' with reconfigure</code></pre>
<p>导入表</p>
<pre><code>import from csv file '/hana/g_duanxdtl.txt'
into lewisnew.g_duanxdtl
with record delimited by '\r\n'
field delimited by '\t'
error log '/hana/g_jduanxdtl.bad'
timestamp format 'DD/MM/YYYY HH:MI:SS.FF6'</code></pre>
<pre><code>
select * from lewisnew.g_duanxdtl</code></pre>
<p>如果只是导入表的几个字段</p>
<pre><code>https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.02/en-US/20f712e175191014907393741fadcb97.html
方法1 详细的内容看这个手册。要写一个control file
方法2 csv(txt)文件在with 里加一个COLUMN LIST (&lt;column_name_list&gt;)
</code></pre>
<p>后端语言连接HDB服务器:
Connection URL: jdbc:sap://192.168.3.226:31015
Custom Driver Class Name: com.sap.db.jdbc.Driver </p>