In addition to the pre-built administrative views available on the Maintenance page on the Server, you can use Tableau Desktop to query and build your own analyses of server activity.
To do this, you can connect to and query views in the Tableau Server repository using one of two built-in users: the "tableau" or "readonly" user.
l The tableau user—The tableau user has access to special views and a subset of tables in repository database. These views and tables are provided so that administrators can create custom administrative views. Tableau makes an effort to limit changes to these tables and views so that custom views built with them do not break.
l The readonly user—The readonly user has access to a large number of the repository tables, providing more data about server usage. Administrators can use these to create custom administrative views too, but many of the tables are intended primarily to support the functioning of Tableau Server and may be changed or removed without warning.
This means that views created from these tables can break when the database structure is changed.
Note: The readonly user is available in Tableau Server 8.2.5 and later.
For examples of using the readonly user to connect to the workgroup database, see the following articles in the Tableau Knowledge Base:Group Membership,Server Access, Server Access (2),andWorkgroup Usage
Before you can connect using one of the built-in users, you must enable access to the Tableau Server database. After doing this you can use Tableau Desktop to connect to and query the database as the tableau user or the readonly user.
Note: The tabadmin optionauditing.enabledcontrols whether Tableau Server collects historical user activity and other information in the repository. It is enabled by default.
The tabadmin optionwgserver.audit_history_expiration_dayscontrols how many days of event history are kept in the repository. By default, this is set to 183 days. One thing to note is that collecting historical events does impact the size of Tableau Server's backup file (.tsbak).
Enabling External Access to the Tableau Server Database
You can use Tableau Desktop to connect to and query the Tableau Server repository using two special, built-in users. The "tableau" user has access to several database views you can use as part of building your own analyses of Tableau Server activity. The "readonly" user has access to additional database tables that you can use to create views for even more in-depth analysis.
To access the Tableau Server repository, you need to use the tabadmin command line utility to enable external access to the database.
1. Open a command prompt as an administrator and type:
cd "C:\Program Files\Tableau\Tableau Server\8.3\bin"
2. Version 8.2.4 and earlier: Enter the following command to enable external access to the database for the tableau user:
l tabadmin dbpass [password]
For example, to enable access for the "tableau" user with a password of
"p@ssword":
tabadmin dbpass p@ssword
Version 8.2.5 and later: Enter the following command to enable external access to the
or to enable access for the "readonly" user with a password of "p@ssword":
tabadmin dbpass --username readonly p@ssword
Note: If no user is specified, dbpass enables access for the "tableau" user.
3. Restart Tableau Server:
tabadmin restart
After you've enabled external access to the database, Tableau allows any IP address access to the database as long as the correct password is provided. Follow the steps inConnecting to the Tableau Server Database belowto connect.
Disable external access to the Tableau Server Database
If you want to disable access by "tableau" or "readonly" after enabling it, use the tabadmin dbpass again.
l Run the command tabadmin dbpass --disable --username [user] then restart the server.
For example:
tabadmin dbpass --disable --username readonly tabadmin restart
Note: If no user is specified, the --disable option disables access for the "tableau" user.
Connecting to the Tableau Server Database
After youenable external accessto the Tableau Server database, follow the steps below to connect to and query the database. The username you use will depend on which database views and tables you want to use.
1. In Tableau Desktop select Data > Connect to Data, then select PostgreSQL as the database to connect to. You may need to install the PostgreSQL database drivers. You can download drivers fromwww.tableausoftware.com/drivers.
2. In the PostgreSQL connection dialog box, enter the name or URL for Tableau Server in the Server box. If you have a distributed server installation and a worker is hosting the repository, enter the name of the worker instead. If you are using an Apache load balancer, enter the actual name or ip address of the database server rather than the Tableau Server name.
You should connect using the port you have set up for the pgsql.port, which is 8060 by default. For more information about ports, seeTCP/IP Ports on page 330.
3. Enter workgroup as the Database to connect to.
4. Connect using one of the following users and the password you specified:
Username: tableau or readonly
Password: The password you specified when youenabled access to the Tableau Serverdatabase for the specified user
5. Click Connect.
6. Select one or more tables to connect to.
The "tableau" user has access to all of the tables the start with an underscore and hist_.
For example, you can connect to _background_tasks and _datasources. The tables that begin with historical_ point to hist_ tables. The hist_ tables include information about server users that isn't currently presented in theUser Activity on page 160view.
The "readonly" user has access to additional tables that can be used to query other information about server usage.