SQLSTATE[HY000]: General error: 20003 Adaptive Server connection timed out [20003] - symfony

I'm trying to execute a store procedure on a SQL Server 2008.
After about 30 seconds it ends in
SQLSTATE[HY000]: General error: 20003 Adaptive Server connection timed
out [20003]
I've checked if on the SQL Server remote connections are allowed and they are with a timeout of 600 seconds (default).
This is my config.yml
doctrine:
dbal:
default_connection: default
connections:
default: ...
mssql:
driver_class: \Lsw\DoctrinePdoDblib\Doctrine\DBAL\Driver\PDODblib\Driver
host: mssql_freetds
port: "%stage_database_port%"
dbname: "%stage_database_name%"
user: "%stage_database_user%"
password: "%stage_database_password%"
charset: UTF8
options:
timeout: 600 // I don't know if it's correct but it doesn't work even without this
And this is my code
$connection = $this->getDoctrine()->getManager('mssql')
->getConnection();
$stmt = $connection->prepare("Exec SP_MyStoreProcedure ?, ?");
$stmt->bindValue(1, $sd->format("Y-m-d") /* This is a date */);
$stmt->bindValue(2, $ed->format("Y-m-d") /* This is a date */);
$stmt->execute();
[EDIT]
So, i've found that i should configure time out on freetds configuration because of LswDoctrinePdoDblib. I'v edited the /etc/freetds/freetds.conf file but it still ends up connection after 30 seconds
/etc/freetds/freetds.conf
# $Id: freetds.conf,v 1.12 2007/12/25 06:02:36 jklowden Exp $
#
# This file is installed by FreeTDS if no file by the same
# name is found in the installation directory.
#
# For information about the layout of this file and its settings,
# see the freetds.conf manpage "man freetds.conf".
# Global settings are overridden by those in a database
# server specific section
[global]
# TDS protocol version
; tds version = 4.2
# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
; dump file = /tmp/freetds.log
; debug flags = 0xffff
# Command and connection timeouts
timeout = 600
connect timeout = 600
[mssql_freetds]
host = 192.168.0.xx
port = 1433
timeout = 600
tds version = 8.0
client charset = UTF-8
text size = 20971520
[EDIT 2]
Nothing worked for timeout except this:
doctrine:
dbal:
default_connection: default
connections:
default: ...
mssql:
driver_class: \Lsw\DoctrinePdoDblib\Doctrine\DBAL\Driver\PDODblib\Driver
host: mssql_freetds
port: "%stage_database_port%"
dbname: "%stage_database_name%"
user: "%stage_database_user%"
password: "%stage_database_password%"
charset: UTF8
options:
2: 600 # 2 is the equivalent of \PDO::ATTR_TIMEOUT
But the store procedure should end in 17seconds, it waited 10 minutes ending with the same result. I don't know why. It seems to be a FREETDS/SQL SERVER bug or something like that...
[EDIT 3]
Found that the problem was a "NOT IN" clause in the SQL of the stored procedure. I had to replace it with a LEFT JOIN combined with a IS NULL clause in WHERE statement. There's also a "IN" clause but it works. I don't know if it's a FREETDS or a LswDoctrinePdoDblib issue.

Related

Squid3 and freeradius - basic_radius_auth: No response from RADIUS server

