oracle 连接方式

 Oracle
Set your custom
connection string values »
This is a compiled connection strings reference list on how to connect to Oracle.
 
ODBC
 
New version
  
Driver= {Microsoft ODBC for Oracle}; Server= myServerAddress; Uid= myUsername; Pwd= myPassword;
 
Old version
  
Driver= {Microsoft ODBC Driver for Oracle}; ConnectString= OracleServer.world; Uid= myUsername; Pwd= myPassword;
 
OLE DB, OleDbConnection (.NET)
 
Standard security
This connection string uses a provider from Microsoft. 
Provider= msdaora; Data Source= MyOracleDB; User Id= myUsername; Password= myPassword;
  
Trusted connection
  
Provider= msdaora; Data Source= MyOracleDB; Persist Security Info= False; Integrated Security= Yes;
  
Standard Security
This connection string uses a provider from Oracle. 
Provider= OraOLEDB.Oracle; Data Source= MyOracleDB; User Id= myUsername; Password= myPassword;
  
Trusted Connection
  
Provider= OraOLEDB.Oracle; Data Source= MyOracleDB; OSAuthent= 1;
  
Oracle.DataAccess.Client.OracleConnection
 
Standard
  
Data Source= TORCL; User Id= myUsername; Password= myPassword;
  
Using integrated security
  
Data Source= TORCL; Integrated Security= SSPI;
  
Using ODP.NET without tnsnames.ora
  
Data Source= (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID))); User Id= myUsername; Password= myPassword;
  
OracleConnection, Oracle Data Provider, ODP.NET, System.Data.OracleClient.OracleConnection
 
Standard
  
Data Source= MyOracleDB; Integrated Security= yes;
This one works only with Oracle 8i release 3 or later
 
Specifying username and password
  
Data Source= MyOracleDB; User Id= myUsername; Password= myPassword; Integrated Security= no;
This one works only with Oracle 8i release 3 or later
 
Omiting tnsnames.ora
This is another type of Oracle connection string that doesn't rely on you to have a DSN for the connection. You create a connection string based on the format used in the tnsnames.ora file without the need to actually have one of these files on the client pc. 
SERVER= (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID))); uid= myUsername; pwd= myPassword;
  
 
Some reported problems with the one above and Visual Studio. Use the next one if you've encountered problems. 
Data Source= (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID))); User Id= myUsername; Password= myPassword;
  
Using Connection Pooling
The connection pooling service will create a new pool if it can't find any existing pool that exactly match the new connections connection string properties. If there is a matching pool a connection will be recycled from that pool. 
Data Source= myOracleDB; User Id= myUsername; Password= myPassword; Min Pool Size= 10; Connection Lifetime= 120; Connection Timeout= 60; Incr Pool Size= 5; Decr Pool Size= 2;
  
Windows Authentication
  
Data Source= myOracleDB; User Id= /;
  
Privileged Connection
With SYSDBA privileges 
Data Source= myOracleDB; User Id= SYS; Password= SYS; DBA Privilege= SYSDBA;
  
Privileged Connection
With SYSOPER privileges 
Data Source= myOracleDB; User Id= SYS; Password= SYS; DBA Privilege= SYSOPER;
  
Utilizing the Password Expiration functionality
First open a connection with a connection string. When the connection is opened, an error is raised because the password have expired. Catch the error and execute the OpenWithNewPassword command supplying the new password. 
Data Source= myOracleDB; User Id= myUsername; Password= myPassword;

oConn.OpenWithNewPassword(sTheNewPassword);
  
Proxy Authentication
  
Data Source= myOracleDB; User Id= myUsername; Password= myPassword; Proxy User Id= pUserId; Proxy Password= pPassword;
  
Core Labs OraDirect (.NET)
 
Standard
  
User ID= myUsername; Password= myPassword; Host= ora; Pooling= true; Min Pool Size= 0; Max Pool Size= 100; Connection Lifetime= 0;
 
Data Shape
 
MS Data Shape
  
Provider= MSDataShape.1; Persist Security Info= False; Data Provider= MSDAORA; Data Source= orac; User
在 Kettle 文件里设置 Oracle 连接方式,可按以下操作进行: 1. 准备好适用于 Oracle 数据库版本的 JDBC 驱动(通常是 `ojdbc.jar` 文件),并将其复制到 Kettle 的 `lib` 目录下。 2. 打开 Kettle 的 Spoon 工具,新建一个转换或者作业。 3. 打开 “核心对象” 面板,在 “输入” 或 “输出” 类别中,选择需要使用数据库连接的组件,如 “表输入” 或 “表输出”。 4. 双击该组件,在弹出的对话框中,点击 “新建” 按钮,进入 “数据库连接” 配置界面。 5. 在 “数据库连接” 对话框的 “连接类型” 下拉列表中,选择 “Oracle”。 6. 填写连接信息: - **连接名称**:自定义一个便于识别的连接名称。 - **主机名**:填写 Oracle 数据库所在的服务器主机名或 IP 地址。 - **数据库名称**:若使用 SID 方式连接,填写 Oracle 的 SID;若使用服务名方式连接,填写服务名。 - **端口号**:一般 Oracle 默认端口号是 1521。 - **用户名**:用于连接数据库的用户名。 - **密码**:该用户对应的密码。 7. 选择连接方式: - 若使用 SID 方式连接,在 “连接方式” 中选择 “Oracle Thin (JDBC) using SID”。 - 若使用服务名方式连接,在 “连接方式” 中选择 “Oracle Thin (JDBC) using Service Name”。 - 若使用 OCI 方式连接,可参考相关文档进行配置,OCI 方式可使 Kettle 高效地与 Oracle 数据库进行交互,实现数据的抽取、转换和加载(ETL)操作[^1]。 8. 填写完所有信息后,点击 “测试” 按钮。如果连接信息正确,会弹出 “连接成功” 的提示框;若连接失败,会显示相应的错误信息,需要根据错误信息检查配置并修正。 9. 测试成功后,点击 “确定” 保存数据库连接配置。 以下是一个简单示例,展示在 Kettle 文件中以 XML 形式配置 Oracle SID 连接的代码片段: ```xml <connection> <name>OracleSIDConnection</name> <server>192.168.1.100</server> <type>Oracle</type> <access>Native (JDBC)</access> <database>ORCL_SID</database> <port>1521</port> <username>your_username</username> <password>your_password</password> <extra> <name>ConnectionType</name> <value>Oracle Thin (JDBC) using SID</value> </extra> </connection> ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值