1.建立oracle用户
2.建立oinstall用户组
建立oracle用户和oinstall用户组的原因
3.设置环境变量
4.解压oracle_client_64bit2.tar.gz放到/data文件夹下面,这里一定要放在这里 因为oracle_client_64bit2.tar.gz里面已经建立了一些软连,除非你自己能改
5.解压完成后进入到/data/oracle/10.2.0.1/network/admin/ 增加 listener.ora 、sqlnet.ora、tnsnames.ora文件
文件内容分别如下:
这里需要说明一下
NAMES.DIRECTORY_PATH= (TNSNAMES) 一般可能会使用这句,但是在服务器上面我不知道为什么会抛出ORA-12154: TNS:could not resolve service name的异常
上网查找到是说错误指出客户不能查找到tnsnames.ora文件中所列举的服务。 解决方法是直接添加NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME) 这句,
并且如果有设置NAMES.DEFAULT_DOMAIN = localdomain这句话,也需要去除,否则还是会报错
参考链接:http://blog.chinaunix.net/u/15472/showart_286991.html
这样基本上就搞定了
输入sqlplus
如果出现提示你输入帐号密码 则表示已经成功了
注意本client端版本是oracle_client_64bit2.tar.gz ,是朋友给的,不是官网下载的。
另外如果sqlldr导入出现乱码
eg:服务器端字符集NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
那么控制文件ctl:
然后执行
参考链接:
http://blog.chinaunix.net/u/15472/showart_286991.html
http://lwxjjgc.iteye.com/blog/567409
2.建立oinstall用户组
2.4 Creating Required Operating System Group and User
Depending on whether this is the first time Oracle software is being installed on this system and on the products that you are installing, you may need to create the following operating system group and user:
The Oracle Inventory group (oinstall)
You must create this group the first time you install Oracle software on the system. The usual name chosen for this group is oinstall. This group owns the Oracle inventory, which is a catalog of all Oracle software installed on the system.
Note:
If Oracle software is already installed on the system, then the existing Oracle Inventory group must be the primary group of the operating system user that you use to install new Oracle software.
The Oracle software owner user (typically, oracle)
You must create this user the first time you install Oracle software on the system. This user owns all of the software installed during the installation. This user must have the Oracle Inventory group as its primary group.
Note:
In Oracle documentation, this user is referred to as the oracle user.
A single Oracle Inventory group is required for all installations of Oracle software on the system. After the first installation of Oracle software, you must use the same Oracle Inventory group for all subsequent Oracle software installations on that system. However, you can choose to create different Oracle software owner users for separate installations.
Note:
The following sections describe how to create local users and groups. As an alternative to creating local users and groups, you could create the appropriate users and groups in a directory service, for example, Network Information Services (NIS). For information about using directory services, contact your system administrator or refer to your operating system documentation.
建立oracle用户和oinstall用户组的原因
3.设置环境变量
PATH=............:/data/oracle/10.2.0.1/bin
export PATH
export ORACLE_HOME=/data/oracle/10.2.0.1
export LD_LIBRARY_PATH=/data/oracle/10.2.0.1/lib
4.解压oracle_client_64bit2.tar.gz放到/data文件夹下面,这里一定要放在这里 因为oracle_client_64bit2.tar.gz里面已经建立了一些软连,除非你自己能改
5.解压完成后进入到/data/oracle/10.2.0.1/network/admin/ 增加 listener.ora 、sqlnet.ora、tnsnames.ora文件
文件内容分别如下:
vi listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.3.36)(PORT = 1521))
)
)
vi sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES= (NTS)
#NAMES.DIRECTORY_PATH= (TNSNAMES)
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
这里需要说明一下
NAMES.DIRECTORY_PATH= (TNSNAMES) 一般可能会使用这句,但是在服务器上面我不知道为什么会抛出ORA-12154: TNS:could not resolve service name的异常
上网查找到是说错误指出客户不能查找到tnsnames.ora文件中所列举的服务。 解决方法是直接添加NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME) 这句,
并且如果有设置NAMES.DEFAULT_DOMAIN = localdomain这句话,也需要去除,否则还是会报错
参考链接:http://blog.chinaunix.net/u/15472/showart_286991.html
vi tnsnames.ora
WEBTRACE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.3.36)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = webtrace)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
这样基本上就搞定了
输入sqlplus
如果出现提示你输入帐号密码 则表示已经成功了
注意本client端版本是oracle_client_64bit2.tar.gz ,是朋友给的,不是官网下载的。
另外如果sqlldr导入出现乱码
eg:服务器端字符集NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
那么控制文件ctl:
Load data
CHARACTERSET ZHS16GBK
append into table TEST
fields terminated by '`'
trailing nullcols
(
DNAME,
MENO,
ID "SEQ_TEST.nextval"
)
然后执行
sqlldr userid=webtrace/webtrace@WEBTRACE control=import_data_to_db.ctl data=test.log
参考链接:
http://blog.chinaunix.net/u/15472/showart_286991.html
http://lwxjjgc.iteye.com/blog/567409