Create a Virtual Connection
A virtual connection is a Tableau content type that provides a sharable central access point to data, and supports row-level security at the connection level. Creating a virtual connection is a multi-step process. This topic covers connecting to the data you want to share and working in the Tables tab of the virtual connection editor.
Connect to data
To create a virtual connection in Tableau Cloud or Tableau Server:
- From the Home or Explore page, click New > Virtual Connection.
- In the Connect to Data dialog box, select the connector for your data. For a list of supported connectors for virtual connections, see Creators: Connect to Data(Link opens in a new window) in the Tableau Desktop and Web Authoring help.
- Enter the information you’re prompted for. The credentials you enter are saved in the virtual connection, so connection users don't have to enter credentials to connect to the data.
- Click Sign In if prompted. To add another connection, click and select a connector, enter credentials and sign in.
A virtual connection can have multiple connections. Each connection accesses one database or file.
Note: For Tableau Cloud, virtual connections that connect to private network data use Tableau Bridge to keep data fresh. For information about configuring Tableau Bridge, see Configure and Manage the Bridge Client Pool(Link opens in a new window). For information about supported connections, see Connectivity with Bridge(Link opens in a new window).
As needed, add another connection to a virtual connection and connect to more than one database by clicking next to Connections. You can add a connection to a different server or database, or to the same server or database.
With multiple connections, you can:
- Use a table from any connection or database as an entitlement table in a data policy that secures tables from other connections and databases.
- Add or replace tables in a virtual connection with tables from a different database. For example, say you migrate data from one database to another. In the virtual connection editor, you can add a connection to the second database and replace the existing tables from the first database with tables from the second one.
- Add multiple connections to the same server or database. This can be helpful when you need to, for example, access data from the same database but with different credentials.
- Share a group of tables that are related or meant to be used together, no matter where they’re physically located. For example, from multiple databases you can group tables related to employee information.
When you open a virtual connection to edit it, if prompted, you must authenticate connections in sequence. If any connections fail to authenticate, you can’t edit the virtual connection.
Select tables to include in the connection
If necessary, select a database to view the tables in it.
- On the left, under Tables, select the tables and click or drag them to the Tables tab on the right. You can include tables from different connections. Include an entitlement table, if you're using one.
- (Optional) Click New Custom SQL to create a custom table schema.
Note: Virtual connections don't support tables with a spatial data type.
Select live or extract mode for tables
You can set individual tables – whether they're from multiple connections or not – to either live or extract mode in the same virtual connection.
- Live – Tables are queried directly from the database. (Live is the default.)
- Extracts – Tables are extracted and saved to Tableau.
As an example, you can set some tables to extract mode so that they're not impacted by report generation or heavy customer traffic.
Under Tables, select the table or tables you want to change the mode for and select Actions, and Change to Live or Change to Extract.
After a table or tables are changed from live to extract but haven’t been extracted yet, click Run Pending Extracts to run the pending extracts. After all pending extracts are run, click Run All Extracts to extract all table data at that time.
You must run any pending extracts before you publish the virtual connection. You can't edit the connection while extracts are generated.
Schedule extract refreshes of the tables in your virtual connection on the virtual connection page after you publish the connection. See Schedule Extract Refreshes for a Virtual Connection.
Set the table visibility state
Use the Visibility toggle on the Tables tab to show or hide tables and their data from users.
Users can see table data. You can create a data policy to govern which data users can see. (Visible is the default.)
Users can’t see table data. You can use hidden tables in a data policy and as an entitlement table.
See table details
Click a table at the top of the Tables tab to see its details. You can make simple edits in the Table Details section, such as changing a table name, hiding or renaming a column or changing a data type.
Switch the table information you see using these icons:
|A list of columns in the table and each column's data type.|
|Sample data for each column and linked keys, if available. Linked keys show which columns link to other tables. They're visible only when databases have primary and foreign key information.|
|The range of values in a histogram for each column selected.|
Click the refresh icon in the toolbar to get the latest data from the database for all the connections in a virtual connection, including:
- The lists of databases, tables and columns. Both the tables included in a virtual connection and not included are refreshed.
- Table and histogram data.
For tables in live mode, refreshing retrieves the latest list of databases, tables and columns and the most recent table and histogram data. For tables in extract mode, refreshing retrieves the updated list of tables and columns. But to see the most recent table and histogram data, you must start a new extract. For example, when there's a new column in a database table and you click the refresh icon, the new column appears in the editor but its data does not. To see the most current data, you must start a new extract.
Refreshing data invalidates any currently cached data. Closing and reopening the editor, switching tables from extract to live mode and changing a connection credential like username or password also refreshes data.
To create a virtual connection, you must
- have credentials to the database that the virtual connection connects to, and
- be a server or site administrator, or a Creator.
Use a PROPERTIES file to customise a JDBC connection – If you’re customising a JDBC-based connection, you can also make customisations in a PROPERTY file