How to configure the STATSPACK performance report of ORACLE 11g adg, adgstatspack
Create a normal STATSPACK report user on the master database
Sqlplus/as sysdba
SQL> @? /Rdbms/admin/spcreate. SQL
SQL> -- cancel some settings of $ ORACLE_HOME/sqlplus/glogin. SQL.
SQL> -- in some cases, the password, tablespace, and temporary files are required.
Perfstat 235619
-- Create an SB user
SQL> @? /Rdbms/admin/sbcreate. SQL
Enter the password for the temporary tablespace.
Then, ask if you want to configure the network (y/n) and enter y.
Configure the TNSNAME of the slave database;
Create a DBLINK and use the perfstat password 235619 with double quotation marks
Stdbyperf 235619
SQL> @? /Rdbms/admin/sbdrop. SQL can delete and reconfigure SB users.
Run on the master database
SQL> conn stdbyperf/235619
SQL> exec statspack_goodg_goodg.SNAP -- the package statspack_goodg_goodg can go to the user stdbyperf to view the specific name
-- You can execute some SQL statements in the slave database.
SQL> exec statspack_goodg_goodg.SNAP
Run on the master database
(5) generate a report
SQL> conn stdbyperf/235619
SQL> @? /Rdbms/admin/sbreport. SQL
In the script execution, a message is displayed,
Unique name
Instance name
Then the snapshot ID
Then the report name
This is good, but it is inconvenient to operate on the master database every time. What should I do if I accidentally gave the master database? We hope that you can execute snapshots and generate reports on the slave database in the future.