I have the following setup - freeradius setup to use MySQL database and log accounting to there too. I can see that this is all ok - as when I run a radtest I get the expected results. So I am fairly sure that the freeradius part is all ok
When I configure squid3 to use this - I am getting the following
2021/08/27 12:34:16| Starting new basicauthenticator helpers...
2021/08/27 12:34:16| helperOpenServers: Starting 1/20 'basic_radius_auth' processes
basic_radius_auth: No response from RADIUS server
On the freeradius side I can see:
(2) Received Access-Request Id 6 from 172.17.0.1:59997 to 172.17.0.20:1812 length 87
(2) User-Name = "me#mine.com"
(2) User-Password = "password"
(2) NAS-Port = 111
(2) NAS-Port-Type = Async
(2) NAS-IP-Address = 172.17.0.21
(2) # Executing section authorize from file /etc/freeradius/sites-enabled/default
(2) authorize {
(2) policy filter_username {
(2) if (&User-Name) {
(2) if (&User-Name) -> TRUE
(2) if (&User-Name) {
(2) if (&User-Name =~ / /) {
(2) if (&User-Name =~ / /) -> FALSE
(2) if (&User-Name =~ /#[^#]*#/ ) {
(2) if (&User-Name =~ /#[^#]*#/ ) -> FALSE
(2) if (&User-Name =~ /\.\./ ) {
(2) if (&User-Name =~ /\.\./ ) -> FALSE
(2) if ((&User-Name =~ /#/) && (&User-Name !~ /#(.+)\.(.+)$/)) {
(2) if ((&User-Name =~ /#/) && (&User-Name !~ /#(.+)\.(.+)$/)) -> FALSE
(2) if (&User-Name =~ /\.$/) {
(2) if (&User-Name =~ /\.$/) -> FALSE
(2) if (&User-Name =~ /#\./) {
(2) if (&User-Name =~ /#\./) -> FALSE
(2) } # if (&User-Name) = notfound
(2) } # policy filter_username = notfound
(2) [preprocess] = ok
(2) [chap] = noop
(2) [mschap] = noop
(2) [digest] = noop
(2) suffix: Checking for suffix after "#"
(2) suffix: Looking up realm "mine.com" for User-Name = "me#mine.com"
(2) suffix: No such realm "mine.com"
(2) [suffix] = noop
(2) eap: No EAP-Message, not doing EAP
(2) [eap] = noop
(2) [files] = noop
(2) sql: EXPAND %{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}}
(2) sql: --> me#mine.com
(2) sql: SQL-User-Name set to 'me#mine.com'
rlm_sql (sql): Reserved connection (6)
(2) sql: EXPAND SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{SQL-User-Name}' ORDER BY id
(2) sql: --> SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'me#mine.com' ORDER BY id
(2) sql: Executing select query: SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'me#mine.com' ORDER BY id
(2) sql: User found in radcheck table
(2) sql: Conditional check items matched, merging assignment check items
(2) sql: Cleartext-Password := "password"
(2) sql: EXPAND SELECT id, username, attribute, value, op FROM radreply WHERE username = '%{SQL-User-Name}' ORDER BY id
(2) sql: --> SELECT id, username, attribute, value, op FROM radreply WHERE username = 'me#mine.com' ORDER BY id
(2) sql: Executing select query: SELECT id, username, attribute, value, op FROM radreply WHERE username = 'me#mine.com' ORDER BY id
(2) sql: EXPAND SELECT groupname FROM radusergroup WHERE username = '%{SQL-User-Name}' ORDER BY priority
(2) sql: --> SELECT groupname FROM radusergroup WHERE username = 'me#mine.com' ORDER BY priority
(2) sql: Executing select query: SELECT groupname FROM radusergroup WHERE username = 'me#mine.com' ORDER BY priority
(2) sql: User not found in any groups
rlm_sql (sql): Released connection (6)
Need 1 more connections to reach min connections (3)
rlm_sql (sql): Opening additional connection (7), 1 of 30 pending slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'radius' on 192.168.0.10 via TCP/IP, server version 5.5.5-10.6.4-MariaDB-1:10.6.4+maria~focal, protocol version 10
rlm_sql (sql): You probably need to lower "min"
rlm_sql (sql): Closing expired connection (2) - Hit idle_timeout limit
rlm_sql_mysql: Socket destructor called, closing socket
(2) [sql] = ok
(2) [expiration] = noop
(2) [logintime] = noop
(2) [pap] = updated
(2) } # authorize = updated
(2) Found Auth-Type = PAP
(2) # Executing group from file /etc/freeradius/sites-enabled/default
(2) Auth-Type PAP {
(2) pap: Login attempt with password
(2) pap: Comparing with "known good" Cleartext-Password
(2) pap: User authenticated successfully
(2) [pap] = ok
(2) } # Auth-Type PAP = ok
(2) # Executing section post-auth from file /etc/freeradius/sites-enabled/default
(2) post-auth {
(2) if (session-state:User-Name && reply:User-Name && request:User-Name && (reply:User-Name == request:User-Name)) {
(2) if (session-state:User-Name && reply:User-Name && request:User-Name && (reply:User-Name == request:User-Name)) -> FALSE
(2) update {
(2) No attributes updated for RHS &session-state:
(2) } # update = noop
(2) sql: EXPAND .query
(2) sql: --> .query
(2) sql: Using query template 'query'
rlm_sql (sql): Reserved connection (6)
(2) sql: EXPAND %{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}}
(2) sql: --> me#mine.com
(2) sql: SQL-User-Name set to 'me#mine.com'
(2) sql: EXPAND INSERT INTO radpostauth (username, pass, reply, authdate ) VALUES ( '%{SQL-User-Name}', '%{%{User-Password}:-%{Chap-Password}}', '%{reply:Packet-Type}', '%S.%M' )
(2) sql: --> INSERT INTO radpostauth (username, pass, reply, authdate ) VALUES ( 'me#mine.com', 'password', 'Access-Accept', '2021-08-27 12:44:12.863002' )
(2) sql: EXPAND /var/log/freeradius/sqllog.sql
(2) sql: --> /var/log/freeradius/sqllog.sql
(2) sql: Executing query: INSERT INTO radpostauth (username, pass, reply, authdate ) VALUES ( 'me#mine.com', 'password', 'Access-Accept', '2021-08-27 12:44:12.863002' )
(2) sql: SQL query returned: success
(2) sql: 1 record(s) updated
rlm_sql (sql): Released connection (6)
(2) [sql] = ok
(2) [exec] = noop
(2) policy remove_reply_message_if_eap {
(2) if (&reply:EAP-Message && &reply:Reply-Message) {
(2) if (&reply:EAP-Message && &reply:Reply-Message) -> FALSE
(2) else {
(2) [noop] = noop
(2) } # else = noop
(2) } # policy remove_reply_message_if_eap = noop
(2) if (EAP-Key-Name && &reply:EAP-Session-Id) {
(2) if (EAP-Key-Name && &reply:EAP-Session-Id) -> FALSE
(2) } # post-auth = ok
(2) Sent Access-Accept Id 6 from 172.17.0.20:1812 to 172.17.0.1:59997 length 0
(2) Finished request
Waking up in 4.9 seconds.
(2) Sending duplicate reply to client 172.17.0.1 port 59997 - ID: 6
Waking up in 9.0 seconds.
(2) Sending duplicate reply to client 172.17.0.1 port 59997 - ID: 6
Waking up in 18.0 seconds.
(2) Sending duplicate reply to client 172.17.0.1 port 59997 - ID: 6
Waking up in 37.0 seconds.
(2) Sending duplicate reply to client 172.17.0.1 port 59997 - ID: 6
Waking up in 76.0 seconds.
(2) Sending duplicate reply to client 172.17.0.1 port 59997 - ID: 6
Waking up in 155.0 seconds.
(2) Sending duplicate reply to client 172.17.0.1 port 59997 - ID: 6
Waking up in 314.0 seconds.
(2) Sending duplicate reply to client 172.17.0.1 port 59997 - ID: 6
Waking up in 633.0 seconds.
(2) Sending duplicate reply to client 172.17.0.1 port 59997 - ID: 6
Waking up in 1272.0 seconds.
(2) Sending duplicate reply to client 172.17.0.1 port 59997 - ID: 6
Waking up in 2118.0 seconds.
in the squid.conf I have the following
auth_param basic program /usr/lib/squid/basic_radius_auth -f /etc/squid/radius_config
auth_param basic realm proxy
acl authenticated proxy_auth REQUIRED
http_access allow authenticated
I cannot figure out why the radius server is all ok - reporting back
(2) pap: User authenticated successfully
(2) [pap] = ok
(2) } # Auth-Type PAP = ok
and then
(2) Sent Access-Accept Id 6 from 172.17.0.20:1812 to 172.17.0.1:59997 length 0
(2) Finished request
and the "sending duplicate reply" errors?
Anyone know where I am going wrong?
Squid uses RADIUS "squid_radius_auth" authentication
Make sure squid is compiled with --enable-basic-auth-helpers="squid_radius_auth" option which is only available in Squid-2.6.STABLE17 or later.
Create a radius configuration file
The configuration specifies the connection type to RADIUS. The file contains a list of directives (one per line). Lines beginning with a "#" are ignored as comments.
Template radius config
server radiusserver: specifies the name or address of the RADIUS server
secret somesecretstring: specifies the shared RADIUS secret.
identifier nameofserver: specifies what the proxy should identify itself as to the RADIUS server. This directive is optional (optional)
port port-number: Specifies the port number or service name (default:1812)
Sample radius config: /etc/radius_config
server 192.168.10.20
secret someSecret
Test authentication squid_radius_auth command line with config
/usr/local/squid/libexec/squid_radius_auth -f /etc/radius_config
Test authentication squid_radius_auth command line without config
/usr/local/squid/libexec/squid_radius_auth -h 192.168.10.20 -w someSecret
Type your radius username and password on the same line separated with a space, it should return "OK" as the response if successful.
Tested squid.conf Configuration
auth_param basic program /usr/local/squid/libexec/squid_radius_auth -f /etc/radius_config
auth_param basic children 5
auth_param basic realm Web-Proxy
auth_param basic credentialsttl 5 minute
auth_param basic casesensitive off
acl radius-auth proxy_auth REQUIRED
http_access allow radius-auth
http_access allow localhost
http_access deny all

How to fix the "key too long" error and generate the Doctrine migrations table?

I'm using / setting up the Symfony DoctrineMigrationsBundle v2.2 configured as followed:
doctrine_migrations:
name: 'My Migrations'
migrations_paths:
'DoctrineMigrations': '%kernel.project_dir%/src/Migrations'
storage:
table_storage:
table_name: 'migrations'
version_column_name: 'version'
version_column_length: 1024
executed_at_column_name: 'executed_at'
# Seems not to be supported:
# Unrecognized option "execution_time_column_name" under "doctrine_migrations.storage.table_storage"
# execution_time_column_name: 'execution_time'
organize_migrations: false
# custom_template: ~
all_or_nothing: false
The RDBMS is MySQL v8, running (locally) on Ubuntu Desktop v20.04:
$ mysql --version
mysql Ver 8.0.22-0ubuntu0.20.04.2 for Linux on x86_64 ((Ubuntu))
The DEFAULT_CHARACTER_SET_NAME is utf8mb4, the DEFAULT_COLLATION_NAME is utf8mb4_unicode_ci:
SELECT
`DEFAULT_CHARACTER_SET_NAME`, `DEFAULT_COLLATION_NAME`
FROM
`INFORMATION_SCHEMA`.`SCHEMATA`
WHERE
`SCHEMA_NAME` = "payment"
;
+----------------------------+------------------------+
| DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME |
+----------------------------+------------------------+
| utf8mb4 | utf8mb4_unicode_ci |
+----------------------------+------------------------+
While I was playing with the configs, I created two migrations tables (I changed the doctrine_migrations.storage.table_storage.table_name multiple times), somehow... Now, after the configuration has bee completed I want to go the setup through cleanly again from scratch. So I removed both migrations tables and started again. But now I'm getting following error:
$ ./bin/console doctrine:migrations:status
...
In AbstractMySQLDriver.php line 106:
An exception occurred while executing 'CREATE TABLE migrations (version VARCHAR(1024) NOT NULL, executed_at DATETIME NOT NULL COMMENT '(DC2Type:datetime_immutable)', PRIMARY KEY(version)) DEFAULT CHARACTER
SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes
In PDOConnection.php line 43:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes
In PDOConnection.php line 41:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes
I tried to reduce the doctrine_migrations.storage.table_storage.version_column_length, but then I'm running in another error:
$ ./bin/console doctrine:migrations:status
...
In BaseNode.php line 348:
Invalid configuration for path "doctrine_migrations.storage.table_storage.version_column_length": The minimum length for the version column is 1024.
In ExprBuilder.php line 189:
The minimum length for the version column is 1024.
How to set this up correctly and get the migrations tables generated?
It's not a (clean) solution, but at least a workaround:
Removing the configuration doctrine_migrations.storage.table_storage.version_column_length makes it work again. The resulting configuration looks then like this:
$ bin/console debug:config doctrine_migrations
...
Current configuration for extension with alias "doctrine_migrations"
====================================================================
doctrine_migrations:
name: 'My Migrations'
migrations_paths:
DoctrineMigrations: /var/www/html/src/Migrations
storage:
table_storage:
table_name: migrations
version_column_name: version
executed_at_column_name: executed_at
version_column_length: null
organize_migrations: false
all_or_nothing: false
dir_name: /var/www/html/src/bundles/Wings/DoctrineMigrations
namespace: Application\Migrations
table_name: migration_versions
column_name: version
column_length: 14
executed_at_column_name: executed_at
custom_template: null

SwiftMailer with file spool doesn't store emails

I try to set up SwiftMailer to use the spool file system. I'd follow the steps in the Symfony 3.4 documentation and I can't make it work like I want, the emails keep sending and there are not stocked in the folder I want.
There is my configuration :
config.yml
swiftmailer:
transport: '%mailer_transport%'
host: '%mailer_host%'
username: '%mailer_user%'
password: '%mailer_password%'
spool:
type: file
path: '%kernel.project_dir%/src/to/folder/Spool'
disable_delivery: true
PHP
$transport = new \Swift_SmtpTransport();
$mailer = new \Swift_Mailer($transport);
$message = (new \Swift_Message())
->setSubject('Test of spool email')
->setFrom(['test#mail.com' => 'Test mailer'])
->setTo('fake#mail.com')
->setBody("Email de test");
foreach($listeDestinataires as $desitnataire) {
$mailer->send($message);
}
I tried to empty dev and prod cache, but with no effects.
If I do php bin/console swiftmailer:debug I have this result :
Configured SwiftMailer Mailers
==============================
-------------------------- ----------- ------- ---------- ----------------
Name Transport Spool Delivery Single Address
-------------------------- ----------- ------- ---------- ----------------
default (default mailer) null YES NO
-------------------------- ----------- ------- ---------- ----------------
I don't know what I'm doing wrong...
Are you sending in the correct enviroment DEV or PROD?
Also try this: path: '%kernel.project_dir%/var/spool'
Does the directory exists?
Ex.: https://symfony.com/doc/current/email/spool.html

Homestead not loading the page (symfony)

I am working on Mac OSX El Capitan 10.11.2. I am quite new to vagrant and this would be my first project in Symfony. I set up the environment to start my first symfony 4 project. Everything was installed correctly (including VirtualBox, Vagrant). I updated my hosts file, I edited Homestead.yaml and at the end when I wanted to access my domain (symf01.test) in Chrome I get a message that this site can't be reached and a text file is downloaded automatically, containing such information:
<?php
use Symfony\Component\Debug\Debug;
use Symfony\Component\HttpFoundation\Request;
require dirname(__DIR__).'/config/bootstrap.php';
if ($_SERVER['APP_DEBUG']) { unmask(0000);
Debug::enable();}
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false)
{ Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);}
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false)
{ Request::setTrustedHosts([$trustedHosts]);}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
This is my Homestead.yaml file:
ip:"192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: /Users/username/Homestead/code/simba
to: /home/vagrant/simba
type: "nfs"
sites:
- map: symf01.test
to: /home/vagrant/simba/public
type: symfony
databases:
- homestead
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# zray:
# If you've already freely registered Z-Ray, you can place the token here.
# - email: foo#bar.com
# token: foo
# Don't forget to ensure that you have 'zray: "true"' for your site.
This is what I get when I run serve nginx status
For future reference, this helped:
...
sites:
- map: symf01.test
to: /home/vagrant/simba/public
type: symfony
to
...
sites:
- map: symf01.test
to: /home/vagrant/simba/public
type: "symfony4"
Difference is in syntax. Value of type needs to be under quotes.
That type tells Homestead how to modify .htaccess files so that your websites can be properly accessed.

Oracle dataguard is not working properly because a FAL[client]

I had two databases, a primary and secondary and a configured dataguard between both, i restarted the suse linux but when starting up databases, the replication is not being done, i think i took the wrong way to startup the standby database....no it is just mounted, i have a gap not posibble to be detected at standby gap table, and a 'no FAL server specified' problem at standby database, what could be wrong?
From Primary:
System parameters with non-default values:
processes = 1200
nls_date_format = "MM/DD/YYYY HH24:MI:SS"
memory_target = 8000M
memory_max_target = 8G
control_files = "/oracle/app/oradata/ora11g/control01.ctl"
control_files = "/oracle/app/oradata/ora11g/control02.ctl"
control_files = "/oracle/app/oradata/ora11g/control03.ctl"
db_block_size = 8192
compatible = "11.1.0.0.0"
log_archive_start = TRUE
log_archive_dest_1 = "LOCATION=/home/oracle/archive"
log_archive_format = "%t_%s_%r.dbf"
db_recovery_file_dest = "/oracle/app/flash_recovery_area"
db_recovery_file_dest_size= 2G
undo_tablespace = "UNDOTBS1"
sec_case_sensitive_logon = FALSE
remote_login_passwordfile= "EXCLUSIVE"
db_domain = ""
dispatchers = "(PROTOCOL=TCP) (SERVICE=ora11gXDB)"
local_listener = ""
remote_listener = ""
session_cached_cursors = 450
cursor_sharing = "FORCE"
audit_file_dest = "/oracle/app/admin/ora11g/adump"
audit_trail = "NONE"
db_name = "ora11g"
open_cursors = 300
diagnostic_dest = "/oracle/app"
From standby database alert log:
Thu Feb 13 17:16:02 2014
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Picked latch-free SCN scheme 3
Autotune of undo retention is turned on.
IMODE=BR
ILAT =145
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Starting up ORACLE RDBMS Version: 11.1.0.7.0.
Using parameter settings in server-side spfile
/oracle/app/product/11g/db/dbs/spfileora11g.ora
System parameters with non-default values:
processes = 1200
nls_date_format = "MM/DD/YYYY HH24:MI:SS"
memory_target = 8000M
memory_max_target = 8G
control_files = "/oracle/app/oradata/ora11g/control01.ctl"
control_files = "/oracle/app/oradata/ora11g/control02.ctl"
control_files = "/oracle/app/oradata/ora11g/control03.ctl"
db_block_size = 8192
compatible = "11.1.0.0.0"
log_archive_start = TRUE
log_archive_dest_1 = "LOCATION=/home/oracle/archive"
log_archive_format = "%t_%s_%r.dbf"
db_recovery_file_dest = "/oracle/app/flash_recovery_area"
db_recovery_file_dest_size= 2G
undo_tablespace = "UNDOTBS1"
sec_case_sensitive_logon = FALSE
remote_login_passwordfile= "EXCLUSIVE"
db_domain = ""
dispatchers = "(PROTOCOL=TCP) (SERVICE=ora11gXDB)"
local_listener = ""
remote_listener = ""
session_cached_cursors = 450
cursor_sharing = "FORCE"
audit_file_dest = "/oracle/app/admin/ora11g/adump"
audit_trail = "NONE"
db_name = "ora11g"
open_cursors = 300
diagnostic_dest = "/oracle/app"
Deprecated system parameters with specified values:
log_archive_start
End of deprecated system parameter listing
Thu Feb 13 17:16:04 2014
.
.
.
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES) (PROTOCOL=TCP))'...
Thu Feb 13 17:16:04 2014
MMNL started with pid=15, OS id=10039
starting up 1 shared server(s) ...
ORACLE_BASE from environment = /oracle/app
Thu Feb 13 17:16:04 2014
ALTER DATABASE MOUNT
Setting recovery target incarnation to 2
ARCH: STARTING ARCH PROCESSES
Thu Feb 13 17:16:09 2014
ARC0 started with pid=19, OS id=10272
Thu Feb 13 17:16:09 2014
ARC1 started with pid=20, OS id=10274
Thu Feb 13 17:16:09 2014
ARC2 started with pid=21, OS id=10276
ARC0: Archival started
ARC1: Archival started
ARC2: Archival started
Thu Feb 13 17:16:09 2014
ARC3 started with pid=22, OS id=10278
ARC3: Archival started
ARCH: STARTING ARCH PROCESSES COMPLETE
ARC0: Becoming the 'no FAL' ARCH
ARC0: Becoming the 'no SRL' ARCH
ARC0: Thread not mounted
ARC1: Becoming the heartbeat ARCH
ARC2: Thread not mounted
ARC1: Thread not mounted
ARC3: Thread not mounted
Successful mount of redo thread 1, with mount id 4235628820
Physical Standby Database mounted.
Lost write protection disabled
Completed: ALTER DATABASE MOUNT
FAL[client]: Error fetching gap sequence, no FAL server specified
Primary
SQL> select max(sequence#) from v$log_history;
MAX(SEQUENCE#)
--------------
1606
SQL> SELECT name FROM v$archived_log WHERE thread# = 1 AND dest_id = 1 AND sequence# BETWEEN 1591 and 1606;
/home/oracle/archive/1_1606_792822090.dbf
16 rows selected.
SQL> SELECT GROUP#, BYTES FROM V$LOG;
GROUP# BYTES
---------- ----------
1 52428800
2 52428800
3 52428800
Secondary
SQL> select max(sequence#) from v$log_history;
MAX(SEQUENCE#)
--------------
1591
SQL>select process, thread#, sequence#, status from v$managed_standby where process='MRP0';
no rows selected
SQL> SELECT GROUP#, BYTES FROM V$STANDBY_LOG;
no rows selected
You need to set to parameters in the init file or spfile(sqlplus)
In the Primary database :
FAL_SERVER='standby_database'
FAL_CLIENT='primary_database'
In the standby database :
FAL_SERVER='primary_database'
FAL_CLIENT='standby_database'
These two parameters are needed for fetching archived log files (FAL mean Fetch ArchiveLog).
Hope that i help you.
Kind
This question is 5 years old but I feel it hasn't been completely answered yet.
First how does oracle resolves the gap:
The MRP process is the one triggering the request for a GAP.
That process is turned on like so:
Without standby redo logs:
alter database recover managed standby database disconnect;
With standby redo:
alter database recover managed standby database using current logfile disconnect;
If you have only one standby database for your primary database, then fal_server and fal_client parameters actually don't need to be configured.
If the fal_server is missing, oracle will grab that information from log_archive_dest_n.
This means that log_archive_dest_2 needs to be configured also on the standby database.
So how to solve a GAP resolution issue:
Make sure log_archive_dest_n is setup in both primary and standby
Make sure that there's no typo in the "service" value of
log_archive_dest_n.
Make sure that the service value references a valid tns entry in tnsnames.ora
Make sure that the same password file is used on all nodes of your primary and standby cluster.
Make sure you can connect with sqlplus "sys/syspassword#primary as sysdba" and sqlplus "sys/syspassword#standby as sysdba" from both primary and standby.List item
The MRP process sends a GAP resolution requests every so often. If you want to get it immediately in order to make sure it works:
SQL>alter database recover managed standby database cancel;
SQL>alter database recover managed standby database using current logfile;
(use standby redo logs, it applies logs faster on standby)
fal_server and fal_client parameters actually exists if you want to setup a cascaded standby setup.
Primary DB A sends archived logs to standby B
If standby B becomes primary then send archived logs to standby C.
FAL behavior on 11.2 (Doc ID 1394472.1)
From 11.2 no need to mention FAL_CLIENT primary will take it from
log_archive_dest_n (remote destination standby from where it received
the FAL request) service.
FAL_SERVER And FAL_CLIENT Settings For Cascaded Standby (Doc ID 358767.1)

Resources