原贴地址:https://www.connectionstrings.com/oracle/
Data Source=MyOracleDB;Integrated Security=yes;
Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;
Integrated Security=no;
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;
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;
Data Source=myOracleDB;User Id=/;
Data Source=myOracleDB;User Id=SYS;Password=SYS;DBA Privilege=SYSDBA;
Data Source=myOracleDB;User Id=SYS;Password=SYS;DBA Privilege=SYSOPER;
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);
Data Source=myOracleDB;User Id=myUsername;Password=myPassword;
Proxy User Id=pUserId;Proxy Password=pPassword;
User ID=myUsername;Password=myPassword;Host=ora;Pooling=true;Min Pool Size=0;
Max Pool Size=100;Connection Lifetime=0;
Data Source=TORCL;User Id=myUsername;Password=myPassword;
Data Source=TORCL;Integrated Security=SSPI;
Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));
User Id=myUsername;Password=myPassword;
The easy connect naming method enables clients to connect to a database without any configuration.
Data Source=username/password@//myserver:1521/my.service.com;
This one does not specify a service or a port.
Data Source=username/password@myserver//instancename;
This one does not specify a service or a port.
Data Source=username/password@myserver/myservice:dedicated/instancename;
By default, connection pooling is enabled. This one controls the pooling mechanisms. The connection pooling service creates connection pools by using the ConnectionString property to uniquely identify a pool.
Data Source=myOracle;User Id=myUsername;Password=myPassword;Min Pool Size=10;
Connection Lifetime=120;Connection Timeout=60;Incr Pool Size=5;Decr Pool Size=2;
Use this one if you want to restrict the size of the pool.
Data Source=myOracle;User Id=myUsername;Password=myPassword;Max Pool Size=40;
Connection Timeout=60;
Data Source=myOracle;User Id=myUsername;Password=myPassword;Pooling=False;
Oracle can open a connection using Windows user login credentials to authenticate database users.
Data Source=myOracle;User Id=/;
Oracle allows database administrators to connect to Oracle Database with either SYSDBA or SYSOPER privileges.
Data Source=myOracle;User Id=myUsername;Password=myPassword;DBA Privilege=SYSDBA;
Optimizes connection pooling for RAC database by balancing work requests across RAC instances.
Data Source=myOracle;User Id=myUsername;Password=myPassword;Load Balancing=True;
Driver={Oracle in OraHome92};Dbq=myTNSServiceName;Uid=myUsername;Pwd=myPassword;
Oracle XE (or "Oracle Database 10g Express Edition") is a simple version that's free to distribute.
Driver=(Oracle in XEClient);dbq=111.21.31.99:1521/XE;Uid=myUsername;
Pwd=myPassword;
Driver={Oracle in OraClient11g_home1};Dbq=myTNSServiceName;Uid=myUsername;
Pwd=myPassword;
Driver={Oracle in OraClient11g_home1};Server=serverSID;Uid=myUsername;
Pwd=myPassword;
ODBC;Driver={Oracle in OraClient11g_home1};SERVER=[server SID];UID=[userid];
PWD=[password];DBQ=[server SID];
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;
Password=myPassword;
This one specifies OS authentication to be used when connecting to an Oracle database.
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;OSAuthent=1;
Provider=OraOLEDB.Oracle;dbq=localhost:1521/XE;Database=myDataBase;
User Id=myUsername;Password=myPassword;
Provider=OraOLEDB.Oracle;Data Source=localhost:1521/XE;
Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
Provider=OraOLEDB.Oracle;
Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myHost)(PORT=myPort)))(CONNECT_DATA=(SID=MyOracleSID)(SERVER=DEDICATED)));
User Id=myUsername;Password=myPassword;
Specifies the type of caching used by the provider to store rowset data. OraOLEDB provides two caching mechanisms; File and Memory.
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;
Password=myPassword;CacheType=File;
This one specifies the number of rows the provider will fetch at a time (fetch array).
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;
Password=myPassword;FetchSize=200;
This one specifies the size, in bytes, of the data in LONG and LONG RAW columns fetched and stored in the provider cache.
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;
Password=myPassword;ChunkSize=200;
The Microsoft OLE DB .NET Data Provider can utilize OraOLEDB as the OLE DB Provider for accessing Oracle. However this must be enabled in the connection string.
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;
Password=myPassword;OLEDB.NET=True;
The SPPrmsLOB and NDatatype properties can only be set as connection string attributes when OraOLEDB is used by OLE DB .NET Data Provider.
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;
Password=myPassword;OLEDB.NET=True;SPPrmsLOB=False;NDatatype=False;
SPPrmsLOB=False;
This one specifies sessions to enlist in distributed transactions. This is the default behaviour.
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;
Password=myPassword;DistribTX=1;
This connection string uses a provider from Microsoft.
Provider=msdaora;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;
Provider=msdaora;Data Source=MyOracleDB;Persist Security Info=False;
Integrated Security=Yes;
Provider=any oledb provider's name;OledbKey1=someValue;OledbKey2=someValue;
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;
Password=myPassword;OLEDB.NET=True;
Driver={Microsoft ODBC Driver for Oracle};ConnectString=OracleServer.world;
Uid=myUsername;Pwd=myPassword;
Driver={Microsoft ODBC for Oracle};Server=myServerAddress;Uid=myUsername;
Pwd=myPassword;
No TSN nor DSN required.
Driver={Microsoft ODBC for Oracle};
Server=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=199.199.199.199)(PORT=1523))(CONNECT_DATA=(SID=dbName)));
Uid=myUsername;Pwd=myPassword;
Driver={Microsoft ODBC for Oracle};
CONNECTSTRING=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server)(PORT=7001))(CONNECT_DATA=(SERVICE_NAME=myDb)));
Uid=myUsername;Pwd=myPassword;
Driver={any odbc driver's name};OdbcKey1=someValue;OdbcKey2=someValue;
Provider=MSDataShape;Persist Security Info=False;Data Provider=MSDAORA;
Data Source=orac;User Id=myUsername;Password=myPassword;
This one works only with Oracle 8i release 3 or later