Data Backup and Recovery

snapdrive cmd in "snapshot create command" when server-agent used

chao
6,029 Views

Hi Guru

IHAC to use SC3.5 to backup Oracle DB running in Suse linux.  we installed ScServer in a windows server and installed ScAgent in Linux server.  we already installed and configure SDU in linux and test the command.  I found I could not enter linux command in GUI windows for "snapshot create command" and sounds I have to use rsh.  is it correct?

BTW, scAgent could not auto-start when linux server reboot.  How to set it?

BR

TC

1 ACCEPTED SOLUTION

ktenzer
6,026 Views

When you give the snapshot name for SD command make sure it is one of following:

%SNAME-%SNAP_TYPE_recent or %SNAME_%SNAP_TYPE_%SNAP_TIME

This is of course documented in the IAG so please look at that for further examples

In addition you will need to allow permission for SD command from agent. Edit the config/agent.conf file and add:

command: sdcli

Regards,

Keith

View solution in original post

10 REPLIES 10

justints
5,993 Views

You need to directly edit the config file and enter the command for snapshot (NTAP_SNAPSHOT_CREATE_CMD<#>) . No need to use rsh, you only need to enter the command, it will be executed directly on the agent by snapcreator.

For starting the agent at startup you mite need to create a init.d script or put it in rc.local.

Hope this helps.

Regards,

Justin Skariah

chao
5,993 Views

Hi

I try to add a line in configure file as below:

NTAP_SNAPSHOT_CREATE_CMD01=/usr/sbin/snapdrive snap create -fs /u01/app -snapname %SNAME_%SNAP_TYPE_%SNAP_TIME

(BTW, it's same result to use GUI to add a snapshot create command as add it directly to conf file)

but it still return error as:

########## SNAPSHOT CREATE COMMANDS ##########
44
[Fri Apr 27 16:51:52 2012] INFO: Running snapshot create command NTAP_SNAPSHOT_CREATE_CMD01 [/usr/sbin/snapdrive snap create -fs /u01/app -snapname %SNAME_%SNAP_TYPE_%SNAP_TIME]
45
[Fri Apr 27 16:51:18 2012] [133.9.206.165:9090(3.5.0.1)] ERROR: [agt-00011] Command [/usr/sbin/snapdrive snap create -fs /u01/app -snapname %SNAME_%SNAP_TYPE_%SNAP_TIME] is not allowed
46
[Fri Apr 27 16:51:54 2012] ERROR: [scf-00103] Running snapshot create command [/usr/sbin/snapdrive snap create -fs /u01/app -snapname %SNAME_%SNAP_TYPE_%SNAP_TIME] failed with exit code [1] and message [At least one command is not allowed to be executed remotely]
47
48
########## SNAPSHOT CREATE COMMANDS FINISHED WITH FAILURES ##########

in fact, in order to verify SC will call local (server side, windows) command or remote (Agent side, linux). I insert two cmd lines. one is "ls" and one is "dir".   the cmd "ls" return error.  so I think scServer only call local cmd.

Please advice.

ktenzer
6,027 Views

When you give the snapshot name for SD command make sure it is one of following:

%SNAME-%SNAP_TYPE_recent or %SNAME_%SNAP_TYPE_%SNAP_TIME

This is of course documented in the IAG so please look at that for further examples

In addition you will need to allow permission for SD command from agent. Edit the config/agent.conf file and add:

command: sdcli

Regards,

Keith

chao
5,992 Views

keith

Yes. after modified config/agent.conf and modify it as

host: scServer@*

command: snapdrive

I found %SNAME_%SNAP_TYPE_%SNAP_TIME could not work.  SC treat is as strings rather env varifiable. 

the command i used:

NTAP_SNAPSHOT_CREATE_CMD01=snapdrive snap create -fs /u01/app -snapname %SNAME_%SNAP_TYPE_%SNAP_TIME

in the log:

[Fri Apr 27 17:14:50 2012] INFO: Running snapshot create command NTAP_SNAPSHOT_CREATE_CMD01 [snapdrive snap create -fs /u01/app -snapname %SNAME_%SNAP_TYPE_%SNAP_TIME]

[Fri Apr 27 17:14:16 2012] [133.9.206.165:9090(3.5.0.1)] DEBUG: Executing command [snapdrive snap create -fs /u01/app -snapname %SNAME_%SNAP_TYPE_%SNAP_TIME]

[Fri Apr 27 17:14:18 2012] [133.9.206.165:9090(3.5.0.1)] TRACE: Command [snapdrive snap create -fs /u01/app -snapname %SNAME_%SNAP_TYPE_%SNAP_TIME] finished with

exit code: [0]

stdout: [Starting snap create /u01/app

  WARNING:  DO NOT CONTROL-C!

            If snap create is interrupted, incomplete snapdrive

         generated data may remain on the filer volume(s)

         which may interfere with other snap operations.

Successfully created snapshot ]

why  %SNAME_%SNAP_TYPE_%SNAP_TIME does work? what's matter?

BR

TC

ktenzer
5,992 Views

Snap Creator has a strict naming policy for snapshots

1) %SNAME-%SNAP_TYPE_recent

2) %SNAME-%SNAP_TYPE_%SNAP_TIME

You need to also set snapshot naming convention for option 1 SNAP_TIMESTAMP_ONLY=N and option 2 SNAP_TIMESTAMP_ONLY=Y

If SNAME=test and --policy is daily you would get snapshot like test-daily_recent or _<timestamp>

Regards,

Keith

chao
5,993 Views

Thank you very much.

I modify nothing but re-type the command.  (I saw it's as same as before).  but this time, it works.

chao
5,992 Views

I re-enter the cmd as below:  it works now. (I did not find any difference. )  not sure why it works again.

NTAP_SNAPSHOT_CREATE_CMD01=snapdrive snap create -fs /u01/app -snapname %SNAME-%SNAP_TYPE_%SNAP_TIME

ktenzer
5,992 Views

Before you had an error:

NTAP_SNAPSHOT_CREATE_CMD01=snapdrive snap create -fs /u01/app -snapname %SNAME_%SNAP_TYPE_%SNAP_TIME

You changed this to

NTAP_SNAPSHOT_CREATE_CMD01=snapdrive snap create -fs /u01/app -snapname %SNAME-%SNAP_TYPE_%SNAP_TIME

and now it works

Also keep in mind for this since you are using timstamp style you must set SNAP_TIMESTAMP_ONLY=Y

Regards,

Keith

chao
5,992 Views

Yes. I am so careless.  thanks!

BTW, I tried to copy scAgent to /etc/init.d and create link to rc3.d and rc5.d.  but did not work.  Do you have sample?

ktenzer
4,971 Views

We dont really have an sample's the script itself is a sample. The issue is every unix flavor has a slightly different way to handle start scripts. For example redhat uses chkconfig which requires adding a few lines to beginning of script http://linux.die.net/man/8/chkconfig chkconfig: and description:. Most other unix versions that dont use schkconfig will work if you simply copy the script to /etc/init.d and link to rc2.d for start, the link needs to be something like S99scAgent and in /etc/init.d just scAgent.

Regards,

Keith

Public