方法:使用数据库连接字符串

使用 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
  }
}
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