This SQL document contains 3 queries to retrieve log sequence numbers from the gv$archived_log view. The first query gets the highest sequence number and instance ID grouped by instance. The second query gets the highest sequence number and thread number grouped by thread. The third query filters the view to only logs that have been applied and returns the highest sequence number grouped by thread.