在 .NET 应用中使用 Oracle 数据库时指定默认的表空间或模式
·
方法:使用数据库连接字符串
使用 Oracle 用户的模式(Schema),在 Oracle 中,每个用户都有一个模式(Schema)。当你连接数据库时,SqlSugar 默认会使用当前用户(即你在连接字符串中指定的 User Id)的模式,如下:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore": "Information"
}
},
"ConnectionConfigs": [
{
"ConfigId": "master",
////"ConnectionString": "Data Source=127.0.0.1:1521/orcl.mshome.net;User ID=system;Password=12345678",
////"ConnectionString": "Data Source=192.168.3.148:1521/orcl;User ID=system;Password=12345678",
"ConnectionString": "Data Source=10.80.189.43:1521/orcl;User ID=C##RY_NET;Password=12345678;", // 默认使用C##RY_NET这个用户下的模式
////"ConnectionString": "Data Source=10.80.189.81:1521/orcl;User ID=system;Password=12345678",
"DbType": "Oracle",
////"IsAutoCloseConnection": true
"IsAutoCloseConnection": true,
"MoreSettings": {
"EnableOracleIdentity": true
}
},
{
"ConfigId": "slave",
"ConnectionString": "Data Source=10.80.189.12:1521/orcl;User ID=yybip;Password=12345678",
"DbType": "Oracle",
"IsAutoCloseConnection": true,
"DbLinkName": "@DBLINK_YYBIP"
}
],
"AppSettings": {
"InjectSpecificationDocument": true
}
}
DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。
更多推荐


所有评论(0)